mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +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.
|
// Test add federated daemonset.
|
||||||
daemonsetWatch.Add(&daemonset1)
|
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)
|
updatedDaemonSet := GetDaemonSetFromChan(daemonsetUpdateChan)
|
||||||
assert.True(t, daemonsetController.hasFinalizerFunc(updatedDaemonSet, deletionhelper.FinalizerDeleteFromUnderlyingClusters))
|
assert.True(t, daemonsetController.hasFinalizerFunc(updatedDaemonSet, deletionhelper.FinalizerDeleteFromUnderlyingClusters))
|
||||||
updatedDaemonSet = GetDaemonSetFromChan(daemonsetUpdateChan)
|
|
||||||
assert.True(t, daemonsetController.hasFinalizerFunc(updatedDaemonSet, metav1.FinalizerOrphan))
|
assert.True(t, daemonsetController.hasFinalizerFunc(updatedDaemonSet, metav1.FinalizerOrphan))
|
||||||
daemonset1 = *updatedDaemonSet
|
daemonset1 = *updatedDaemonSet
|
||||||
|
|
||||||
|
@ -140,10 +140,9 @@ func TestIngressController(t *testing.T) {
|
|||||||
assert.Equal(t, cluster.ObjectMeta.Annotations[uidAnnotationKey], cfg1.Data[uidKey])
|
assert.Equal(t, cluster.ObjectMeta.Annotations[uidAnnotationKey], cfg1.Data[uidKey])
|
||||||
|
|
||||||
t.Logf("Checking that appropriate finalizers are added")
|
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)
|
updatedIngress := GetIngressFromChan(t, fedIngressUpdateChan)
|
||||||
assert.True(t, ingressController.hasFinalizerFunc(updatedIngress, deletionhelper.FinalizerDeleteFromUnderlyingClusters))
|
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))
|
assert.True(t, ingressController.hasFinalizerFunc(updatedIngress, metav1.FinalizerOrphan), fmt.Sprintf("ingress does not have the orphan finalizer: %v", updatedIngress))
|
||||||
fedIngress = *updatedIngress
|
fedIngress = *updatedIngress
|
||||||
|
|
||||||
|
@ -97,10 +97,9 @@ func TestSecretController(t *testing.T) {
|
|||||||
|
|
||||||
// Test add federated secret.
|
// Test add federated secret.
|
||||||
secretWatch.Add(&secret1)
|
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)
|
updatedSecret := GetSecretFromChan(secretUpdateChan)
|
||||||
assert.True(t, secretController.hasFinalizerFunc(updatedSecret, deletionhelper.FinalizerDeleteFromUnderlyingClusters))
|
assert.True(t, secretController.hasFinalizerFunc(updatedSecret, deletionhelper.FinalizerDeleteFromUnderlyingClusters))
|
||||||
updatedSecret = GetSecretFromChan(secretUpdateChan)
|
|
||||||
assert.True(t, secretController.hasFinalizerFunc(updatedSecret, metav1.FinalizerOrphan))
|
assert.True(t, secretController.hasFinalizerFunc(updatedSecret, metav1.FinalizerOrphan))
|
||||||
secret1 = *updatedSecret
|
secret1 = *updatedSecret
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user