From e2acf59ad5e5f6fc0d81f250b28ac24a7d8f9af1 Mon Sep 17 00:00:00 2001 From: cadenmarchese Date: Thu, 7 Dec 2023 10:27:22 -0500 Subject: [PATCH] remove managedBy check --- hack/clean/clean.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hack/clean/clean.go b/hack/clean/clean.go index a5f53d1914c..cd6c8657125 100644 --- a/hack/clean/clean.go +++ b/hack/clean/clean.go @@ -121,17 +121,17 @@ func contains(s []string, e string) bool { } func (s settings) shouldDelete(resourceGroup mgmtfeatures.ResourceGroup, log *logrus.Entry) bool { - //assume its a prod cluster, dev clusters will have purge tag - devCluster := false - if resourceGroup.Tags != nil { - _, devCluster = resourceGroup.Tags["purge"] - } - // don't mess with clusters in RGs managed by a production RP. Although // the production deny assignment will prevent us from breaking most // things, that does not include us potentially detaching the cluster's // NSG from the vnet, thus breaking inbound access to the cluster. - if !devCluster && resourceGroup.ManagedBy != nil && *resourceGroup.ManagedBy != "" { + // We use purge=true to distinguish between dev and prod clusters: + // https://github.com/Azure/ARO-RP/blob/master/pkg/cluster/deploybaseresources.go#L81-L87 + devCluster := false + if resourceGroup.Tags != nil { + _, devCluster = resourceGroup.Tags["purge"] + } + if !devCluster { return false }