mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 01:14:22 +00:00
add group name to kustomize.config.k8s.io
This commit is contained in:
@@ -32,7 +32,7 @@
|
|||||||
# visible in configuration reviews.
|
# visible in configuration reviews.
|
||||||
# ----------------------------------------------------
|
# ----------------------------------------------------
|
||||||
# apiVersion and kind of Kustomization
|
# apiVersion and kind of Kustomization
|
||||||
apiVersion: v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
|
|
||||||
# Adds namespace to all resources.
|
# Adds namespace to all resources.
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ func TestPreserveComments(t *testing.T) {
|
|||||||
`# shem qing some comments
|
`# shem qing some comments
|
||||||
# This is some comment we should preserve
|
# This is some comment we should preserve
|
||||||
# don't delete it
|
# don't delete it
|
||||||
apiVersion: v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- pod.yaml
|
- pod.yaml
|
||||||
@@ -181,7 +181,7 @@ resources:
|
|||||||
# See which field this comment goes into
|
# See which field this comment goes into
|
||||||
- service.yaml
|
- service.yaml
|
||||||
|
|
||||||
APIVersion: v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: kustomization
|
kind: kustomization
|
||||||
|
|
||||||
# something you may want to keep
|
# something you may want to keep
|
||||||
@@ -219,7 +219,7 @@ resources:
|
|||||||
- pod.yaml
|
- pod.yaml
|
||||||
- service.yaml
|
- service.yaml
|
||||||
|
|
||||||
apiVersion: v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: kustomization
|
kind: kustomization
|
||||||
|
|
||||||
# something you may want to keep
|
# something you may want to keep
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ func MakeFakeFS() *fakeFs {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// kustomizationContent is used in tests.
|
// kustomizationContent is used in tests.
|
||||||
const kustomizationContent = `apiVersion: v1beta1
|
const kustomizationContent = `apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
namePrefix: some-prefix
|
namePrefix: some-prefix
|
||||||
nameSuffix: some-suffix
|
nameSuffix: some-suffix
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import (
|
|||||||
func TestGenerator1(t *testing.T) {
|
func TestGenerator1(t *testing.T) {
|
||||||
th := NewKustTestHarness(t, "/app/overlay")
|
th := NewKustTestHarness(t, "/app/overlay")
|
||||||
th.writeK("/app/base1", `
|
th.writeK("/app/base1", `
|
||||||
apiVersion: v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
namePrefix: p1-
|
namePrefix: p1-
|
||||||
configMapGenerator:
|
configMapGenerator:
|
||||||
@@ -33,7 +33,7 @@ configMapGenerator:
|
|||||||
- from=base
|
- from=base
|
||||||
`)
|
`)
|
||||||
th.writeK("/app/base2", `
|
th.writeK("/app/base2", `
|
||||||
apiVersion: v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
namePrefix: p2-
|
namePrefix: p2-
|
||||||
configMapGenerator:
|
configMapGenerator:
|
||||||
@@ -43,7 +43,7 @@ configMapGenerator:
|
|||||||
- from=base
|
- from=base
|
||||||
`)
|
`)
|
||||||
th.writeK("/app/overlay/o1", `
|
th.writeK("/app/overlay/o1", `
|
||||||
apiVersion: v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
bases:
|
bases:
|
||||||
- ../../base1
|
- ../../base1
|
||||||
@@ -54,7 +54,7 @@ configMapGenerator:
|
|||||||
- from=overlay
|
- from=overlay
|
||||||
`)
|
`)
|
||||||
th.writeK("/app/overlay/o2", `
|
th.writeK("/app/overlay/o2", `
|
||||||
apiVersion: v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
bases:
|
bases:
|
||||||
- ../../base2
|
- ../../base2
|
||||||
@@ -65,7 +65,7 @@ configMapGenerator:
|
|||||||
- from=overlay
|
- from=overlay
|
||||||
`)
|
`)
|
||||||
th.writeK("/app/overlay", `
|
th.writeK("/app/overlay", `
|
||||||
apiVersion: v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
bases:
|
bases:
|
||||||
- o1
|
- o1
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import (
|
|||||||
|
|
||||||
func writeBaseWithCrd(th *KustTestHarness) {
|
func writeBaseWithCrd(th *KustTestHarness) {
|
||||||
th.writeK("/app/base", `
|
th.writeK("/app/base", `
|
||||||
apiVersion: v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
crds:
|
crds:
|
||||||
- mycrd.json
|
- mycrd.json
|
||||||
@@ -273,7 +273,7 @@ func TestCrdWithOverlay(t *testing.T) {
|
|||||||
th := NewKustTestHarness(t, "/app/overlay")
|
th := NewKustTestHarness(t, "/app/overlay")
|
||||||
writeBaseWithCrd(th)
|
writeBaseWithCrd(th)
|
||||||
th.writeK("/app/overlay", `
|
th.writeK("/app/overlay", `
|
||||||
apiVersion: v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
namePrefix: prod-
|
namePrefix: prod-
|
||||||
bases:
|
bases:
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import (
|
|||||||
func TestSimpleBase(t *testing.T) {
|
func TestSimpleBase(t *testing.T) {
|
||||||
th := NewKustTestHarness(t, "/app/base")
|
th := NewKustTestHarness(t, "/app/base")
|
||||||
th.writeK("/app/base", `
|
th.writeK("/app/base", `
|
||||||
apiVersion: v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
namePrefix: team-foo-
|
namePrefix: team-foo-
|
||||||
commonLabels:
|
commonLabels:
|
||||||
@@ -163,7 +163,7 @@ spec:
|
|||||||
|
|
||||||
func makeBaseWithGenerators(th *KustTestHarness) {
|
func makeBaseWithGenerators(th *KustTestHarness) {
|
||||||
th.writeK("/app", `
|
th.writeK("/app", `
|
||||||
apiVersion: v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
namePrefix: team-foo-
|
namePrefix: team-foo-
|
||||||
commonLabels:
|
commonLabels:
|
||||||
@@ -341,7 +341,7 @@ spec:
|
|||||||
name: configmap-in-overlay
|
name: configmap-in-overlay
|
||||||
`)
|
`)
|
||||||
th.writeK("/overlay", `
|
th.writeK("/overlay", `
|
||||||
apiVersion: v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
namePrefix: staging-
|
namePrefix: staging-
|
||||||
commonLabels:
|
commonLabels:
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
kustomizationContent1 = `
|
kustomizationContent1 = `
|
||||||
apiVersion: v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
namePrefix: foo-
|
namePrefix: foo-
|
||||||
nameSuffix: -bar
|
nameSuffix: -bar
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import (
|
|||||||
|
|
||||||
func makeCommonFileForMultiplePatchTest(th *KustTestHarness) {
|
func makeCommonFileForMultiplePatchTest(th *KustTestHarness) {
|
||||||
th.writeK("/app/base", `
|
th.writeK("/app/base", `
|
||||||
apiVersion: v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
namePrefix: team-foo-
|
namePrefix: team-foo-
|
||||||
commonLabels:
|
commonLabels:
|
||||||
@@ -80,7 +80,7 @@ spec:
|
|||||||
app: nginx
|
app: nginx
|
||||||
`)
|
`)
|
||||||
th.writeK("/app/overlay/staging", `
|
th.writeK("/app/overlay/staging", `
|
||||||
apiVersion: v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
namePrefix: staging-
|
namePrefix: staging-
|
||||||
commonLabels:
|
commonLabels:
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import (
|
|||||||
func TestNamespacedGenerator(t *testing.T) {
|
func TestNamespacedGenerator(t *testing.T) {
|
||||||
th := NewKustTestHarness(t, "/app")
|
th := NewKustTestHarness(t, "/app")
|
||||||
th.writeK("/app", `
|
th.writeK("/app", `
|
||||||
apiVersion: v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
configMapGenerator:
|
configMapGenerator:
|
||||||
- name: the-non-default-namespace-map
|
- name: the-non-default-namespace-map
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ func (th *KustTestHarness) writeF(dir string, content string) {
|
|||||||
|
|
||||||
func (th *KustTestHarness) writeK(dir string, content string) {
|
func (th *KustTestHarness) writeK(dir string, content string) {
|
||||||
th.writeF(filepath.Join(dir, constants.KustomizationFileNames[0]), `
|
th.writeF(filepath.Join(dir, constants.KustomizationFileNames[0]), `
|
||||||
apiVersion: v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
`+content)
|
`+content)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import (
|
|||||||
func TestVariableRef(t *testing.T) {
|
func TestVariableRef(t *testing.T) {
|
||||||
th := NewKustTestHarness(t, "/app/overlay/staging")
|
th := NewKustTestHarness(t, "/app/overlay/staging")
|
||||||
th.writeK("/app/base", `
|
th.writeK("/app/base", `
|
||||||
apiVersion: v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
namePrefix: base-
|
namePrefix: base-
|
||||||
resources:
|
resources:
|
||||||
@@ -323,7 +323,7 @@ spec:
|
|||||||
storage: 1Gi
|
storage: 1Gi
|
||||||
`)
|
`)
|
||||||
th.writeK("/app/overlay/staging", `
|
th.writeK("/app/overlay/staging", `
|
||||||
apiVersion: v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
namePrefix: dev-
|
namePrefix: dev-
|
||||||
bases:
|
bases:
|
||||||
@@ -583,7 +583,7 @@ spec:
|
|||||||
func TestVariableRefIngress(t *testing.T) {
|
func TestVariableRefIngress(t *testing.T) {
|
||||||
th := NewKustTestHarness(t, "/app/overlay")
|
th := NewKustTestHarness(t, "/app/overlay")
|
||||||
th.writeK("/app/base", `
|
th.writeK("/app/base", `
|
||||||
apiVersion: v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- deployment.yaml
|
- deployment.yaml
|
||||||
@@ -657,7 +657,7 @@ spec:
|
|||||||
targetPort: http
|
targetPort: http
|
||||||
`)
|
`)
|
||||||
th.writeK("/app/overlay", `
|
th.writeK("/app/overlay", `
|
||||||
apiVersion: v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
nameprefix: kustomized-
|
nameprefix: kustomized-
|
||||||
bases:
|
bases:
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
KustomizationVersion = "v1beta1"
|
KustomizationVersion = "kustomize.config.k8s.io/v1beta1"
|
||||||
KustomizationKind = "Kustomization"
|
KustomizationKind = "Kustomization"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user