Adds commentary on expected/unexpected test output

This commit is contained in:
Nuno Anselmo
2022-06-21 23:52:39 +01:00
parent 86d48b2a95
commit d8efc15169

View File

@@ -69,6 +69,9 @@ resources:
`) `)
m := th.Run(".", th.MakeDefaultOptions()) 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, ` th.AssertActualEqualsExpected(m, `
apiVersion: v1 apiVersion: v1
kind: ServiceAccount kind: ServiceAccount
@@ -170,6 +173,9 @@ resources:
`) `)
m := th.Run(".", th.MakeDefaultOptions()) 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, ` th.AssertActualEqualsExpected(m, `
apiVersion: v1 apiVersion: v1
kind: ServiceAccount kind: ServiceAccount