Skip to content

Commit 50a5fd1

Browse files
committed
fixup! fix: remove unnecessary code to pre-create the namespace
Let CAAPH create the namespace. We can revert in a follow up if we need to guarnatee the namespace for other resources.
1 parent 802e716 commit 50a5fd1

File tree

1 file changed

+0
-27
lines changed
  • pkg/handlers/generic/lifecycle/registrymirror/distribution

1 file changed

+0
-27
lines changed

pkg/handlers/generic/lifecycle/registrymirror/distribution/handler.go

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -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

2624
const (
@@ -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

Comments
 (0)