shamrickus commented on a change in pull request #5924:
URL: https://github.com/apache/trafficcontrol/pull/5924#discussion_r652105472



##########
File path: tools/traffic_vault_migrate/traffic_vault_migrate.go
##########
@@ -400,6 +356,49 @@ type TVBackend interface {
        SetURLSigKeys([]URLSigKey) error
 }
 
+// Secrets contains every key to be migrated
+type Secrets struct {
+       sslkeys    []SSLKey
+       dnssecKeys []DNSSecKey
+       uriKeys    []URISignKey
+       urlKeys    []URLSigKey
+}
+
+func (s *Secrets) sort() {
+       sort.Slice(s.sslkeys[:], func(a, b int) bool {
+               return s.sslkeys[a].CDN < s.sslkeys[b].CDN ||
+                       s.sslkeys[a].CDN == s.sslkeys[b].CDN && 
s.sslkeys[a].DeliveryService < s.sslkeys[b].DeliveryService
+       })
+       sort.Slice(s.dnssecKeys[:], func(a, b int) bool {
+               return s.dnssecKeys[a].CDN < s.dnssecKeys[b].CDN
+       })
+       sort.Slice(s.uriKeys[:], func(a, b int) bool {
+               return s.uriKeys[a].DeliveryService < 
s.uriKeys[b].DeliveryService
+       })
+       sort.Slice(s.urlKeys[:], func(a, b int) bool {
+               return s.urlKeys[a].DeliveryService < 
s.urlKeys[b].DeliveryService
+       })
+}
+func (s *Secrets) dump(directory string) {

Review comment:
       Added an option `fill` to import data.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to