mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 05:57:25 +00:00
Expect namespace deletion in NamespaceController
Using new fake clientset registry exposes the actual flow on pending namespace finalization: get namespace, create finalizer, list pods and delete namespace if there are no pods.
This commit is contained in:
parent
aff173f7d1
commit
1f48cd27e7
@ -82,7 +82,7 @@ func ObjectReaction(tracker ObjectTracker, mapper meta.RESTMapper) ReactionFunc
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Here and below we need to switch on implementation types,
|
// Here and below we need to switch on implementation types,
|
||||||
// no on interfaces, as some interfaces are identical
|
// not on interfaces, as some interfaces are identical
|
||||||
// (e.g. UpdateAction and CreateAction), so if we use them,
|
// (e.g. UpdateAction and CreateAction), so if we use them,
|
||||||
// updates and creates end up matching the same case branch.
|
// updates and creates end up matching the same case branch.
|
||||||
switch action := action.(type) {
|
switch action := action.(type) {
|
||||||
|
@ -133,8 +133,9 @@ func testSyncNamespaceThatIsTerminating(t *testing.T, versions *unversioned.APIV
|
|||||||
testNamespace: testNamespacePendingFinalize,
|
testNamespace: testNamespacePendingFinalize,
|
||||||
kubeClientActionSet: sets.NewString(
|
kubeClientActionSet: sets.NewString(
|
||||||
strings.Join([]string{"get", "namespaces", ""}, "-"),
|
strings.Join([]string{"get", "namespaces", ""}, "-"),
|
||||||
strings.Join([]string{"list", "pods", ""}, "-"),
|
|
||||||
strings.Join([]string{"create", "namespaces", "finalize"}, "-"),
|
strings.Join([]string{"create", "namespaces", "finalize"}, "-"),
|
||||||
|
strings.Join([]string{"list", "pods", ""}, "-"),
|
||||||
|
strings.Join([]string{"delete", "namespaces", ""}, "-"),
|
||||||
),
|
),
|
||||||
dynamicClientActionSet: dynamicClientActionSet,
|
dynamicClientActionSet: dynamicClientActionSet,
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user