@@ -23,7 +23,7 @@ import (
2323 "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/patches"
2424 "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/patches/selectors"
2525 "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/variables"
26- registrymirrorutils "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/generic/lifecycle/registrymirror /utils"
26+ registryutils "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/generic/lifecycle/registry /utils"
2727 handlersutils "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/utils"
2828)
2929
@@ -84,24 +84,24 @@ func (h *globalMirrorPatchHandler) Mutate(
8484 v1alpha1 .ImageRegistriesVariableName ,
8585 )
8686
87- _ , registryMirrorErr := variables .Get [v1alpha1.RegistryMirror ](
87+ _ , registryAddonErr := variables .Get [v1alpha1.RegistryAddon ](
8888 vars ,
8989 v1alpha1 .ClusterConfigVariableName ,
90- []string {"addons" , v1alpha1 .RegistryMirrorVariableName }... )
90+ []string {"addons" , v1alpha1 .RegistryAddonVariableName }... )
9191
9292 switch {
9393 case variables .IsNotFoundError (imageRegistriesErr ) &&
9494 variables .IsNotFoundError (globalMirrorErr ) &&
95- variables .IsNotFoundError (registryMirrorErr ):
95+ variables .IsNotFoundError (registryAddonErr ):
9696 log .V (5 ).
97- Info ("Image Registry Credentials and Global Registry Mirror and Registry Mirror Addon variable not defined" )
97+ Info ("Image Registry Credentials and Global Registry Mirror and Registry Addon variable not defined" )
9898 return nil
9999 case imageRegistriesErr != nil && ! variables .IsNotFoundError (imageRegistriesErr ):
100100 return imageRegistriesErr
101101 case globalMirrorErr != nil && ! variables .IsNotFoundError (globalMirrorErr ):
102102 return globalMirrorErr
103- case registryMirrorErr != nil && ! variables .IsNotFoundError (registryMirrorErr ):
104- return registryMirrorErr
103+ case registryAddonErr != nil && ! variables .IsNotFoundError (registryAddonErr ):
104+ return registryAddonErr
105105 }
106106
107107 var registriesWithOptionalCA []containerdConfig //nolint:prealloc // We don't know the size of the slice yet.
@@ -133,7 +133,7 @@ func (h *globalMirrorPatchHandler) Mutate(
133133 registryWithOptionalCredentials ,
134134 )
135135 }
136- if registryMirrorErr == nil {
136+ if registryAddonErr == nil {
137137 cluster , err := clusterGetter (ctx )
138138 if err != nil {
139139 log .Error (
@@ -143,7 +143,7 @@ func (h *globalMirrorPatchHandler) Mutate(
143143 return err
144144 }
145145
146- registryConfig , err := containerdConfigFromRegistryMirrorAddon (cluster )
146+ registryConfig , err := containerdConfigFromRegistryAddon (cluster )
147147 if err != nil {
148148 return err
149149 }
@@ -262,10 +262,10 @@ func containerdConfigFromImageRegistry(
262262 return configWithOptionalCACert , nil
263263}
264264
265- func containerdConfigFromRegistryMirrorAddon (cluster * clusterv1.Cluster ) (containerdConfig , error ) {
266- serviceIP , err := registrymirrorutils .ServiceIPForCluster (cluster )
265+ func containerdConfigFromRegistryAddon (cluster * clusterv1.Cluster ) (containerdConfig , error ) {
266+ serviceIP , err := registryutils .ServiceIPForCluster (cluster )
267267 if err != nil {
268- return containerdConfig {}, fmt .Errorf ("error getting service IP for the registry mirror addon: %w" , err )
268+ return containerdConfig {}, fmt .Errorf ("error getting service IP for the registry addon: %w" , err )
269269 }
270270
271271 config := containerdConfig {
0 commit comments