Skip to content

Commit 2b9c32b

Browse files
committed
chore: Refactor test for wait functionality
- Test all supported resources separatly - Test DaemonSet resource
1 parent ea02f51 commit 2b9c32b

File tree

18 files changed

+261
-286
lines changed

18 files changed

+261
-286
lines changed

kustomize/resource_kustomization_test.go

Lines changed: 134 additions & 240 deletions
Large diffs are not rendered by default.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: apps/v1
2+
kind: DaemonSet
3+
metadata:
4+
labels:
5+
app: test
6+
name: test
7+
spec:
8+
selector:
9+
matchLabels:
10+
app: test
11+
template:
12+
metadata:
13+
labels:
14+
app: test
15+
spec:
16+
containers:
17+
- image: nginx
18+
name: nginx

kustomize/test_kustomizations/nowait/initial/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ namespace: test-nowait
55

66
resources:
77
- namespace.yaml
8+
- daemonset.yaml
89
- statefulset.yaml
910
- ../../_example_app

kustomize/test_kustomizations/nowait/initial/statefulset.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ apiVersion: apps/v1
22
kind: StatefulSet
33
metadata:
44
labels:
5-
app: test-statefulset
6-
name: test-statefulset
5+
app: test
6+
name: test
77
spec:
88
replicas: 1
99
selector:
1010
matchLabels:
11-
app: test-statefulset
11+
app: test
1212
template:
1313
metadata:
1414
labels:
15-
app: test-statefulset
15+
app: test
1616
spec:
1717
containers:
1818
- image: nginx

kustomize/test_kustomizations/nowait/modified/kustomization.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,19 @@ patches:
1313
path: /spec/template/metadata/annotations
1414
value:
1515
new: this will cause a redeploy
16+
- target:
17+
kind: DaemonSet
18+
name: test
19+
patch: |
20+
- op: add
21+
path: /spec/template/metadata/annotations
22+
value:
23+
new: this will cause a redeploy
1624
- target:
1725
kind: StatefulSet
18-
name: test-statefulset
26+
name: test
1927
patch: |
2028
- op: add
2129
path: /spec/template/metadata/annotations
2230
value:
23-
new: this will cause statefulset to redeploy
31+
new: this will cause a redeploy
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: apps/v1
2+
kind: DaemonSet
3+
metadata:
4+
labels:
5+
app: test
6+
name: test
7+
spec:
8+
selector:
9+
matchLabels:
10+
app: test
11+
template:
12+
metadata:
13+
labels:
14+
app: test
15+
spec:
16+
containers:
17+
- image: nginx
18+
name: nginx

kustomize/test_kustomizations/wait-change/initial/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ namespace: test-wait-change
55

66
resources:
77
- namespace.yaml
8+
- daemonset.yaml
89
- statefulset.yaml
910
- ../../_example_app

kustomize/test_kustomizations/wait-change/initial/statefulset.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ apiVersion: apps/v1
22
kind: StatefulSet
33
metadata:
44
labels:
5-
app: test-statefulset
6-
name: test-statefulset
5+
app: test
6+
name: test
77
spec:
88
replicas: 1
99
selector:
1010
matchLabels:
11-
app: test-statefulset
11+
app: test
1212
template:
1313
metadata:
1414
labels:
15-
app: test-statefulset
15+
app: test
1616
spec:
1717
containers:
1818
- image: nginx

kustomize/test_kustomizations/wait-fail-statefulset/initial/kustomization.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.

kustomize/test_kustomizations/wait-fail-statefulset/initial/namespace.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)