mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 09:02:53 +00:00
resource/api: update test to use a more specific kustomization
This commit is contained in:
@@ -457,7 +457,52 @@ metadata:
|
|||||||
|
|
||||||
func TestMergeAndReplaceDisableNameSuffixHashGenerators(t *testing.T) {
|
func TestMergeAndReplaceDisableNameSuffixHashGenerators(t *testing.T) {
|
||||||
th := kusttest_test.MakeHarness(t)
|
th := kusttest_test.MakeHarness(t)
|
||||||
makeBaseWithGenerators(th)
|
th.WriteK("app", `
|
||||||
|
namePrefix: team-foo-
|
||||||
|
commonLabels:
|
||||||
|
app: mynginx
|
||||||
|
org: example.com
|
||||||
|
team: foo
|
||||||
|
commonAnnotations:
|
||||||
|
note: This is a test annotation
|
||||||
|
resources:
|
||||||
|
- deployment.yaml
|
||||||
|
configMapGenerator:
|
||||||
|
- name: configmap-in-base
|
||||||
|
literals:
|
||||||
|
- foo=bar
|
||||||
|
secretGenerator:
|
||||||
|
- name: secret-in-base
|
||||||
|
literals:
|
||||||
|
- username=admin
|
||||||
|
- password=somepw
|
||||||
|
`)
|
||||||
|
th.WriteF("app/deployment.yaml", `
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: nginx
|
||||||
|
labels:
|
||||||
|
app: nginx
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: nginx
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: nginx
|
||||||
|
image: nginx
|
||||||
|
volumeMounts:
|
||||||
|
- name: nginx-persistent-storage
|
||||||
|
mountPath: /tmp/ps
|
||||||
|
volumes:
|
||||||
|
- name: nginx-persistent-storage
|
||||||
|
emptyDir: {}
|
||||||
|
- configMap:
|
||||||
|
name: configmap-in-base
|
||||||
|
name: configmap-in-base
|
||||||
|
`)
|
||||||
th.WriteF("overlay/deployment.yaml", `
|
th.WriteF("overlay/deployment.yaml", `
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
@@ -552,26 +597,6 @@ spec:
|
|||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
annotations:
|
|
||||||
note: This is a test annotation
|
|
||||||
labels:
|
|
||||||
app: mynginx
|
|
||||||
env: staging
|
|
||||||
org: example.com
|
|
||||||
team: override-foo
|
|
||||||
name: staging-team-foo-nginx
|
|
||||||
spec:
|
|
||||||
ports:
|
|
||||||
- port: 80
|
|
||||||
selector:
|
|
||||||
app: mynginx
|
|
||||||
env: staging
|
|
||||||
org: example.com
|
|
||||||
team: override-foo
|
|
||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
data:
|
data:
|
||||||
foo: override-bar
|
foo: override-bar
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
|
|||||||
Reference in New Issue
Block a user