mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 07:27:21 +00:00
Merge pull request #47138 from smarterclayton/delete_collection
Automatic merge from submit-queue (batch tested with PRs 46979, 47078, 47138, 46916) DeleteCollection should include uninitialized resources Users who delete a collection expect all resources to be deleted, and users can also delete an uninitialized resource. To preserve this expectation, DeleteCollection selects all resources regardless of initialization. The namespace controller should list uninitialized resources in order to gate cleanup of a namespace. Fixes #47137
This commit is contained in:
@@ -379,7 +379,7 @@ func (d *namespacedResourcesDeleter) listCollection(
|
||||
}
|
||||
|
||||
apiResource := metav1.APIResource{Name: gvr.Resource, Namespaced: true}
|
||||
obj, err := dynamicClient.Resource(&apiResource, namespace).List(metav1.ListOptions{})
|
||||
obj, err := dynamicClient.Resource(&apiResource, namespace).List(metav1.ListOptions{IncludeUninitialized: true})
|
||||
if err == nil {
|
||||
unstructuredList, ok := obj.(*unstructured.UnstructuredList)
|
||||
if !ok {
|
||||
@@ -553,7 +553,7 @@ func (d *namespacedResourcesDeleter) estimateGracefulTerminationForPods(ns strin
|
||||
if podsGetter == nil || reflect.ValueOf(podsGetter).IsNil() {
|
||||
return estimate, fmt.Errorf("unexpected: podsGetter is nil. Cannot estimate grace period seconds for pods")
|
||||
}
|
||||
items, err := podsGetter.Pods(ns).List(metav1.ListOptions{})
|
||||
items, err := podsGetter.Pods(ns).List(metav1.ListOptions{IncludeUninitialized: true})
|
||||
if err != nil {
|
||||
return estimate, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user