From d8efc15169ae1fcb725c89dadb4db709d6ca4ea0 Mon Sep 17 00:00:00 2001 From: Nuno Anselmo Date: Tue, 21 Jun 2022 23:52:39 +0100 Subject: [PATCH] Adds commentary on expected/unexpected test output --- api/krusty/namedspacedserviceaccounts_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api/krusty/namedspacedserviceaccounts_test.go b/api/krusty/namedspacedserviceaccounts_test.go index d78ba403a..4674c6dd6 100644 --- a/api/krusty/namedspacedserviceaccounts_test.go +++ b/api/krusty/namedspacedserviceaccounts_test.go @@ -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 @@ -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