Sitelet https://github.com/kubernetes/kops/pull/18595/files
Skip to content
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
17 changes: 14 additions & 3 deletions cmd/kops/delete_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,20 @@ func RunDeleteCluster(ctx context.Context, f *util.Factory, out io.Writer, optio
}

klog.Info("Looking for cloud resources to delete")
allResources, err := resourceops.ListResources(cloud, cluster)
if err != nil {
return err
// Listing resources involves many cloud API calls; not all cloud SDKs retry transient errors
// (e.g. GCE 5xx), and a single failed call would otherwise abort the deletion. Retry a few
// times before giving up.
var allResources map[string]*resources.Resource
for attempt := 1; ; attempt++ {
allResources, err = resourceops.ListResources(cloud, cluster)
if err == nil {
break
}
if attempt >= 4 {
return err
}
klog.Warningf("error listing cloud resources, will retry: %v", err)
time.Sleep(options.interval)
}

clusterResources := make(map[string]*resources.Resource)
Expand Down
Loading