diff --git a/coredns/go.mod b/coredns/go.mod index 534b29014..1433ea6e2 100644 --- a/coredns/go.mod +++ b/coredns/go.mod @@ -15,7 +15,7 @@ require ( k8s.io/api v0.27.3 k8s.io/apimachinery v0.27.3 k8s.io/client-go v0.27.3 - k8s.io/utils v0.0.0-20230209194617-a36077c30491 + k8s.io/utils v0.0.0-20230505201702-9f6742963106 sigs.k8s.io/controller-runtime v0.15.0 sigs.k8s.io/mcs-api v0.1.0 ) diff --git a/coredns/go.sum b/coredns/go.sum index 0b0869660..2afbd2a8a 100644 --- a/coredns/go.sum +++ b/coredns/go.sum @@ -1376,8 +1376,8 @@ k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20221107191617-1a15be271d1d/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= k8s.io/utils v0.0.0-20221128185143-99ec85e7a448/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -k8s.io/utils v0.0.0-20230209194617-a36077c30491 h1:r0BAOLElQnnFhE/ApUsg3iHdVYYPBjNSSOMowRZxxsY= -k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20230505201702-9f6742963106 h1:EObNQ3TW2D+WptiYXlApGNLVy0zm/JIBVY9i+M4wpAU= +k8s.io/utils v0.0.0-20230505201702-9f6742963106/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/coredns/resolver/fake/cluster_status.go b/coredns/resolver/fake/cluster_status.go index 9006a8113..4e1f6f4b3 100644 --- a/coredns/resolver/fake/cluster_status.go +++ b/coredns/resolver/fake/cluster_status.go @@ -22,18 +22,18 @@ import ( "sync" "sync/atomic" - "k8s.io/apimachinery/pkg/util/sets" + "k8s.io/utils/set" ) type ClusterStatus struct { mutex sync.Mutex - connectedClusterIDs sets.Set[string] + connectedClusterIDs set.Set[string] localClusterID atomic.Value } func NewClusterStatus(localClusterID string, isConnected ...string) *ClusterStatus { c := &ClusterStatus{ - connectedClusterIDs: sets.New(isConnected...), + connectedClusterIDs: set.New(isConnected...), } c.localClusterID.Store(localClusterID) @@ -60,7 +60,7 @@ func (c *ClusterStatus) DisconnectAll() { c.mutex.Lock() defer c.mutex.Unlock() - c.connectedClusterIDs = sets.New[string]() + c.connectedClusterIDs = set.New[string]() } func (c *ClusterStatus) DisconnectClusterID(clusterID string) { diff --git a/go.mod b/go.mod index 9066d9c36..97a724db4 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( k8s.io/apimachinery v0.27.3 k8s.io/client-go v0.27.3 k8s.io/klog/v2 v2.100.1 - k8s.io/utils v0.0.0-20230209194617-a36077c30491 + k8s.io/utils v0.0.0-20230505201702-9f6742963106 sigs.k8s.io/controller-runtime v0.15.0 sigs.k8s.io/mcs-api v0.1.0 ) diff --git a/go.sum b/go.sum index 9cdb7f4b4..d3b8a407a 100644 --- a/go.sum +++ b/go.sum @@ -661,8 +661,8 @@ k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5F k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg= k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200603063816-c1c6865ac451/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20230209194617-a36077c30491 h1:r0BAOLElQnnFhE/ApUsg3iHdVYYPBjNSSOMowRZxxsY= -k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20230505201702-9f6742963106 h1:EObNQ3TW2D+WptiYXlApGNLVy0zm/JIBVY9i+M4wpAU= +k8s.io/utils v0.0.0-20230505201702-9f6742963106/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7/go.mod h1:PHgbrJT7lCHcxMU+mDHEm+nx46H4zuuHZkDP6icnhu0= sigs.k8s.io/controller-runtime v0.6.1/go.mod h1:XRYBPdbf5XJu9kpS84VJiZ7h/u1hF3gEORz0efEja7A= sigs.k8s.io/controller-runtime v0.15.0 h1:ML+5Adt3qZnMSYxZ7gAverBLNPSMQEibtzAgp0UPojU= diff --git a/pkg/agent/controller/service_import.go b/pkg/agent/controller/service_import.go index 6a7397a1c..6af513b4b 100644 --- a/pkg/agent/controller/service_import.go +++ b/pkg/agent/controller/service_import.go @@ -36,9 +36,9 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/sets" "k8s.io/client-go/dynamic" "k8s.io/client-go/tools/cache" + "k8s.io/utils/set" mcsv1a1 "sigs.k8s.io/mcs-api/pkg/apis/v1alpha1" ) @@ -93,7 +93,7 @@ func newServiceImportController(spec *AgentSpecification, syncerMetricNames Agen brokerClient: brokerClient.Resource(serviceImportGVR).Namespace(brokerNamespace), listLocalServiceImports: controller.localSyncer.ListResources, converter: converter{scheme: syncerConfig.Scheme}, - deletedLocalServiceImportsOnBroker: sets.New[string](), + deletedLocalServiceImportsOnBroker: set.New[string](), } controller.remoteSyncer, err = syncer.NewResourceSyncer(&syncer.ResourceSyncerConfig{ diff --git a/pkg/agent/controller/service_import_migrator.go b/pkg/agent/controller/service_import_migrator.go index f25a3c50d..3dac836ae 100644 --- a/pkg/agent/controller/service_import_migrator.go +++ b/pkg/agent/controller/service_import_migrator.go @@ -28,8 +28,8 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/sets" "k8s.io/client-go/dynamic" + "k8s.io/utils/set" mcsv1a1 "sigs.k8s.io/mcs-api/pkg/apis/v1alpha1" ) @@ -45,7 +45,7 @@ type ServiceImportMigrator struct { clusterID string localNamespace string converter converter - deletedLocalServiceImportsOnBroker sets.Set[string] + deletedLocalServiceImportsOnBroker set.Set[string] } func (c *ServiceImportMigrator) onRemoteServiceImport(serviceImport *mcsv1a1.ServiceImport) (runtime.Object, bool) {