mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 06:54:01 +00:00
Update the tests to check for only one update finalizer operation
This commit is contained in:
parent
78ab9ae218
commit
64643c6582
@ -97,10 +97,9 @@ func TestDaemonSetController(t *testing.T) {
|
||||
// Test add federated daemonset.
|
||||
daemonsetWatch.Add(&daemonset1)
|
||||
|
||||
// There should be 2 updates to add both the finalizers.
|
||||
// There should be an update to add both the finalizers.
|
||||
updatedDaemonSet := GetDaemonSetFromChan(daemonsetUpdateChan)
|
||||
assert.True(t, daemonsetController.hasFinalizerFunc(updatedDaemonSet, deletionhelper.FinalizerDeleteFromUnderlyingClusters))
|
||||
updatedDaemonSet = GetDaemonSetFromChan(daemonsetUpdateChan)
|
||||
assert.True(t, daemonsetController.hasFinalizerFunc(updatedDaemonSet, metav1.FinalizerOrphan))
|
||||
daemonset1 = *updatedDaemonSet
|
||||
|
||||
|
@ -140,10 +140,9 @@ func TestIngressController(t *testing.T) {
|
||||
assert.Equal(t, cluster.ObjectMeta.Annotations[uidAnnotationKey], cfg1.Data[uidKey])
|
||||
|
||||
t.Logf("Checking that appropriate finalizers are added")
|
||||
// There should be 2 updates to add both the finalizers.
|
||||
// There should be an update to add both the finalizers.
|
||||
updatedIngress := GetIngressFromChan(t, fedIngressUpdateChan)
|
||||
assert.True(t, ingressController.hasFinalizerFunc(updatedIngress, deletionhelper.FinalizerDeleteFromUnderlyingClusters))
|
||||
updatedIngress = GetIngressFromChan(t, fedIngressUpdateChan)
|
||||
assert.True(t, ingressController.hasFinalizerFunc(updatedIngress, metav1.FinalizerOrphan), fmt.Sprintf("ingress does not have the orphan finalizer: %v", updatedIngress))
|
||||
fedIngress = *updatedIngress
|
||||
|
||||
|
@ -97,10 +97,9 @@ func TestSecretController(t *testing.T) {
|
||||
|
||||
// Test add federated secret.
|
||||
secretWatch.Add(&secret1)
|
||||
// There should be 2 updates to add both the finalizers.
|
||||
// There should be an update to add both the finalizers.
|
||||
updatedSecret := GetSecretFromChan(secretUpdateChan)
|
||||
assert.True(t, secretController.hasFinalizerFunc(updatedSecret, deletionhelper.FinalizerDeleteFromUnderlyingClusters))
|
||||
updatedSecret = GetSecretFromChan(secretUpdateChan)
|
||||
assert.True(t, secretController.hasFinalizerFunc(updatedSecret, metav1.FinalizerOrphan))
|
||||
secret1 = *updatedSecret
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user