From 57b6126a4f82604868ef04f2b9108cfce78c7a50 Mon Sep 17 00:00:00 2001 From: Jim Minter Date: Fri, 13 Nov 2020 17:17:16 -0600 Subject: [PATCH] don't try to delete resources in an RG that doesn't exist --- pkg/cluster/delete.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/cluster/delete.go b/pkg/cluster/delete.go index 73cb897be..0cd44d6ec 100644 --- a/pkg/cluster/delete.go +++ b/pkg/cluster/delete.go @@ -127,6 +127,11 @@ func (m *manager) deleteResources(ctx context.Context) error { resourceGroup := stringutils.LastTokenByte(m.doc.OpenShiftCluster.Properties.ClusterProfile.ResourceGroupID, '/') resources, err := m.resources.ListByResourceGroup(ctx, resourceGroup, "", "", nil) + if detailedErr, ok := err.(autorest.DetailedError); ok && + (detailedErr.StatusCode == http.StatusNotFound || + detailedErr.StatusCode == http.StatusForbidden) { + return nil + } if err != nil { return err }