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

fix: handle missing MC resource group on abe2e clusters #5314

Merged
merged 4 commits into from
Nov 21, 2024
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
10 changes: 10 additions & 0 deletions e2e/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,16 @@ func getOrCreateCluster(ctx context.Context, t *testing.T, cluster *armcontainer
t.Logf("cluster %s already exists in rg %s\n", *cluster.Name, config.ResourceGroupName)
switch *existingCluster.Properties.ProvisioningState {
case "Succeeded":
nodeRGExists, err := isExistingResourceGroup(ctx, *existingCluster.Properties.NodeResourceGroup)
if err != nil {
return nil, fmt.Errorf("checking node resource group existence of cluster %s: %w", *cluster.Name, err)
}
if !nodeRGExists {
// we need to recreate in the case where the cluster is in the "Succeeded" provisioning state,
// though it's corresponding node resource group has been garbage collected
t.Logf("node resource group of cluster %s does not exist, will attempt to recreate", *cluster.Name)
return createNewAKSClusterWithRetry(ctx, t, cluster, config.ResourceGroupName)
}
return &existingCluster.ManagedCluster, nil
case "Creating", "Updating":
return waitUntilClusterReady(ctx, config.ResourceGroupName, *cluster.Name)
Expand Down
Loading