mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-13 01:50:55 +00:00
Isolated content of pkg/kustomize
This commit is contained in:
58
pkg/commands/testdata/testcase-base-only/expected.diff
vendored
Normal file
58
pkg/commands/testdata/testcase-base-only/expected.diff
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
diff -u -N /tmp/noop/apps_v1beta2_Deployment_nginx.yaml /tmp/transformed/apps_v1beta2_Deployment_nginx.yaml
|
||||
--- /tmp/noop/apps_v1beta2_Deployment_nginx.yaml YYYY-MM-DD HH:MM:SS
|
||||
+++ /tmp/transformed/apps_v1beta2_Deployment_nginx.yaml YYYY-MM-DD HH:MM:SS
|
||||
@@ -1,14 +1,27 @@
|
||||
apiVersion: apps/v1beta2
|
||||
kind: Deployment
|
||||
metadata:
|
||||
+ annotations:
|
||||
+ note: This is a test annotation
|
||||
labels:
|
||||
- app: nginx
|
||||
- name: nginx
|
||||
+ app: mynginx
|
||||
+ org: example.com
|
||||
+ team: foo
|
||||
+ name: team-foo-nginx
|
||||
spec:
|
||||
+ selector:
|
||||
+ matchLabels:
|
||||
+ app: mynginx
|
||||
+ org: example.com
|
||||
+ team: foo
|
||||
template:
|
||||
metadata:
|
||||
+ annotations:
|
||||
+ note: This is a test annotation
|
||||
labels:
|
||||
- app: nginx
|
||||
+ app: mynginx
|
||||
+ org: example.com
|
||||
+ team: foo
|
||||
spec:
|
||||
containers:
|
||||
- image: nginx
|
||||
diff -u -N /tmp/noop/v1_Service_nginx.yaml /tmp/transformed/v1_Service_nginx.yaml
|
||||
--- /tmp/noop/v1_Service_nginx.yaml YYYY-MM-DD HH:MM:SS
|
||||
+++ /tmp/transformed/v1_Service_nginx.yaml YYYY-MM-DD HH:MM:SS
|
||||
@@ -1,11 +1,17 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
+ annotations:
|
||||
+ note: This is a test annotation
|
||||
labels:
|
||||
- app: nginx
|
||||
- name: nginx
|
||||
+ app: mynginx
|
||||
+ org: example.com
|
||||
+ team: foo
|
||||
+ name: team-foo-nginx
|
||||
spec:
|
||||
ports:
|
||||
- port: 80
|
||||
selector:
|
||||
- app: nginx
|
||||
+ app: mynginx
|
||||
+ org: example.com
|
||||
+ team: foo
|
||||
46
pkg/commands/testdata/testcase-base-only/expected.yaml
vendored
Normal file
46
pkg/commands/testdata/testcase-base-only/expected.yaml
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
annotations:
|
||||
note: This is a test annotation
|
||||
labels:
|
||||
app: mynginx
|
||||
org: example.com
|
||||
team: foo
|
||||
name: team-foo-nginx
|
||||
spec:
|
||||
ports:
|
||||
- port: 80
|
||||
selector:
|
||||
app: mynginx
|
||||
org: example.com
|
||||
team: foo
|
||||
---
|
||||
apiVersion: apps/v1beta2
|
||||
kind: Deployment
|
||||
metadata:
|
||||
annotations:
|
||||
note: This is a test annotation
|
||||
labels:
|
||||
app: mynginx
|
||||
org: example.com
|
||||
team: foo
|
||||
name: team-foo-nginx
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: mynginx
|
||||
org: example.com
|
||||
team: foo
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
note: This is a test annotation
|
||||
labels:
|
||||
app: mynginx
|
||||
org: example.com
|
||||
team: foo
|
||||
spec:
|
||||
containers:
|
||||
- image: nginx
|
||||
name: nginx
|
||||
15
pkg/commands/testdata/testcase-base-only/in/deployment.yaml
vendored
Normal file
15
pkg/commands/testdata/testcase-base-only/in/deployment.yaml
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
apiVersion: apps/v1beta2
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: nginx
|
||||
labels:
|
||||
app: nginx
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: nginx
|
||||
spec:
|
||||
containers:
|
||||
- name: nginx
|
||||
image: nginx
|
||||
10
pkg/commands/testdata/testcase-base-only/in/kustomization.yaml
vendored
Normal file
10
pkg/commands/testdata/testcase-base-only/in/kustomization.yaml
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
namePrefix: team-foo-
|
||||
commonLabels:
|
||||
app: mynginx
|
||||
org: example.com
|
||||
team: foo
|
||||
commonAnnotations:
|
||||
note: This is a test annotation
|
||||
resources:
|
||||
- deployment.yaml
|
||||
- service.yaml
|
||||
11
pkg/commands/testdata/testcase-base-only/in/service.yaml
vendored
Normal file
11
pkg/commands/testdata/testcase-base-only/in/service.yaml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: nginx
|
||||
labels:
|
||||
app: nginx
|
||||
spec:
|
||||
ports:
|
||||
- port: 80
|
||||
selector:
|
||||
app: nginx
|
||||
5
pkg/commands/testdata/testcase-base-only/test.yaml
vendored
Normal file
5
pkg/commands/testdata/testcase-base-only/test.yaml
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
description: base only
|
||||
args: []
|
||||
filename: testdata/testcase-base-only/in
|
||||
expectedStdout: testdata/testcase-base-only/expected.yaml
|
||||
expectedDiff: testdata/testcase-base-only/expected.diff
|
||||
20
pkg/commands/testdata/testcase-multiple-patches-conflict/in/overlay/deployment-patch1.yaml
vendored
Normal file
20
pkg/commands/testdata/testcase-multiple-patches-conflict/in/overlay/deployment-patch1.yaml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
apiVersion: apps/v1beta2
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: nginx
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: nginx
|
||||
env:
|
||||
- name: ENABLE_FEATURE_FOO
|
||||
value: TRUE
|
||||
volumes:
|
||||
- name: nginx-persistent-storage
|
||||
emptyDir: null
|
||||
gcePersistentDisk:
|
||||
pdName: nginx-persistent-storage
|
||||
- configMap:
|
||||
name: configmap-in-overlay
|
||||
name: configmap-in-overlay
|
||||
12
pkg/commands/testdata/testcase-multiple-patches-conflict/in/overlay/deployment-patch2.yaml
vendored
Normal file
12
pkg/commands/testdata/testcase-multiple-patches-conflict/in/overlay/deployment-patch2.yaml
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
apiVersion: apps/v1beta2
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: nginx
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: nginx
|
||||
env:
|
||||
- name: ENABLE_FEATURE_FOO
|
||||
value: FALSE
|
||||
12
pkg/commands/testdata/testcase-multiple-patches-conflict/in/overlay/kustomization.yaml
vendored
Normal file
12
pkg/commands/testdata/testcase-multiple-patches-conflict/in/overlay/kustomization.yaml
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
namePrefix: staging-
|
||||
commonLabels:
|
||||
env: staging
|
||||
patches:
|
||||
- deployment-patch2.yaml
|
||||
- deployment-patch1.yaml
|
||||
bases:
|
||||
- ../package/
|
||||
configMapGenerator:
|
||||
- name: configmap-in-overlay
|
||||
literals:
|
||||
- hello=world
|
||||
24
pkg/commands/testdata/testcase-multiple-patches-conflict/in/package/deployment.yaml
vendored
Normal file
24
pkg/commands/testdata/testcase-multiple-patches-conflict/in/package/deployment.yaml
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
apiVersion: apps/v1beta2
|
||||
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
|
||||
14
pkg/commands/testdata/testcase-multiple-patches-conflict/in/package/kustomization.yaml
vendored
Normal file
14
pkg/commands/testdata/testcase-multiple-patches-conflict/in/package/kustomization.yaml
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
namePrefix: team-foo-
|
||||
commonLabels:
|
||||
app: mynginx
|
||||
org: example.com
|
||||
team: foo
|
||||
commonAnnotations:
|
||||
note: This is a test annotation
|
||||
resources:
|
||||
- deployment.yaml
|
||||
- service.yaml
|
||||
configMapGenerator:
|
||||
- name: configmap-in-base
|
||||
literals:
|
||||
- foo=bar
|
||||
11
pkg/commands/testdata/testcase-multiple-patches-conflict/in/package/service.yaml
vendored
Normal file
11
pkg/commands/testdata/testcase-multiple-patches-conflict/in/package/service.yaml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: nginx
|
||||
labels:
|
||||
app: nginx
|
||||
spec:
|
||||
ports:
|
||||
- port: 80
|
||||
selector:
|
||||
app: nginx
|
||||
4
pkg/commands/testdata/testcase-multiple-patches-conflict/test.yaml
vendored
Normal file
4
pkg/commands/testdata/testcase-multiple-patches-conflict/test.yaml
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
description: conflict between multiple patches
|
||||
args: []
|
||||
filename: testdata/testcase-multiple-patches-conflict/in/overlay/
|
||||
expectedError: conflict
|
||||
99
pkg/commands/testdata/testcase-multiple-patches-noconflict/expected.diff
vendored
Normal file
99
pkg/commands/testdata/testcase-multiple-patches-noconflict/expected.diff
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
diff -u -N /tmp/noop/apps_v1beta2_Deployment_nginx.yaml /tmp/transformed/apps_v1beta2_Deployment_nginx.yaml
|
||||
--- /tmp/noop/apps_v1beta2_Deployment_nginx.yaml YYYY-MM-DD HH:MM:SS
|
||||
+++ /tmp/transformed/apps_v1beta2_Deployment_nginx.yaml YYYY-MM-DD HH:MM:SS
|
||||
@@ -5,13 +5,15 @@
|
||||
note: This is a test annotation
|
||||
labels:
|
||||
app: mynginx
|
||||
+ env: staging
|
||||
org: example.com
|
||||
team: foo
|
||||
- name: team-foo-nginx
|
||||
+ name: staging-team-foo-nginx
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: mynginx
|
||||
+ env: staging
|
||||
org: example.com
|
||||
team: foo
|
||||
template:
|
||||
@@ -20,18 +22,30 @@
|
||||
note: This is a test annotation
|
||||
labels:
|
||||
app: mynginx
|
||||
+ env: staging
|
||||
org: example.com
|
||||
team: foo
|
||||
spec:
|
||||
containers:
|
||||
- - image: nginx
|
||||
+ - env:
|
||||
+ - name: ANOTHERENV
|
||||
+ value: FOO
|
||||
+ - name: ENVKEY
|
||||
+ value: ENVVALUE
|
||||
+ image: nginx:latest
|
||||
name: nginx
|
||||
volumeMounts:
|
||||
- mountPath: /tmp/ps
|
||||
name: nginx-persistent-storage
|
||||
+ - image: sidecar
|
||||
+ name: sidecar
|
||||
volumes:
|
||||
- - emptyDir: {}
|
||||
+ - gcePersistentDisk:
|
||||
+ pdName: nginx-persistent-storage
|
||||
name: nginx-persistent-storage
|
||||
- configMap:
|
||||
- name: team-foo-configmap-in-base-bbdmdh7m8t
|
||||
+ name: staging-configmap-in-overlay-k7cbc75tg8
|
||||
+ name: configmap-in-overlay
|
||||
+ - configMap:
|
||||
+ name: staging-team-foo-configmap-in-base-g7k6gt2889
|
||||
name: configmap-in-base
|
||||
diff -u -N /tmp/noop/v1_ConfigMap_configmap-in-base.yaml /tmp/transformed/v1_ConfigMap_configmap-in-base.yaml
|
||||
--- /tmp/noop/v1_ConfigMap_configmap-in-base.yaml YYYY-MM-DD HH:MM:SS
|
||||
+++ /tmp/transformed/v1_ConfigMap_configmap-in-base.yaml YYYY-MM-DD HH:MM:SS
|
||||
@@ -8,6 +8,7 @@
|
||||
creationTimestamp: null
|
||||
labels:
|
||||
app: mynginx
|
||||
+ env: staging
|
||||
org: example.com
|
||||
team: foo
|
||||
- name: team-foo-configmap-in-base-bbdmdh7m8t
|
||||
+ name: staging-team-foo-configmap-in-base-g7k6gt2889
|
||||
diff -u -N /tmp/noop/v1_ConfigMap_configmap-in-overlay.yaml /tmp/transformed/v1_ConfigMap_configmap-in-overlay.yaml
|
||||
--- /tmp/noop/v1_ConfigMap_configmap-in-overlay.yaml YYYY-MM-DD HH:MM:SS
|
||||
+++ /tmp/transformed/v1_ConfigMap_configmap-in-overlay.yaml YYYY-MM-DD HH:MM:SS
|
||||
@@ -0,0 +1,9 @@
|
||||
+apiVersion: v1
|
||||
+data:
|
||||
+ hello: world
|
||||
+kind: ConfigMap
|
||||
+metadata:
|
||||
+ creationTimestamp: null
|
||||
+ labels:
|
||||
+ env: staging
|
||||
+ name: staging-configmap-in-overlay-k7cbc75tg8
|
||||
diff -u -N /tmp/noop/v1_Service_nginx.yaml /tmp/transformed/v1_Service_nginx.yaml
|
||||
--- /tmp/noop/v1_Service_nginx.yaml YYYY-MM-DD HH:MM:SS
|
||||
+++ /tmp/transformed/v1_Service_nginx.yaml YYYY-MM-DD HH:MM:SS
|
||||
@@ -5,13 +5,15 @@
|
||||
note: This is a test annotation
|
||||
labels:
|
||||
app: mynginx
|
||||
+ env: staging
|
||||
org: example.com
|
||||
team: foo
|
||||
- name: team-foo-nginx
|
||||
+ name: staging-team-foo-nginx
|
||||
spec:
|
||||
ports:
|
||||
- port: 80
|
||||
selector:
|
||||
app: mynginx
|
||||
+ env: staging
|
||||
org: example.com
|
||||
team: foo
|
||||
96
pkg/commands/testdata/testcase-multiple-patches-noconflict/expected.yaml
vendored
Normal file
96
pkg/commands/testdata/testcase-multiple-patches-noconflict/expected.yaml
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
apiVersion: v1
|
||||
data:
|
||||
foo: bar
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
annotations:
|
||||
note: This is a test annotation
|
||||
creationTimestamp: null
|
||||
labels:
|
||||
app: mynginx
|
||||
env: staging
|
||||
org: example.com
|
||||
team: foo
|
||||
name: staging-team-foo-configmap-in-base-g7k6gt2889
|
||||
---
|
||||
apiVersion: v1
|
||||
data:
|
||||
hello: world
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
creationTimestamp: null
|
||||
labels:
|
||||
env: staging
|
||||
name: staging-configmap-in-overlay-k7cbc75tg8
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
annotations:
|
||||
note: This is a test annotation
|
||||
labels:
|
||||
app: mynginx
|
||||
env: staging
|
||||
org: example.com
|
||||
team: foo
|
||||
name: staging-team-foo-nginx
|
||||
spec:
|
||||
ports:
|
||||
- port: 80
|
||||
selector:
|
||||
app: mynginx
|
||||
env: staging
|
||||
org: example.com
|
||||
team: foo
|
||||
---
|
||||
apiVersion: apps/v1beta2
|
||||
kind: Deployment
|
||||
metadata:
|
||||
annotations:
|
||||
note: This is a test annotation
|
||||
labels:
|
||||
app: mynginx
|
||||
env: staging
|
||||
org: example.com
|
||||
team: foo
|
||||
name: staging-team-foo-nginx
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: mynginx
|
||||
env: staging
|
||||
org: example.com
|
||||
team: foo
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
note: This is a test annotation
|
||||
labels:
|
||||
app: mynginx
|
||||
env: staging
|
||||
org: example.com
|
||||
team: foo
|
||||
spec:
|
||||
containers:
|
||||
- env:
|
||||
- name: ANOTHERENV
|
||||
value: FOO
|
||||
- name: ENVKEY
|
||||
value: ENVVALUE
|
||||
image: nginx:latest
|
||||
name: nginx
|
||||
volumeMounts:
|
||||
- mountPath: /tmp/ps
|
||||
name: nginx-persistent-storage
|
||||
- image: sidecar
|
||||
name: sidecar
|
||||
volumes:
|
||||
- gcePersistentDisk:
|
||||
pdName: nginx-persistent-storage
|
||||
name: nginx-persistent-storage
|
||||
- configMap:
|
||||
name: staging-configmap-in-overlay-k7cbc75tg8
|
||||
name: configmap-in-overlay
|
||||
- configMap:
|
||||
name: staging-team-foo-configmap-in-base-g7k6gt2889
|
||||
name: configmap-in-base
|
||||
21
pkg/commands/testdata/testcase-multiple-patches-noconflict/in/overlay/deployment-patch1.yaml
vendored
Normal file
21
pkg/commands/testdata/testcase-multiple-patches-noconflict/in/overlay/deployment-patch1.yaml
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
apiVersion: apps/v1beta2
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: nginx
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: nginx
|
||||
image: nginx:latest
|
||||
env:
|
||||
- name: ENVKEY
|
||||
value: ENVVALUE
|
||||
volumes:
|
||||
- name: nginx-persistent-storage
|
||||
emptyDir: null
|
||||
gcePersistentDisk:
|
||||
pdName: nginx-persistent-storage
|
||||
- configMap:
|
||||
name: configmap-in-overlay
|
||||
name: configmap-in-overlay
|
||||
16
pkg/commands/testdata/testcase-multiple-patches-noconflict/in/overlay/deployment-patch2.yaml
vendored
Normal file
16
pkg/commands/testdata/testcase-multiple-patches-noconflict/in/overlay/deployment-patch2.yaml
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
apiVersion: apps/v1beta2
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: nginx
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: nginx
|
||||
env:
|
||||
- name: ANOTHERENV
|
||||
value: FOO
|
||||
- name: sidecar
|
||||
image: sidecar
|
||||
volumes:
|
||||
- name: nginx-persistent-storage
|
||||
12
pkg/commands/testdata/testcase-multiple-patches-noconflict/in/overlay/kustomization.yaml
vendored
Normal file
12
pkg/commands/testdata/testcase-multiple-patches-noconflict/in/overlay/kustomization.yaml
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
namePrefix: staging-
|
||||
commonLabels:
|
||||
env: staging
|
||||
patches:
|
||||
- deployment-patch1.yaml
|
||||
- deployment-patch2.yaml
|
||||
bases:
|
||||
- ../package/
|
||||
configMapGenerator:
|
||||
- name: configmap-in-overlay
|
||||
literals:
|
||||
- hello=world
|
||||
24
pkg/commands/testdata/testcase-multiple-patches-noconflict/in/package/deployment.yaml
vendored
Normal file
24
pkg/commands/testdata/testcase-multiple-patches-noconflict/in/package/deployment.yaml
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
apiVersion: apps/v1beta2
|
||||
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
|
||||
14
pkg/commands/testdata/testcase-multiple-patches-noconflict/in/package/kustomization.yaml
vendored
Normal file
14
pkg/commands/testdata/testcase-multiple-patches-noconflict/in/package/kustomization.yaml
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
namePrefix: team-foo-
|
||||
commonLabels:
|
||||
app: mynginx
|
||||
org: example.com
|
||||
team: foo
|
||||
commonAnnotations:
|
||||
note: This is a test annotation
|
||||
resources:
|
||||
- deployment.yaml
|
||||
- service.yaml
|
||||
configMapGenerator:
|
||||
- name: configmap-in-base
|
||||
literals:
|
||||
- foo=bar
|
||||
11
pkg/commands/testdata/testcase-multiple-patches-noconflict/in/package/service.yaml
vendored
Normal file
11
pkg/commands/testdata/testcase-multiple-patches-noconflict/in/package/service.yaml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: nginx
|
||||
labels:
|
||||
app: nginx
|
||||
spec:
|
||||
ports:
|
||||
- port: 80
|
||||
selector:
|
||||
app: nginx
|
||||
5
pkg/commands/testdata/testcase-multiple-patches-noconflict/test.yaml
vendored
Normal file
5
pkg/commands/testdata/testcase-multiple-patches-noconflict/test.yaml
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
description: multiple patches no conflict
|
||||
args: []
|
||||
filename: testdata/testcase-multiple-patches-noconflict/in/overlay/
|
||||
expectedStdout: testdata/testcase-multiple-patches-noconflict/expected.yaml
|
||||
expectedDiff: testdata/testcase-multiple-patches-noconflict/expected.diff
|
||||
154
pkg/commands/testdata/testcase-simple/expected.diff
vendored
Normal file
154
pkg/commands/testdata/testcase-simple/expected.diff
vendored
Normal file
@@ -0,0 +1,154 @@
|
||||
diff -u -N /tmp/noop/extensions_v1beta1_Deployment_mungebot.yaml /tmp/transformed/extensions_v1beta1_Deployment_mungebot.yaml
|
||||
--- /tmp/noop/extensions_v1beta1_Deployment_mungebot.yaml YYYY-MM-DD HH:MM:SS
|
||||
+++ /tmp/transformed/extensions_v1beta1_Deployment_mungebot.yaml YYYY-MM-DD HH:MM:SS
|
||||
@@ -3,28 +3,68 @@
|
||||
metadata:
|
||||
annotations:
|
||||
baseAnno: This is an base annotation
|
||||
+ note: This is a test annotation
|
||||
labels:
|
||||
app: mungebot
|
||||
foo: bar
|
||||
- name: baseprefix-mungebot
|
||||
+ org: kubernetes
|
||||
+ repo: test-infra
|
||||
+ name: test-infra-baseprefix-mungebot
|
||||
spec:
|
||||
- replicas: 1
|
||||
+ replicas: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
+ app: mungebot
|
||||
foo: bar
|
||||
+ org: kubernetes
|
||||
+ repo: test-infra
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
baseAnno: This is an base annotation
|
||||
+ note: This is a test annotation
|
||||
labels:
|
||||
app: mungebot
|
||||
foo: bar
|
||||
+ org: kubernetes
|
||||
+ repo: test-infra
|
||||
spec:
|
||||
containers:
|
||||
- env:
|
||||
+ - name: FOO
|
||||
+ valueFrom:
|
||||
+ configMapKeyRef:
|
||||
+ key: somekey
|
||||
+ name: test-infra-app-env-bh449c299k
|
||||
+ - name: BAR
|
||||
+ valueFrom:
|
||||
+ secretKeyRef:
|
||||
+ key: somekey
|
||||
+ name: test-infra-app-tls-6hkmhf2224
|
||||
- name: foo
|
||||
value: bar
|
||||
- image: nginx
|
||||
+ image: nginx:1.7.9
|
||||
name: nginx
|
||||
ports:
|
||||
- containerPort: 80
|
||||
+ - envFrom:
|
||||
+ - configMapRef:
|
||||
+ name: someConfigMap
|
||||
+ - configMapRef:
|
||||
+ name: test-infra-app-env-bh449c299k
|
||||
+ - secretRef:
|
||||
+ name: test-infra-app-tls-6hkmhf2224
|
||||
+ image: busybox
|
||||
+ name: busybox
|
||||
+ volumeMounts:
|
||||
+ - mountPath: /tmp/env
|
||||
+ name: app-env
|
||||
+ - mountPath: /tmp/tls
|
||||
+ name: app-tls
|
||||
+ volumes:
|
||||
+ - configMap:
|
||||
+ name: test-infra-app-env-bh449c299k
|
||||
+ name: app-env
|
||||
+ - name: app-tls
|
||||
+ secret:
|
||||
+ secretName: test-infra-app-tls-6hkmhf2224
|
||||
diff -u -N /tmp/noop/v1_ConfigMap_app-config.yaml /tmp/transformed/v1_ConfigMap_app-config.yaml
|
||||
--- /tmp/noop/v1_ConfigMap_app-config.yaml YYYY-MM-DD HH:MM:SS
|
||||
+++ /tmp/transformed/v1_ConfigMap_app-config.yaml YYYY-MM-DD HH:MM:SS
|
||||
@@ -0,0 +1,15 @@
|
||||
+apiVersion: v1
|
||||
+data:
|
||||
+ app-init.ini: |
|
||||
+ FOO=bar
|
||||
+ BAR=baz
|
||||
+kind: ConfigMap
|
||||
+metadata:
|
||||
+ annotations:
|
||||
+ note: This is a test annotation
|
||||
+ creationTimestamp: null
|
||||
+ labels:
|
||||
+ app: mungebot
|
||||
+ org: kubernetes
|
||||
+ repo: test-infra
|
||||
+ name: test-infra-app-config-hf5424hg8g
|
||||
diff -u -N /tmp/noop/v1_ConfigMap_app-env.yaml /tmp/transformed/v1_ConfigMap_app-env.yaml
|
||||
--- /tmp/noop/v1_ConfigMap_app-env.yaml YYYY-MM-DD HH:MM:SS
|
||||
+++ /tmp/transformed/v1_ConfigMap_app-env.yaml YYYY-MM-DD HH:MM:SS
|
||||
@@ -0,0 +1,14 @@
|
||||
+apiVersion: v1
|
||||
+data:
|
||||
+ DB_PASSWORD: somepw
|
||||
+ DB_USERNAME: admin
|
||||
+kind: ConfigMap
|
||||
+metadata:
|
||||
+ annotations:
|
||||
+ note: This is a test annotation
|
||||
+ creationTimestamp: null
|
||||
+ labels:
|
||||
+ app: mungebot
|
||||
+ org: kubernetes
|
||||
+ repo: test-infra
|
||||
+ name: test-infra-app-env-bh449c299k
|
||||
diff -u -N /tmp/noop/v1_Secret_app-tls.yaml /tmp/transformed/v1_Secret_app-tls.yaml
|
||||
--- /tmp/noop/v1_Secret_app-tls.yaml YYYY-MM-DD HH:MM:SS
|
||||
+++ /tmp/transformed/v1_Secret_app-tls.yaml YYYY-MM-DD HH:MM:SS
|
||||
@@ -0,0 +1,15 @@
|
||||
+apiVersion: v1
|
||||
+data:
|
||||
+ tls.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUIwekNDQVgyZ0F3SUJBZ0lKQUkvTTdCWWp3Qit1TUEwR0NTcUdTSWIzRFFFQkJRVUFNRVV4Q3pBSkJnTlYKQkFZVEFrRlZNUk13RVFZRFZRUUlEQXBUYjIxbExWTjBZWFJsTVNFd0h3WURWUVFLREJoSmJuUmxjbTVsZENCWAphV1JuYVhSeklGQjBlU0JNZEdRd0hoY05NVEl3T1RFeU1qRTFNakF5V2hjTk1UVXdPVEV5TWpFMU1qQXlXakJGCk1Rc3dDUVlEVlFRR0V3SkJWVEVUTUJFR0ExVUVDQXdLVTI5dFpTMVRkR0YwWlRFaE1COEdBMVVFQ2d3WVNXNTAKWlhKdVpYUWdWMmxrWjJsMGN5QlFkSGtnVEhSa01Gd3dEUVlKS29aSWh2Y05BUUVCQlFBRFN3QXdTQUpCQU5MSgpoUEhoSVRxUWJQa2xHM2liQ1Z4d0dNUmZwL3Y0WHFoZmRRSGRjVmZIYXA2TlE1V29rLzR4SUErdWkzNS9NbU5hCnJ0TnVDK0JkWjF0TXVWQ1BGWmNDQXdFQUFhTlFNRTR3SFFZRFZSME9CQllFRkp2S3M4UmZKYVhUSDA4VytTR3YKelF5S24wSDhNQjhHQTFVZEl3UVlNQmFBRkp2S3M4UmZKYVhUSDA4VytTR3Z6UXlLbjBIOE1Bd0dBMVVkRXdRRgpNQU1CQWY4d0RRWUpLb1pJaHZjTkFRRUZCUUFEUVFCSmxmZkpIeWJqREd4Uk1xYVJtRGhYMCs2djAyVFVLWnNXCnI1UXVWYnBRaEg2dSswVWdjVzBqcDlRd3B4b1BUTFRXR1hFV0JCQnVyeEZ3aUNCaGtRK1YKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
|
||||
+ tls.key: LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlCT3dJQkFBSkJBTkxKaFBIaElUcVFiUGtsRzNpYkNWeHdHTVJmcC92NFhxaGZkUUhkY1ZmSGFwNk5RNVdvCmsvNHhJQSt1aTM1L01tTmFydE51QytCZFoxdE11VkNQRlpjQ0F3RUFBUUpBRUoyTit6c1IwWG44L1E2dHdhNEcKNk9CMU0xV08rayt6dG5YLzFTdk5lV3U4RDZHSW10dXBMVFlnalpjSHVmeWtqMDlqaUhtakh4OHU4WlpCL28xTgpNUUloQVBXK2V5Wm83YXkzbE16MVYwMVdWak5LSzlRU24xTUpsYjA2aC9MdVl2OUZBaUVBMjVXUGVkS2dWeUNXClNtVXdiUHc4Zm5UY3BxRFdFM3lUTzN2S2NlYnFNU3NDSUJGM1VtVnVlOFlVM2p5YkMzTnh1WHEzd05tMzRSOFQKeFZMSHdEWGgvNk5KQWlFQWwyb0hHR0x6NjRCdUFmaktycXd6N3FNWXI5SENMSWUvWXNvV3Evb2x6U2NDSVFEaQpEMmxXdXNvZTIvbkVxZkRWVldHV2x5Sjd5T21xYVZtL2lOVU45QjJOMmc9PQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo=
|
||||
+kind: Secret
|
||||
+metadata:
|
||||
+ annotations:
|
||||
+ note: This is a test annotation
|
||||
+ creationTimestamp: null
|
||||
+ labels:
|
||||
+ app: mungebot
|
||||
+ org: kubernetes
|
||||
+ repo: test-infra
|
||||
+ name: test-infra-app-tls-6hkmhf2224
|
||||
+type: kubernetes.io/tls
|
||||
diff -u -N /tmp/noop/v1_Service_mungebot-service.yaml /tmp/transformed/v1_Service_mungebot-service.yaml
|
||||
--- /tmp/noop/v1_Service_mungebot-service.yaml YYYY-MM-DD HH:MM:SS
|
||||
+++ /tmp/transformed/v1_Service_mungebot-service.yaml YYYY-MM-DD HH:MM:SS
|
||||
@@ -3,13 +3,18 @@
|
||||
metadata:
|
||||
annotations:
|
||||
baseAnno: This is an base annotation
|
||||
+ note: This is a test annotation
|
||||
labels:
|
||||
app: mungebot
|
||||
foo: bar
|
||||
- name: baseprefix-mungebot-service
|
||||
+ org: kubernetes
|
||||
+ repo: test-infra
|
||||
+ name: test-infra-baseprefix-mungebot-service
|
||||
spec:
|
||||
ports:
|
||||
- port: 7002
|
||||
selector:
|
||||
app: mungebot
|
||||
foo: bar
|
||||
+ org: kubernetes
|
||||
+ repo: test-infra
|
||||
138
pkg/commands/testdata/testcase-simple/expected.yaml
vendored
Normal file
138
pkg/commands/testdata/testcase-simple/expected.yaml
vendored
Normal file
@@ -0,0 +1,138 @@
|
||||
apiVersion: v1
|
||||
data:
|
||||
app-init.ini: |
|
||||
FOO=bar
|
||||
BAR=baz
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
annotations:
|
||||
note: This is a test annotation
|
||||
creationTimestamp: null
|
||||
labels:
|
||||
app: mungebot
|
||||
org: kubernetes
|
||||
repo: test-infra
|
||||
name: test-infra-app-config-hf5424hg8g
|
||||
---
|
||||
apiVersion: v1
|
||||
data:
|
||||
DB_PASSWORD: somepw
|
||||
DB_USERNAME: admin
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
annotations:
|
||||
note: This is a test annotation
|
||||
creationTimestamp: null
|
||||
labels:
|
||||
app: mungebot
|
||||
org: kubernetes
|
||||
repo: test-infra
|
||||
name: test-infra-app-env-bh449c299k
|
||||
---
|
||||
apiVersion: v1
|
||||
data:
|
||||
tls.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUIwekNDQVgyZ0F3SUJBZ0lKQUkvTTdCWWp3Qit1TUEwR0NTcUdTSWIzRFFFQkJRVUFNRVV4Q3pBSkJnTlYKQkFZVEFrRlZNUk13RVFZRFZRUUlEQXBUYjIxbExWTjBZWFJsTVNFd0h3WURWUVFLREJoSmJuUmxjbTVsZENCWAphV1JuYVhSeklGQjBlU0JNZEdRd0hoY05NVEl3T1RFeU1qRTFNakF5V2hjTk1UVXdPVEV5TWpFMU1qQXlXakJGCk1Rc3dDUVlEVlFRR0V3SkJWVEVUTUJFR0ExVUVDQXdLVTI5dFpTMVRkR0YwWlRFaE1COEdBMVVFQ2d3WVNXNTAKWlhKdVpYUWdWMmxrWjJsMGN5QlFkSGtnVEhSa01Gd3dEUVlKS29aSWh2Y05BUUVCQlFBRFN3QXdTQUpCQU5MSgpoUEhoSVRxUWJQa2xHM2liQ1Z4d0dNUmZwL3Y0WHFoZmRRSGRjVmZIYXA2TlE1V29rLzR4SUErdWkzNS9NbU5hCnJ0TnVDK0JkWjF0TXVWQ1BGWmNDQXdFQUFhTlFNRTR3SFFZRFZSME9CQllFRkp2S3M4UmZKYVhUSDA4VytTR3YKelF5S24wSDhNQjhHQTFVZEl3UVlNQmFBRkp2S3M4UmZKYVhUSDA4VytTR3Z6UXlLbjBIOE1Bd0dBMVVkRXdRRgpNQU1CQWY4d0RRWUpLb1pJaHZjTkFRRUZCUUFEUVFCSmxmZkpIeWJqREd4Uk1xYVJtRGhYMCs2djAyVFVLWnNXCnI1UXVWYnBRaEg2dSswVWdjVzBqcDlRd3B4b1BUTFRXR1hFV0JCQnVyeEZ3aUNCaGtRK1YKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
|
||||
tls.key: LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlCT3dJQkFBSkJBTkxKaFBIaElUcVFiUGtsRzNpYkNWeHdHTVJmcC92NFhxaGZkUUhkY1ZmSGFwNk5RNVdvCmsvNHhJQSt1aTM1L01tTmFydE51QytCZFoxdE11VkNQRlpjQ0F3RUFBUUpBRUoyTit6c1IwWG44L1E2dHdhNEcKNk9CMU0xV08rayt6dG5YLzFTdk5lV3U4RDZHSW10dXBMVFlnalpjSHVmeWtqMDlqaUhtakh4OHU4WlpCL28xTgpNUUloQVBXK2V5Wm83YXkzbE16MVYwMVdWak5LSzlRU24xTUpsYjA2aC9MdVl2OUZBaUVBMjVXUGVkS2dWeUNXClNtVXdiUHc4Zm5UY3BxRFdFM3lUTzN2S2NlYnFNU3NDSUJGM1VtVnVlOFlVM2p5YkMzTnh1WHEzd05tMzRSOFQKeFZMSHdEWGgvNk5KQWlFQWwyb0hHR0x6NjRCdUFmaktycXd6N3FNWXI5SENMSWUvWXNvV3Evb2x6U2NDSVFEaQpEMmxXdXNvZTIvbkVxZkRWVldHV2x5Sjd5T21xYVZtL2lOVU45QjJOMmc9PQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo=
|
||||
kind: Secret
|
||||
metadata:
|
||||
annotations:
|
||||
note: This is a test annotation
|
||||
creationTimestamp: null
|
||||
labels:
|
||||
app: mungebot
|
||||
org: kubernetes
|
||||
repo: test-infra
|
||||
name: test-infra-app-tls-6hkmhf2224
|
||||
type: kubernetes.io/tls
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
annotations:
|
||||
baseAnno: This is an base annotation
|
||||
note: This is a test annotation
|
||||
labels:
|
||||
app: mungebot
|
||||
foo: bar
|
||||
org: kubernetes
|
||||
repo: test-infra
|
||||
name: test-infra-baseprefix-mungebot-service
|
||||
spec:
|
||||
ports:
|
||||
- port: 7002
|
||||
selector:
|
||||
app: mungebot
|
||||
foo: bar
|
||||
org: kubernetes
|
||||
repo: test-infra
|
||||
---
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
annotations:
|
||||
baseAnno: This is an base annotation
|
||||
note: This is a test annotation
|
||||
labels:
|
||||
app: mungebot
|
||||
foo: bar
|
||||
org: kubernetes
|
||||
repo: test-infra
|
||||
name: test-infra-baseprefix-mungebot
|
||||
spec:
|
||||
replicas: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
app: mungebot
|
||||
foo: bar
|
||||
org: kubernetes
|
||||
repo: test-infra
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
baseAnno: This is an base annotation
|
||||
note: This is a test annotation
|
||||
labels:
|
||||
app: mungebot
|
||||
foo: bar
|
||||
org: kubernetes
|
||||
repo: test-infra
|
||||
spec:
|
||||
containers:
|
||||
- env:
|
||||
- name: FOO
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: somekey
|
||||
name: test-infra-app-env-bh449c299k
|
||||
- name: BAR
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
key: somekey
|
||||
name: test-infra-app-tls-6hkmhf2224
|
||||
- name: foo
|
||||
value: bar
|
||||
image: nginx:1.7.9
|
||||
name: nginx
|
||||
ports:
|
||||
- containerPort: 80
|
||||
- envFrom:
|
||||
- configMapRef:
|
||||
name: someConfigMap
|
||||
- configMapRef:
|
||||
name: test-infra-app-env-bh449c299k
|
||||
- secretRef:
|
||||
name: test-infra-app-tls-6hkmhf2224
|
||||
image: busybox
|
||||
name: busybox
|
||||
volumeMounts:
|
||||
- mountPath: /tmp/env
|
||||
name: app-env
|
||||
- mountPath: /tmp/tls
|
||||
name: app-tls
|
||||
volumes:
|
||||
- configMap:
|
||||
name: test-infra-app-env-bh449c299k
|
||||
name: app-env
|
||||
- name: app-tls
|
||||
secret:
|
||||
secretName: test-infra-app-tls-6hkmhf2224
|
||||
5
pkg/commands/testdata/testcase-simple/test.yaml
vendored
Normal file
5
pkg/commands/testdata/testcase-simple/test.yaml
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
description: simple
|
||||
args: []
|
||||
filename: ../examples/simple/instances/exampleinstance/
|
||||
expectedStdout: testdata/testcase-simple/expected.yaml
|
||||
expectedDiff: testdata/testcase-simple/expected.diff
|
||||
128
pkg/commands/testdata/testcase-single-overlay/expected.diff
vendored
Normal file
128
pkg/commands/testdata/testcase-single-overlay/expected.diff
vendored
Normal file
@@ -0,0 +1,128 @@
|
||||
diff -u -N /tmp/noop/apps_v1beta2_Deployment_nginx.yaml /tmp/transformed/apps_v1beta2_Deployment_nginx.yaml
|
||||
--- /tmp/noop/apps_v1beta2_Deployment_nginx.yaml YYYY-MM-DD HH:MM:SS
|
||||
+++ /tmp/transformed/apps_v1beta2_Deployment_nginx.yaml YYYY-MM-DD HH:MM:SS
|
||||
@@ -5,23 +5,26 @@
|
||||
note: This is a test annotation
|
||||
labels:
|
||||
app: mynginx
|
||||
+ env: staging
|
||||
org: example.com
|
||||
- team: foo
|
||||
- name: team-foo-nginx
|
||||
+ team: override-foo
|
||||
+ name: staging-team-foo-nginx
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: mynginx
|
||||
+ env: staging
|
||||
org: example.com
|
||||
- team: foo
|
||||
+ team: override-foo
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
note: This is a test annotation
|
||||
labels:
|
||||
app: mynginx
|
||||
+ env: staging
|
||||
org: example.com
|
||||
- team: foo
|
||||
+ team: override-foo
|
||||
spec:
|
||||
containers:
|
||||
- image: nginx
|
||||
@@ -30,8 +33,12 @@
|
||||
- mountPath: /tmp/ps
|
||||
name: nginx-persistent-storage
|
||||
volumes:
|
||||
- - emptyDir: {}
|
||||
+ - gcePersistentDisk:
|
||||
+ pdName: nginx-persistent-storage
|
||||
name: nginx-persistent-storage
|
||||
- configMap:
|
||||
- name: team-foo-configmap-in-base-bbdmdh7m8t
|
||||
+ name: staging-configmap-in-overlay-k7cbc75tg8
|
||||
+ name: configmap-in-overlay
|
||||
+ - configMap:
|
||||
+ name: staging-team-foo-configmap-in-base-gh9d7t85gb
|
||||
name: configmap-in-base
|
||||
diff -u -N /tmp/noop/v1_ConfigMap_configmap-in-base.yaml /tmp/transformed/v1_ConfigMap_configmap-in-base.yaml
|
||||
--- /tmp/noop/v1_ConfigMap_configmap-in-base.yaml YYYY-MM-DD HH:MM:SS
|
||||
+++ /tmp/transformed/v1_ConfigMap_configmap-in-base.yaml YYYY-MM-DD HH:MM:SS
|
||||
@@ -1,6 +1,6 @@
|
||||
apiVersion: v1
|
||||
data:
|
||||
- foo: bar
|
||||
+ foo: override-bar
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
annotations:
|
||||
@@ -8,6 +8,7 @@
|
||||
creationTimestamp: null
|
||||
labels:
|
||||
app: mynginx
|
||||
+ env: staging
|
||||
org: example.com
|
||||
- team: foo
|
||||
- name: team-foo-configmap-in-base-bbdmdh7m8t
|
||||
+ team: override-foo
|
||||
+ name: staging-team-foo-configmap-in-base-gh9d7t85gb
|
||||
diff -u -N /tmp/noop/v1_ConfigMap_configmap-in-overlay.yaml /tmp/transformed/v1_ConfigMap_configmap-in-overlay.yaml
|
||||
--- /tmp/noop/v1_ConfigMap_configmap-in-overlay.yaml YYYY-MM-DD HH:MM:SS
|
||||
+++ /tmp/transformed/v1_ConfigMap_configmap-in-overlay.yaml YYYY-MM-DD HH:MM:SS
|
||||
@@ -0,0 +1,10 @@
|
||||
+apiVersion: v1
|
||||
+data:
|
||||
+ hello: world
|
||||
+kind: ConfigMap
|
||||
+metadata:
|
||||
+ creationTimestamp: null
|
||||
+ labels:
|
||||
+ env: staging
|
||||
+ team: override-foo
|
||||
+ name: staging-configmap-in-overlay-k7cbc75tg8
|
||||
diff -u -N /tmp/noop/v1_Secret_secret-in-base.yaml /tmp/transformed/v1_Secret_secret-in-base.yaml
|
||||
--- /tmp/noop/v1_Secret_secret-in-base.yaml YYYY-MM-DD HH:MM:SS
|
||||
+++ /tmp/transformed/v1_Secret_secret-in-base.yaml YYYY-MM-DD HH:MM:SS
|
||||
@@ -1,6 +1,7 @@
|
||||
apiVersion: v1
|
||||
data:
|
||||
password: c29tZXB3
|
||||
+ proxy: aGFwcm94eQ==
|
||||
username: YWRtaW4=
|
||||
kind: Secret
|
||||
metadata:
|
||||
@@ -9,7 +10,8 @@
|
||||
creationTimestamp: null
|
||||
labels:
|
||||
app: mynginx
|
||||
+ env: staging
|
||||
org: example.com
|
||||
- team: foo
|
||||
- name: team-foo-secret-in-base-tkm7hhtf8d
|
||||
+ team: override-foo
|
||||
+ name: staging-team-foo-secret-in-base-c8db7gk2m2
|
||||
type: Opaque
|
||||
diff -u -N /tmp/noop/v1_Service_nginx.yaml /tmp/transformed/v1_Service_nginx.yaml
|
||||
--- /tmp/noop/v1_Service_nginx.yaml YYYY-MM-DD HH:MM:SS
|
||||
+++ /tmp/transformed/v1_Service_nginx.yaml YYYY-MM-DD HH:MM:SS
|
||||
@@ -5,13 +5,15 @@
|
||||
note: This is a test annotation
|
||||
labels:
|
||||
app: mynginx
|
||||
+ env: staging
|
||||
org: example.com
|
||||
- team: foo
|
||||
- name: team-foo-nginx
|
||||
+ team: override-foo
|
||||
+ name: staging-team-foo-nginx
|
||||
spec:
|
||||
ports:
|
||||
- port: 80
|
||||
selector:
|
||||
app: mynginx
|
||||
+ env: staging
|
||||
org: example.com
|
||||
- team: foo
|
||||
+ team: override-foo
|
||||
108
pkg/commands/testdata/testcase-single-overlay/expected.yaml
vendored
Normal file
108
pkg/commands/testdata/testcase-single-overlay/expected.yaml
vendored
Normal file
@@ -0,0 +1,108 @@
|
||||
apiVersion: v1
|
||||
data:
|
||||
foo: override-bar
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
annotations:
|
||||
note: This is a test annotation
|
||||
creationTimestamp: null
|
||||
labels:
|
||||
app: mynginx
|
||||
env: staging
|
||||
org: example.com
|
||||
team: override-foo
|
||||
name: staging-team-foo-configmap-in-base-gh9d7t85gb
|
||||
---
|
||||
apiVersion: v1
|
||||
data:
|
||||
hello: world
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
creationTimestamp: null
|
||||
labels:
|
||||
env: staging
|
||||
team: override-foo
|
||||
name: staging-configmap-in-overlay-k7cbc75tg8
|
||||
---
|
||||
apiVersion: v1
|
||||
data:
|
||||
password: c29tZXB3
|
||||
proxy: aGFwcm94eQ==
|
||||
username: YWRtaW4=
|
||||
kind: Secret
|
||||
metadata:
|
||||
annotations:
|
||||
note: This is a test annotation
|
||||
creationTimestamp: null
|
||||
labels:
|
||||
app: mynginx
|
||||
env: staging
|
||||
org: example.com
|
||||
team: override-foo
|
||||
name: staging-team-foo-secret-in-base-c8db7gk2m2
|
||||
type: Opaque
|
||||
---
|
||||
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: apps/v1beta2
|
||||
kind: Deployment
|
||||
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:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: mynginx
|
||||
env: staging
|
||||
org: example.com
|
||||
team: override-foo
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
note: This is a test annotation
|
||||
labels:
|
||||
app: mynginx
|
||||
env: staging
|
||||
org: example.com
|
||||
team: override-foo
|
||||
spec:
|
||||
containers:
|
||||
- image: nginx
|
||||
name: nginx
|
||||
volumeMounts:
|
||||
- mountPath: /tmp/ps
|
||||
name: nginx-persistent-storage
|
||||
volumes:
|
||||
- gcePersistentDisk:
|
||||
pdName: nginx-persistent-storage
|
||||
name: nginx-persistent-storage
|
||||
- configMap:
|
||||
name: staging-configmap-in-overlay-k7cbc75tg8
|
||||
name: configmap-in-overlay
|
||||
- configMap:
|
||||
name: staging-team-foo-configmap-in-base-gh9d7t85gb
|
||||
name: configmap-in-base
|
||||
15
pkg/commands/testdata/testcase-single-overlay/in/overlay/deployment.yaml
vendored
Normal file
15
pkg/commands/testdata/testcase-single-overlay/in/overlay/deployment.yaml
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
apiVersion: apps/v1beta2
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: nginx
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
volumes:
|
||||
- name: nginx-persistent-storage
|
||||
emptyDir: null
|
||||
gcePersistentDisk:
|
||||
pdName: nginx-persistent-storage
|
||||
- configMap:
|
||||
name: configmap-in-overlay
|
||||
name: configmap-in-overlay
|
||||
21
pkg/commands/testdata/testcase-single-overlay/in/overlay/kustomization.yaml
vendored
Normal file
21
pkg/commands/testdata/testcase-single-overlay/in/overlay/kustomization.yaml
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
namePrefix: staging-
|
||||
commonLabels:
|
||||
env: staging
|
||||
team: override-foo
|
||||
patches:
|
||||
- deployment.yaml
|
||||
bases:
|
||||
- ../package/
|
||||
configMapGenerator:
|
||||
- name: configmap-in-overlay
|
||||
literals:
|
||||
- hello=world
|
||||
- name: configmap-in-base
|
||||
behavior: replace
|
||||
literals:
|
||||
- foo=override-bar
|
||||
secretGenerator:
|
||||
- name: secret-in-base
|
||||
behavior: merge
|
||||
commands:
|
||||
proxy: "printf haproxy"
|
||||
24
pkg/commands/testdata/testcase-single-overlay/in/package/deployment.yaml
vendored
Normal file
24
pkg/commands/testdata/testcase-single-overlay/in/package/deployment.yaml
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
apiVersion: apps/v1beta2
|
||||
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
|
||||
19
pkg/commands/testdata/testcase-single-overlay/in/package/kustomization.yaml
vendored
Normal file
19
pkg/commands/testdata/testcase-single-overlay/in/package/kustomization.yaml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
namePrefix: team-foo-
|
||||
commonLabels:
|
||||
app: mynginx
|
||||
org: example.com
|
||||
team: foo
|
||||
commonAnnotations:
|
||||
note: This is a test annotation
|
||||
resources:
|
||||
- deployment.yaml
|
||||
- service.yaml
|
||||
configMapGenerator:
|
||||
- name: configmap-in-base
|
||||
literals:
|
||||
- foo=bar
|
||||
secretGenerator:
|
||||
- name: secret-in-base
|
||||
commands:
|
||||
username: "printf admin"
|
||||
password: "printf somepw"
|
||||
11
pkg/commands/testdata/testcase-single-overlay/in/package/service.yaml
vendored
Normal file
11
pkg/commands/testdata/testcase-single-overlay/in/package/service.yaml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: nginx
|
||||
labels:
|
||||
app: nginx
|
||||
spec:
|
||||
ports:
|
||||
- port: 80
|
||||
selector:
|
||||
app: nginx
|
||||
5
pkg/commands/testdata/testcase-single-overlay/test.yaml
vendored
Normal file
5
pkg/commands/testdata/testcase-single-overlay/test.yaml
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
description: single overlay
|
||||
args: []
|
||||
filename: testdata/testcase-single-overlay/in/overlay/
|
||||
expectedStdout: testdata/testcase-single-overlay/expected.yaml
|
||||
expectedDiff: testdata/testcase-single-overlay/expected.diff
|
||||
Reference in New Issue
Block a user