Skip to content

Commit

Permalink
Regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
timja committed Apr 18, 2023
1 parent d3184da commit 7413c6a
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions api/krusty/namespaces_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -801,3 +801,31 @@ metadata:
namespace: iter8-monitoring
`)
}

// Demonstrates that metadata.name is only overridden for a kind: Namespace with apiVersion: v1
// Test for issue #5072
func TestNameNotOveriddenForNonCoreApiVersionOnANamespaceKind(t *testing.T) {
th := kusttest_test.MakeHarness(t)

th.WriteF("azure-servicebus.yaml", `
apiVersion: servicebus.azure.com/v1beta20210101preview
kind: Namespace
metadata:
name: core-sb-99
namespace: without-podinfo
`)
th.WriteK(".", `
namespace: podinfo
resources:
- azure-servicebus.yaml
`)

m := th.Run(".", th.MakeDefaultOptions())
th.AssertActualEqualsExpected(m, `
apiVersion: servicebus.azure.com/v1beta20210101preview
kind: Namespace
metadata:
name: core-sb-99
namespace: podinfo
`)
}

0 comments on commit 7413c6a

Please sign in to comment.