Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add priority deletion ordering of nested Microsoft.Compute/galleries resources #3114

Merged
merged 1 commit into from
Aug 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions pkg/cluster/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,17 @@ func (m *manager) disconnectSecurityGroup(ctx context.Context, resourceID string
// parallel and waiting for completion before we proceed. Any type not in the
// map is considered to be at level 0. Keys must be lower case.
var deleteOrder = map[string]int{
"microsoft.compute/virtualmachines": -2, // first, and before microsoft.compute/disks, microsoft.network/networkinterfaces
"microsoft.network/privatelinkservices": -2, // before microsoft.network/loadbalancers
"microsoft.network/privateendpoints": -2, // before microsoft.network/networkinterfaces
"microsoft.network/networkinterfaces": -1, // before microsoft.network/loadbalancers
"microsoft.network/privatednszones": 1, // after everything else: get other deletions underway first
"microsoft.compute/virtualmachines": -3, // first, and before microsoft.compute/disks, microsoft.network/networkinterfaces
"microsoft.network/privatelinkservices": -3, // before microsoft.network/loadbalancers
"microsoft.network/privateendpoints": -3, // before microsoft.network/networkinterfaces
"microsoft.compute/galleries/applications/versions": -2, // before microsoft.compute/galleries/applications
"microsoft.compute/galleries/images/versions": -2, // before microsoft.compute/galleries/images
"microsoft.compute/galleries/applications": -1, // before microsoft.compute/galleries
"microsoft.compute/galleries/images": -1, // before microsoft.compute/galleries
"microsoft.compute/galleries/serviceArtifacts": -1, // before microsoft.compute/galleries
"microsoft.network/networkinterfaces": -1, // before microsoft.network/loadbalancers
bennerv marked this conversation as resolved.
Show resolved Hide resolved
"microsoft.network/privatednszones": 1, // after everything else: get other deletions underway first
"microsoft.compute/galleries": 1, // after everything else in case there are nested microsoft.compute/galleries resources
}

func (m *manager) deleteResources(ctx context.Context) error {
Expand Down