From a43f8cc5df63f89b72847716e2608816f2dceaf3 Mon Sep 17 00:00:00 2001 From: Mark Hamzy Date: Thu, 18 Dec 2025 09:22:59 -0600 Subject: [PATCH] PowerVC: fix PostProvision New code was added that we need to avoid. Also, we need to create OpenStack's Metadata structure. --- pkg/asset/cluster/metadata.go | 1 + pkg/infrastructure/openstack/clusterapi/clusterapi.go | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pkg/asset/cluster/metadata.go b/pkg/asset/cluster/metadata.go index 8e1f4ef54e..1663311357 100644 --- a/pkg/asset/cluster/metadata.go +++ b/pkg/asset/cluster/metadata.go @@ -100,6 +100,7 @@ func (m *Metadata) Generate(_ context.Context, parents asset.Parents) (err error case vspheretypes.Name: metadata.ClusterPlatformMetadata.VSphere = vsphere.Metadata(installConfig.Config) case powervctypes.Name: + metadata.ClusterPlatformMetadata.OpenStack = openstack.Metadata(clusterID.InfraID, installConfig.Config) metadata.ClusterPlatformMetadata.PowerVC = powervc.Metadata(clusterID.InfraID, installConfig.Config) case powervstypes.Name: metadata.ClusterPlatformMetadata.PowerVS, err = powervs.Metadata(installConfig.Config, installConfig.PowerVS) diff --git a/pkg/infrastructure/openstack/clusterapi/clusterapi.go b/pkg/infrastructure/openstack/clusterapi/clusterapi.go index f6e3b40d36..04fcf6304e 100644 --- a/pkg/infrastructure/openstack/clusterapi/clusterapi.go +++ b/pkg/infrastructure/openstack/clusterapi/clusterapi.go @@ -202,9 +202,12 @@ func (p Provider) PostDestroy(ctx context.Context, in clusterapi.PostDestroyerIn errs = append(errs, err) } - // Delete security groups tagged with the cluster ID and bootstrap role - if err := postdestroy.SecurityGroups(ctx, cloud, infraID); err != nil { - errs = append(errs, err) + // If we are not a PowerVC driver, then deal with security groups + if in.Metadata.PowerVC == nil { + // Delete security groups tagged with the cluster ID and bootstrap role + if err := postdestroy.SecurityGroups(ctx, cloud, infraID); err != nil { + errs = append(errs, err) + } } return errors.Join(errs...)