Skip to content

Commit be61527

Browse files
committed
Fix linter errors
1 parent a27c0c7 commit be61527

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

pkg/asset/ignition/bootstrap/registries.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
11
package bootstrap
22

33
import (
4-
"k8s.io/apimachinery/pkg/util/sets"
5-
64
configv1 "github.com/openshift/api/config/v1"
75
"github.com/openshift/installer/pkg/types"
6+
"k8s.io/apimachinery/pkg/util/sets"
87
)
98

10-
type SourceSetKey struct {
9+
// sourceSetKey represents the set of fields that have to be unique to form
10+
// a merged list without duplicate entries for Image sources.
11+
type sourceSetKey struct {
1112
Source string
1213
SourcePolicy configv1.MirrorSourcePolicy
1314
}
1415

1516
// MergedMirrorSets consolidates a list of ImageDigestSources so that each
1617
// source appears only once.
1718
func MergedMirrorSets(sources []types.ImageDigestSource) []types.ImageDigestSource {
18-
sourceSet := make(map[SourceSetKey][]string)
19-
mirrorSet := make(map[SourceSetKey]sets.String)
20-
orderedSources := []SourceSetKey{}
19+
sourceSet := make(map[sourceSetKey][]string)
20+
mirrorSet := make(map[sourceSetKey]sets.Set[string])
21+
orderedSources := []sourceSetKey{}
2122

2223
for _, group := range sources {
23-
key := SourceSetKey{Source: group.Source, SourcePolicy: group.SourcePolicy}
24+
key := sourceSetKey{Source: group.Source, SourcePolicy: group.SourcePolicy}
2425
if _, ok := sourceSet[key]; !ok {
2526
orderedSources = append(orderedSources, key)
2627
sourceSet[key] = nil
27-
mirrorSet[key] = sets.NewString()
28+
mirrorSet[key] = sets.New[string]()
2829
}
2930
for _, mirror := range group.Mirrors {
3031
if !mirrorSet[key].Has(mirror) {

0 commit comments

Comments
 (0)