mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
Move pkg/api.FinanlizerOrphan into metav1
This commit is contained in:
parent
871fc426b3
commit
ef8bb4e7e7
@ -101,7 +101,7 @@ func TestDaemonSetController(t *testing.T) {
|
||||
updatedDaemonSet := GetDaemonSetFromChan(daemonsetUpdateChan)
|
||||
assert.True(t, daemonsetController.hasFinalizerFunc(updatedDaemonSet, deletionhelper.FinalizerDeleteFromUnderlyingClusters))
|
||||
updatedDaemonSet = GetDaemonSetFromChan(daemonsetUpdateChan)
|
||||
assert.True(t, daemonsetController.hasFinalizerFunc(updatedDaemonSet, apiv1.FinalizerOrphan))
|
||||
assert.True(t, daemonsetController.hasFinalizerFunc(updatedDaemonSet, metav1.FinalizerOrphan))
|
||||
daemonset1 = *updatedDaemonSet
|
||||
|
||||
createdDaemonSet := GetDaemonSetFromChan(cluster1CreateChan)
|
||||
|
@ -144,7 +144,7 @@ func TestIngressController(t *testing.T) {
|
||||
updatedIngress := GetIngressFromChan(t, fedIngressUpdateChan)
|
||||
assert.True(t, ingressController.hasFinalizerFunc(updatedIngress, deletionhelper.FinalizerDeleteFromUnderlyingClusters))
|
||||
updatedIngress = GetIngressFromChan(t, fedIngressUpdateChan)
|
||||
assert.True(t, ingressController.hasFinalizerFunc(updatedIngress, apiv1.FinalizerOrphan), fmt.Sprintf("ingress does not have the orphan finalizer: %v", updatedIngress))
|
||||
assert.True(t, ingressController.hasFinalizerFunc(updatedIngress, metav1.FinalizerOrphan), fmt.Sprintf("ingress does not have the orphan finalizer: %v", updatedIngress))
|
||||
fedIngress = *updatedIngress
|
||||
|
||||
t.Log("Checking that Ingress was correctly created in cluster 1")
|
||||
@ -305,7 +305,7 @@ func WaitForFinalizersInFederationStore(ingressController *IngressController, st
|
||||
return false, err
|
||||
}
|
||||
ingress := obj.(*extensionsv1beta1.Ingress)
|
||||
if ingressController.hasFinalizerFunc(ingress, apiv1.FinalizerOrphan) &&
|
||||
if ingressController.hasFinalizerFunc(ingress, metav1.FinalizerOrphan) &&
|
||||
ingressController.hasFinalizerFunc(ingress, deletionhelper.FinalizerDeleteFromUnderlyingClusters) {
|
||||
return true, nil
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ func TestNamespaceController(t *testing.T) {
|
||||
// Delete the namespace with orphan finalizer (let namespaces
|
||||
// in underlying clusters be as is).
|
||||
// TODO: Add a test without orphan finalizer.
|
||||
ns1.ObjectMeta.Finalizers = append(ns1.ObjectMeta.Finalizers, apiv1.FinalizerOrphan)
|
||||
ns1.ObjectMeta.Finalizers = append(ns1.ObjectMeta.Finalizers, metav1.FinalizerOrphan)
|
||||
ns1.DeletionTimestamp = &metav1.Time{Time: time.Now()}
|
||||
namespaceWatch.Modify(&ns1)
|
||||
assert.Equal(t, ns1.Name, GetStringFromChan(nsDeleteChan))
|
||||
|
@ -101,7 +101,7 @@ func TestSecretController(t *testing.T) {
|
||||
updatedSecret := GetSecretFromChan(secretUpdateChan)
|
||||
assert.True(t, secretController.hasFinalizerFunc(updatedSecret, deletionhelper.FinalizerDeleteFromUnderlyingClusters))
|
||||
updatedSecret = GetSecretFromChan(secretUpdateChan)
|
||||
assert.True(t, secretController.hasFinalizerFunc(updatedSecret, apiv1.FinalizerOrphan))
|
||||
assert.True(t, secretController.hasFinalizerFunc(updatedSecret, metav1.FinalizerOrphan))
|
||||
secret1 = *updatedSecret
|
||||
|
||||
// Verify that the secret is created in underlying cluster1.
|
||||
|
@ -24,11 +24,11 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/client-go/tools/record"
|
||||
"k8s.io/kubernetes/federation/pkg/federation-controller/util"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
api_v1 "k8s.io/kubernetes/pkg/api/v1"
|
||||
|
||||
"github.com/golang/glog"
|
||||
)
|
||||
@ -96,9 +96,9 @@ func (dh *DeletionHelper) EnsureFinalizers(obj runtime.Object) (
|
||||
return obj, err
|
||||
}
|
||||
}
|
||||
if !dh.hasFinalizerFunc(obj, api_v1.FinalizerOrphan) {
|
||||
glog.V(2).Infof("Adding finalizer %s to %s", api_v1.FinalizerOrphan, dh.objNameFunc(obj))
|
||||
obj, err := dh.addFinalizerFunc(obj, api_v1.FinalizerOrphan)
|
||||
if !dh.hasFinalizerFunc(obj, metav1.FinalizerOrphan) {
|
||||
glog.V(2).Infof("Adding finalizer %s to %s", metav1.FinalizerOrphan, dh.objNameFunc(obj))
|
||||
obj, err := dh.addFinalizerFunc(obj, metav1.FinalizerOrphan)
|
||||
if err != nil {
|
||||
return obj, err
|
||||
}
|
||||
@ -120,7 +120,7 @@ func (dh *DeletionHelper) HandleObjectInUnderlyingClusters(obj runtime.Object) (
|
||||
glog.V(2).Infof("obj does not have %s finalizer. Nothing to do", FinalizerDeleteFromUnderlyingClusters)
|
||||
return obj, nil
|
||||
}
|
||||
hasOrphanFinalizer := dh.hasFinalizerFunc(obj, api_v1.FinalizerOrphan)
|
||||
hasOrphanFinalizer := dh.hasFinalizerFunc(obj, metav1.FinalizerOrphan)
|
||||
if hasOrphanFinalizer {
|
||||
glog.V(2).Infof("Found finalizer orphan. Nothing to do, just remove the finalizer")
|
||||
// If the obj has FinalizerOrphan finalizer, then we need to orphan the
|
||||
@ -130,7 +130,7 @@ func (dh *DeletionHelper) HandleObjectInUnderlyingClusters(obj runtime.Object) (
|
||||
if err != nil {
|
||||
return obj, err
|
||||
}
|
||||
return dh.removeFinalizerFunc(obj, api_v1.FinalizerOrphan)
|
||||
return dh.removeFinalizerFunc(obj, metav1.FinalizerOrphan)
|
||||
}
|
||||
|
||||
glog.V(2).Infof("Deleting obj %s from underlying clusters", objName)
|
||||
|
@ -244,7 +244,7 @@ func IsServiceIPRequested(service *Service) bool {
|
||||
|
||||
var standardFinalizers = sets.NewString(
|
||||
string(FinalizerKubernetes),
|
||||
FinalizerOrphan,
|
||||
metav1.FinalizerOrphan,
|
||||
)
|
||||
|
||||
// HasAnnotation returns a bool if passed in annotation exists
|
||||
|
@ -2798,10 +2798,10 @@ type NamespaceSpec struct {
|
||||
// FinalizerName is the name identifying a finalizer during namespace lifecycle.
|
||||
type FinalizerName string
|
||||
|
||||
// These are internal finalizer values to Kubernetes, must be qualified name unless defined here
|
||||
// These are internal finalizer values to Kubernetes, must be qualified name unless defined here or
|
||||
// in metav1.
|
||||
const (
|
||||
FinalizerKubernetes FinalizerName = "kubernetes"
|
||||
FinalizerOrphan string = "orphan"
|
||||
)
|
||||
|
||||
// NamespaceStatus is information about the current status of a Namespace.
|
||||
|
@ -21,6 +21,7 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/selection"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
@ -82,7 +83,7 @@ func IsServiceIPRequested(service *Service) bool {
|
||||
|
||||
var standardFinalizers = sets.NewString(
|
||||
string(FinalizerKubernetes),
|
||||
FinalizerOrphan,
|
||||
metav1.FinalizerOrphan,
|
||||
)
|
||||
|
||||
func IsStandardFinalizerName(str string) bool {
|
||||
|
@ -3220,10 +3220,10 @@ type NodeList struct {
|
||||
// FinalizerName is the name identifying a finalizer during namespace lifecycle.
|
||||
type FinalizerName string
|
||||
|
||||
// These are internal finalizer values to Kubernetes, must be qualified name unless defined here
|
||||
// These are internal finalizer values to Kubernetes, must be qualified name unless defined here or
|
||||
// in metav1.
|
||||
const (
|
||||
FinalizerKubernetes FinalizerName = "kubernetes"
|
||||
FinalizerOrphan string = "orphan"
|
||||
)
|
||||
|
||||
// NamespaceSpec describes the attributes on a Namespace.
|
||||
|
@ -39,7 +39,6 @@ import (
|
||||
"k8s.io/client-go/tools/cache"
|
||||
"k8s.io/client-go/util/clock"
|
||||
"k8s.io/client-go/util/workqueue"
|
||||
"k8s.io/kubernetes/pkg/api/v1"
|
||||
"k8s.io/kubernetes/pkg/controller/garbagecollector/metaonly"
|
||||
|
||||
// import known versions
|
||||
@ -235,7 +234,7 @@ func shouldOrphanDependents(e *event, accessor metav1.Object) bool {
|
||||
}
|
||||
finalizers := accessor.GetFinalizers()
|
||||
for _, finalizer := range finalizers {
|
||||
if finalizer == v1.FinalizerOrphan {
|
||||
if finalizer == metav1.FinalizerOrphan {
|
||||
return true
|
||||
}
|
||||
}
|
||||
@ -280,7 +279,7 @@ func (gc *GarbageCollector) removeOrphanFinalizer(owner *node) error {
|
||||
var newFinalizers []string
|
||||
found := false
|
||||
for _, f := range finalizers {
|
||||
if f == v1.FinalizerOrphan {
|
||||
if f == metav1.FinalizerOrphan {
|
||||
found = true
|
||||
break
|
||||
} else {
|
||||
|
@ -25,7 +25,6 @@ import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
)
|
||||
|
||||
func TestDecoratedWatcher(t *testing.T) {
|
||||
|
@ -37,7 +37,6 @@ import (
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
|
||||
"k8s.io/apiserver/pkg/storage"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/genericapiserver/registry/generic"
|
||||
"k8s.io/kubernetes/pkg/genericapiserver/registry/rest"
|
||||
"k8s.io/kubernetes/pkg/registry/cachesize"
|
||||
@ -546,7 +545,7 @@ func shouldUpdateFinalizers(e *Store, accessor metav1.Object, options *metav1.De
|
||||
hasOrphanFinalizer := false
|
||||
finalizers := accessor.GetFinalizers()
|
||||
for _, f := range finalizers {
|
||||
if f == api.FinalizerOrphan {
|
||||
if f == metav1.FinalizerOrphan {
|
||||
shouldOrphan = true
|
||||
hasOrphanFinalizer = true
|
||||
break
|
||||
@ -558,13 +557,13 @@ func shouldUpdateFinalizers(e *Store, accessor metav1.Object, options *metav1.De
|
||||
shouldOrphan = *options.OrphanDependents
|
||||
}
|
||||
if shouldOrphan && !hasOrphanFinalizer {
|
||||
finalizers = append(finalizers, api.FinalizerOrphan)
|
||||
finalizers = append(finalizers, metav1.FinalizerOrphan)
|
||||
return true, finalizers
|
||||
}
|
||||
if !shouldOrphan && hasOrphanFinalizer {
|
||||
var newFinalizers []string
|
||||
for _, f := range finalizers {
|
||||
if f == api.FinalizerOrphan {
|
||||
if f == metav1.FinalizerOrphan {
|
||||
continue
|
||||
}
|
||||
newFinalizers = append(newFinalizers, f)
|
||||
|
@ -798,7 +798,7 @@ func TestStoreDeleteWithOrphanDependents(t *testing.T) {
|
||||
initialGeneration := int64(1)
|
||||
podWithOrphanFinalizer := func(name string) *api.Pod {
|
||||
return &api.Pod{
|
||||
ObjectMeta: metav1.ObjectMeta{Name: name, Finalizers: []string{"foo.com/x", api.FinalizerOrphan, "bar.com/y"}, Generation: initialGeneration},
|
||||
ObjectMeta: metav1.ObjectMeta{Name: name, Finalizers: []string{"foo.com/x", metav1.FinalizerOrphan, "bar.com/y"}, Generation: initialGeneration},
|
||||
Spec: api.PodSpec{NodeName: "machine"},
|
||||
}
|
||||
}
|
||||
@ -816,7 +816,7 @@ func TestStoreDeleteWithOrphanDependents(t *testing.T) {
|
||||
}
|
||||
podWithOnlyOrphanFinalizer := func(name string) *api.Pod {
|
||||
return &api.Pod{
|
||||
ObjectMeta: metav1.ObjectMeta{Name: name, Finalizers: []string{api.FinalizerOrphan}, Generation: initialGeneration},
|
||||
ObjectMeta: metav1.ObjectMeta{Name: name, Finalizers: []string{metav1.FinalizerOrphan}, Generation: initialGeneration},
|
||||
Spec: api.PodSpec{NodeName: "machine"},
|
||||
}
|
||||
}
|
||||
@ -844,28 +844,28 @@ func TestStoreDeleteWithOrphanDependents(t *testing.T) {
|
||||
orphanOptions,
|
||||
defaultDeleteStrategy,
|
||||
false,
|
||||
[]string{"foo.com/x", api.FinalizerOrphan, "bar.com/y"},
|
||||
[]string{"foo.com/x", metav1.FinalizerOrphan, "bar.com/y"},
|
||||
},
|
||||
{
|
||||
podWithOtherFinalizers("pod2"),
|
||||
orphanOptions,
|
||||
defaultDeleteStrategy,
|
||||
false,
|
||||
[]string{"foo.com/x", "bar.com/y", api.FinalizerOrphan},
|
||||
[]string{"foo.com/x", "bar.com/y", metav1.FinalizerOrphan},
|
||||
},
|
||||
{
|
||||
podWithNoFinalizer("pod3"),
|
||||
orphanOptions,
|
||||
defaultDeleteStrategy,
|
||||
false,
|
||||
[]string{api.FinalizerOrphan},
|
||||
[]string{metav1.FinalizerOrphan},
|
||||
},
|
||||
{
|
||||
podWithOnlyOrphanFinalizer("pod4"),
|
||||
orphanOptions,
|
||||
defaultDeleteStrategy,
|
||||
false,
|
||||
[]string{api.FinalizerOrphan},
|
||||
[]string{metav1.FinalizerOrphan},
|
||||
},
|
||||
// cases run with DeleteOptions.OrphanDedependents=false
|
||||
// these cases all have oprhanDeleteStrategy, which should be ignored
|
||||
@ -907,14 +907,14 @@ func TestStoreDeleteWithOrphanDependents(t *testing.T) {
|
||||
nilOrphanOptions,
|
||||
defaultDeleteStrategy,
|
||||
false,
|
||||
[]string{"foo.com/x", api.FinalizerOrphan, "bar.com/y"},
|
||||
[]string{"foo.com/x", metav1.FinalizerOrphan, "bar.com/y"},
|
||||
},
|
||||
{
|
||||
podWithOrphanFinalizer("pod10"),
|
||||
nilOrphanOptions,
|
||||
orphanDeleteStrategy,
|
||||
false,
|
||||
[]string{"foo.com/x", api.FinalizerOrphan, "bar.com/y"},
|
||||
[]string{"foo.com/x", metav1.FinalizerOrphan, "bar.com/y"},
|
||||
},
|
||||
{
|
||||
podWithOtherFinalizers("pod11"),
|
||||
@ -928,7 +928,7 @@ func TestStoreDeleteWithOrphanDependents(t *testing.T) {
|
||||
nilOrphanOptions,
|
||||
orphanDeleteStrategy,
|
||||
false,
|
||||
[]string{"foo.com/x", "bar.com/y", api.FinalizerOrphan},
|
||||
[]string{"foo.com/x", "bar.com/y", metav1.FinalizerOrphan},
|
||||
},
|
||||
{
|
||||
podWithNoFinalizer("pod13"),
|
||||
@ -942,21 +942,21 @@ func TestStoreDeleteWithOrphanDependents(t *testing.T) {
|
||||
nilOrphanOptions,
|
||||
orphanDeleteStrategy,
|
||||
false,
|
||||
[]string{api.FinalizerOrphan},
|
||||
[]string{metav1.FinalizerOrphan},
|
||||
},
|
||||
{
|
||||
podWithOnlyOrphanFinalizer("pod15"),
|
||||
nilOrphanOptions,
|
||||
defaultDeleteStrategy,
|
||||
false,
|
||||
[]string{api.FinalizerOrphan},
|
||||
[]string{metav1.FinalizerOrphan},
|
||||
},
|
||||
{
|
||||
podWithOnlyOrphanFinalizer("pod16"),
|
||||
nilOrphanOptions,
|
||||
orphanDeleteStrategy,
|
||||
false,
|
||||
[]string{api.FinalizerOrphan},
|
||||
[]string{metav1.FinalizerOrphan},
|
||||
},
|
||||
|
||||
// cases run with nil DeleteOptions should have exact same behavior.
|
||||
@ -967,14 +967,14 @@ func TestStoreDeleteWithOrphanDependents(t *testing.T) {
|
||||
nil,
|
||||
defaultDeleteStrategy,
|
||||
false,
|
||||
[]string{"foo.com/x", api.FinalizerOrphan, "bar.com/y"},
|
||||
[]string{"foo.com/x", metav1.FinalizerOrphan, "bar.com/y"},
|
||||
},
|
||||
{
|
||||
podWithOrphanFinalizer("pod18"),
|
||||
nil,
|
||||
orphanDeleteStrategy,
|
||||
false,
|
||||
[]string{"foo.com/x", api.FinalizerOrphan, "bar.com/y"},
|
||||
[]string{"foo.com/x", metav1.FinalizerOrphan, "bar.com/y"},
|
||||
},
|
||||
{
|
||||
podWithOtherFinalizers("pod19"),
|
||||
@ -988,7 +988,7 @@ func TestStoreDeleteWithOrphanDependents(t *testing.T) {
|
||||
nil,
|
||||
orphanDeleteStrategy,
|
||||
false,
|
||||
[]string{"foo.com/x", "bar.com/y", api.FinalizerOrphan},
|
||||
[]string{"foo.com/x", "bar.com/y", metav1.FinalizerOrphan},
|
||||
},
|
||||
{
|
||||
podWithNoFinalizer("pod21"),
|
||||
@ -1002,21 +1002,21 @@ func TestStoreDeleteWithOrphanDependents(t *testing.T) {
|
||||
nil,
|
||||
orphanDeleteStrategy,
|
||||
false,
|
||||
[]string{api.FinalizerOrphan},
|
||||
[]string{metav1.FinalizerOrphan},
|
||||
},
|
||||
{
|
||||
podWithOnlyOrphanFinalizer("pod23"),
|
||||
nil,
|
||||
defaultDeleteStrategy,
|
||||
false,
|
||||
[]string{api.FinalizerOrphan},
|
||||
[]string{metav1.FinalizerOrphan},
|
||||
},
|
||||
{
|
||||
podWithOnlyOrphanFinalizer("pod24"),
|
||||
nil,
|
||||
orphanDeleteStrategy,
|
||||
false,
|
||||
[]string{api.FinalizerOrphan},
|
||||
[]string{metav1.FinalizerOrphan},
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -141,7 +141,7 @@ func (r *REST) Delete(ctx genericapirequest.Context, name string, options *metav
|
||||
newFinalizers := []string{}
|
||||
for i := range existingNamespace.ObjectMeta.Finalizers {
|
||||
finalizer := existingNamespace.ObjectMeta.Finalizers[i]
|
||||
if string(finalizer) != api.FinalizerOrphan {
|
||||
if string(finalizer) != metav1.FinalizerOrphan {
|
||||
newFinalizers = append(newFinalizers, finalizer)
|
||||
}
|
||||
}
|
||||
|
@ -71,6 +71,11 @@ type ListMeta struct {
|
||||
ResourceVersion string `json:"resourceVersion,omitempty" protobuf:"bytes,2,opt,name=resourceVersion"`
|
||||
}
|
||||
|
||||
// These are internal finalizer values for Kubernetes-like APIs, must be qualified name unless defined here
|
||||
const (
|
||||
FinalizerOrphan string = "orphan"
|
||||
)
|
||||
|
||||
// ObjectMeta is metadata that all persisted resources must have, which includes all objects
|
||||
// users must create.
|
||||
type ObjectMeta struct {
|
||||
|
@ -26,6 +26,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
"k8s.io/client-go/pkg/api"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// IsOpaqueIntResourceName returns true if the resource name has the opaque
|
||||
@ -82,7 +83,7 @@ func IsServiceIPRequested(service *Service) bool {
|
||||
|
||||
var standardFinalizers = sets.NewString(
|
||||
string(FinalizerKubernetes),
|
||||
FinalizerOrphan,
|
||||
metav1.FinalizerOrphan,
|
||||
)
|
||||
|
||||
func IsStandardFinalizerName(str string) bool {
|
||||
|
@ -3223,7 +3223,6 @@ type FinalizerName string
|
||||
// These are internal finalizer values to Kubernetes, must be qualified name unless defined here
|
||||
const (
|
||||
FinalizerKubernetes FinalizerName = "kubernetes"
|
||||
FinalizerOrphan string = "orphan"
|
||||
)
|
||||
|
||||
// NamespaceSpec describes the attributes on a Namespace.
|
||||
|
@ -297,7 +297,7 @@ func setupRCsPods(t *testing.T, gc *garbagecollector.GarbageCollector, clientSet
|
||||
}
|
||||
podUIDs = append(podUIDs, pod.ObjectMeta.UID)
|
||||
}
|
||||
orphan := (options != nil && options.OrphanDependents != nil && *options.OrphanDependents) || (options == nil && len(initialFinalizers) != 0 && initialFinalizers[0] == api.FinalizerOrphan)
|
||||
orphan := (options != nil && options.OrphanDependents != nil && *options.OrphanDependents) || (options == nil && len(initialFinalizers) != 0 && initialFinalizers[0] == metav1.FinalizerOrphan)
|
||||
// if we intend to orphan the pods, we need wait for the gc to observe the
|
||||
// creation of the pods, otherwise if the deletion of RC is observed before
|
||||
// the creation of the pods, the pods will not be orphaned.
|
||||
@ -356,9 +356,9 @@ func TestStressingCascadingDeletion(t *testing.T) {
|
||||
// rc is created with empty finalizers, deleted with nil delete options, pods will remain.
|
||||
go setupRCsPods(t, gc, clientSet, "collection1-"+strconv.Itoa(i), ns.Name, []string{}, nil, &wg, rcUIDs)
|
||||
// rc is created with the orphan finalizer, deleted with nil options, pods will remain.
|
||||
go setupRCsPods(t, gc, clientSet, "collection2-"+strconv.Itoa(i), ns.Name, []string{api.FinalizerOrphan}, nil, &wg, rcUIDs)
|
||||
go setupRCsPods(t, gc, clientSet, "collection2-"+strconv.Itoa(i), ns.Name, []string{metav1.FinalizerOrphan}, nil, &wg, rcUIDs)
|
||||
// rc is created with the orphan finalizer, deleted with DeleteOptions.OrphanDependents=false, pods will be deleted.
|
||||
go setupRCsPods(t, gc, clientSet, "collection3-"+strconv.Itoa(i), ns.Name, []string{api.FinalizerOrphan}, getNonOrphanOptions(), &wg, rcUIDs)
|
||||
go setupRCsPods(t, gc, clientSet, "collection3-"+strconv.Itoa(i), ns.Name, []string{metav1.FinalizerOrphan}, getNonOrphanOptions(), &wg, rcUIDs)
|
||||
// rc is created with empty finalizers, deleted with DeleteOptions.OrphanDependents=true, pods will remain.
|
||||
go setupRCsPods(t, gc, clientSet, "collection4-"+strconv.Itoa(i), ns.Name, []string{}, getOrphanOptions(), &wg, rcUIDs)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user