Skip to content

Commit

Permalink
Adds commentary on expected/unexpected test output
Browse files Browse the repository at this point in the history
  • Loading branch information
naanselmo committed Jun 21, 2022
1 parent 86d48b2 commit d8efc15
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions api/krusty/namedspacedserviceaccounts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ resources:
`)

m := th.Run(".", th.MakeDefaultOptions())

// Everything is as expected: each CRB gets updated to reference the SA in the appropriate namespace
// Changing order in the root kustomization.yaml does not change the result, as expected
th.AssertActualEqualsExpected(m, `
apiVersion: v1
kind: ServiceAccount
Expand Down Expand Up @@ -170,6 +173,9 @@ resources:
`)

m := th.Run(".", th.MakeDefaultOptions())

// Unexpected result: crb-b's subject obtains the wrong namespace, having "namespace: a"
// If the order is swapped in the kustomization.yaml then it's crb-a that gets "namespace: b"
th.AssertActualEqualsExpected(m, `
apiVersion: v1
kind: ServiceAccount
Expand Down

0 comments on commit d8efc15

Please sign in to comment.