Skip to content

Commit

Permalink
test(controller): add extra checks to TestWriteBackToInformer (argopr…
Browse files Browse the repository at this point in the history
…oj#2326)

Signed-off-by: zachaller <[email protected]>

Signed-off-by: zachaller <[email protected]>
  • Loading branch information
zachaller authored and jandersen-plaid committed Nov 8, 2022
1 parent 0a8f029 commit 98c3d77
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions rollout/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1945,8 +1945,11 @@ func TestWriteBackToInformer(t *testing.T) {
f.runController(roKey, true, false, c, i, k8sI)

// Verify the informer was updated with the new unstructured object after reconciliation
obj, _, _ := c.rolloutsIndexer.GetByKey(roKey)
un := obj.(*unstructured.Unstructured)
obj, exists, err := c.rolloutsIndexer.GetByKey(roKey)
assert.NoError(t, err)
assert.True(t, exists)
un, ok := obj.(*unstructured.Unstructured)
assert.True(t, ok)
stableRS, _, _ := unstructured.NestedString(un.Object, "status", "stableRS")
assert.NotEmpty(t, stableRS)
assert.Equal(t, rs1.Labels[v1alpha1.DefaultRolloutUniqueLabelKey], stableRS)
Expand Down

0 comments on commit 98c3d77

Please sign in to comment.