Skip to content

Commit 7413c6a

Browse files
committed
Regression test
1 parent d3184da commit 7413c6a

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

api/krusty/namespaces_test.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,3 +801,31 @@ metadata:
801801
namespace: iter8-monitoring
802802
`)
803803
}
804+
805+
// Demonstrates that metadata.name is only overridden for a kind: Namespace with apiVersion: v1
806+
// Test for issue #5072
807+
func TestNameNotOveriddenForNonCoreApiVersionOnANamespaceKind(t *testing.T) {
808+
th := kusttest_test.MakeHarness(t)
809+
810+
th.WriteF("azure-servicebus.yaml", `
811+
apiVersion: servicebus.azure.com/v1beta20210101preview
812+
kind: Namespace
813+
metadata:
814+
name: core-sb-99
815+
namespace: without-podinfo
816+
`)
817+
th.WriteK(".", `
818+
namespace: podinfo
819+
resources:
820+
- azure-servicebus.yaml
821+
`)
822+
823+
m := th.Run(".", th.MakeDefaultOptions())
824+
th.AssertActualEqualsExpected(m, `
825+
apiVersion: servicebus.azure.com/v1beta20210101preview
826+
kind: Namespace
827+
metadata:
828+
name: core-sb-99
829+
namespace: podinfo
830+
`)
831+
}

0 commit comments

Comments
 (0)