@@ -12,15 +12,13 @@ import (
1212 "github.com/go-logr/logr"
1313 "github.com/spf13/pflag"
1414 clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
15- "sigs.k8s.io/cluster-api/controllers/remote"
1615 ctrlclient "sigs.k8s.io/controller-runtime/pkg/client"
1716
1817 "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/api/v1alpha1"
1918 "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/generic/lifecycle/addons"
2019 "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/generic/lifecycle/config"
2120 "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/generic/lifecycle/registrymirror/utils"
2221 "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/options"
23- handlersutils "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/utils"
2422)
2523
2624const (
@@ -69,31 +67,6 @@ func (n *Distribution) Apply(
6967) error {
7068 log .Info ("Applying Distribution registry mirror installation" )
7169
72- remoteClient , err := remote .NewClusterClient (
73- ctx ,
74- "" ,
75- n .client ,
76- ctrlclient .ObjectKeyFromObject (cluster ),
77- )
78- if err != nil {
79- return fmt .Errorf ("error creating remote cluster client: %w" , err )
80- }
81-
82- err = handlersutils .EnsureNamespaceWithMetadata (
83- ctx ,
84- remoteClient ,
85- DefaultHelmReleaseNamespace ,
86- nil ,
87- nil ,
88- )
89- if err != nil {
90- return fmt .Errorf (
91- "failed to ensure release namespace %q exists: %w" ,
92- DefaultHelmReleaseName ,
93- err ,
94- )
95- }
96-
9770 helmChartInfo , err := n .helmChartInfoGetter .For (ctx , log , config .DistributionRegistryMirror )
9871 if err != nil {
9972 return fmt .Errorf ("failed to get Distribution registry mirror helm chart: %w" , err )
0 commit comments