@@ -7,24 +7,26 @@ import (
77 "github.com/openshift/installer/pkg/types"
88)
99
10- type SourceSetKey struct {
10+ // sourceSetKey represents the set of fields that have to be unique to form
11+ // a merged list without duplicate entries for Image sources.
12+ type sourceSetKey struct {
1113 Source string
1214 SourcePolicy configv1.MirrorSourcePolicy
1315}
1416
1517// MergedMirrorSets consolidates a list of ImageDigestSources so that each
1618// source appears only once.
1719func MergedMirrorSets (sources []types.ImageDigestSource ) []types.ImageDigestSource {
18- sourceSet := make (map [SourceSetKey ][]string )
19- mirrorSet := make (map [SourceSetKey ]sets.String )
20- orderedSources := []SourceSetKey {}
20+ sourceSet := make (map [sourceSetKey ][]string )
21+ mirrorSet := make (map [sourceSetKey ]sets.Set [ string ] )
22+ orderedSources := []sourceSetKey {}
2123
2224 for _ , group := range sources {
23- key := SourceSetKey {Source : group .Source , SourcePolicy : group .SourcePolicy }
25+ key := sourceSetKey {Source : group .Source , SourcePolicy : group .SourcePolicy }
2426 if _ , ok := sourceSet [key ]; ! ok {
2527 orderedSources = append (orderedSources , key )
2628 sourceSet [key ] = nil
27- mirrorSet [key ] = sets .NewString ()
29+ mirrorSet [key ] = sets .New [ string ] ()
2830 }
2931 for _ , mirror := range group .Mirrors {
3032 if ! mirrorSet [key ].Has (mirror ) {
0 commit comments