Skip to content

Commit 6f0f22b

Browse files
committed
fix: set ownerRef on Nutanix CCM Secret
1 parent d8b54a9 commit 6f0f22b

File tree

1 file changed

+12
-0
lines changed
  • pkg/handlers/generic/lifecycle/ccm/nutanix

1 file changed

+12
-0
lines changed

pkg/handlers/generic/lifecycle/ccm/nutanix/handler.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,18 @@ func (p *provider) Apply(
9898
// However, that would leave the credentials visible in the HelmChartProxy.
9999
// Instead, we'll create the Secret on the remote cluster and reference it in the Helm values.
100100
if clusterConfig.Addons.CCM.Credentials != nil {
101+
err = lifecycleutils.EnsureOwnerRefForSecret(
102+
ctx,
103+
p.client,
104+
clusterConfig.Addons.CCM.Credentials.SecretRef.Name,
105+
cluster,
106+
)
107+
if err != nil {
108+
return fmt.Errorf(
109+
"error updating owner references on Nutanix CCM source Secret: %w",
110+
err,
111+
)
112+
}
101113
key := ctrlclient.ObjectKey{
102114
Name: defaultCredentialsSecretName,
103115
Namespace: defaultHelmReleaseNamespace,

0 commit comments

Comments
 (0)