Skip to content

Commit 16356ae

Browse files
committed
CORS-2905: capi/aws: destroy CAPA security groups
Because of how the CCM selects a Load Balancer security group by using the "kubernetes.io/cluster/<infraID>: owned" tag, CAPA removes that tag from all the other security groups [1]. That means that when the Installer is looking for resources to delete with that tag, it will never find those security groups and they'll stay behind. To avoid that, let's also search for resources with the "sigs.k8s.io/cluster-api-provider-aws/cluster/<infraID>: owned" tag during cluster destroy. [1] kubernetes-sigs/cluster-api-provider-aws#4571
1 parent 0eafdbb commit 16356ae

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pkg/asset/cluster/aws/aws.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ import (
2020
func Metadata(clusterID, infraID string, config *types.InstallConfig) *awstypes.Metadata {
2121
return &awstypes.Metadata{
2222
Region: config.Platform.AWS.Region,
23-
Identifier: []map[string]string{{
24-
fmt.Sprintf("kubernetes.io/cluster/%s", infraID): "owned",
25-
}, {
26-
"openshiftClusterID": clusterID,
27-
}},
23+
Identifier: []map[string]string{
24+
{fmt.Sprintf("kubernetes.io/cluster/%s", infraID): "owned"},
25+
{"openshiftClusterID": clusterID},
26+
{fmt.Sprintf("sigs.k8s.io/cluster-api-provider-aws/cluster/%s", infraID): "owned"},
27+
},
2828
ServiceEndpoints: config.AWS.ServiceEndpoints,
2929
ClusterDomain: config.ClusterDomain(),
3030
HostedZoneRole: config.AWS.HostedZoneRole,

0 commit comments

Comments
 (0)