@@ -3,9 +3,47 @@ templates:
33 - rp/deployment.yaml
44 - rp/configmaps.yaml
55 - dynamic-rp/deployment.yaml
6+ - terraform-pvc.yaml
67tests :
8+ # Terraform PVC tests
9+ - it : should create terraform PVC when terraform is enabled
10+ set :
11+ global.terraform.enabled : true
12+ asserts :
13+ - isKind :
14+ of : PersistentVolumeClaim
15+ template : terraform-pvc.yaml
16+ - equal :
17+ path : metadata.name
18+ value : terraform-storage
19+ template : terraform-pvc.yaml
20+ - contains :
21+ path : spec.accessModes
22+ content : ReadWriteMany
23+ template : terraform-pvc.yaml
24+
25+ - it : should use custom storage class when specified
26+ set :
27+ global.terraform.enabled : true
28+ global.terraform.storageClassName : " nfs"
29+ asserts :
30+ - equal :
31+ path : spec.storageClassName
32+ value : " nfs"
33+ template : terraform-pvc.yaml
34+
35+ - it : should use custom storage size when specified
36+ set :
37+ global.terraform.enabled : true
38+ global.terraform.storageSize : " 5Gi"
39+ asserts :
40+ - equal :
41+ path : spec.resources.requests.storage
42+ value : " 5Gi"
43+ template : terraform-pvc.yaml
44+
745 # applications-rp terraform volume tests
8- - it : should create emptyDir terraform volume in applications-rp when terraform is enabled
46+ - it : should use PVC for terraform volume in applications-rp when terraform is enabled
947 set :
1048 global.terraform.enabled : true
1149 rp.image : applications-rp
1553 path : spec.template.spec.volumes
1654 content :
1755 name : terraform
18- emptyDir : {}
56+ persistentVolumeClaim :
57+ claimName : terraform-storage
1958 template : rp/deployment.yaml
2059
2160 - it : should mount terraform volume in applications-rp container
5695 template : rp/configmaps.yaml
5796
5897 # dynamic-rp terraform volume tests
59- - it : should create emptyDir terraform volume in dynamic-rp when terraform is enabled
98+ - it : should use PVC for terraform volume in dynamic-rp when terraform is enabled
6099 set :
61100 global.terraform.enabled : true
62101 dynamicrp.image : dynamic-rp
@@ -66,7 +105,8 @@ tests:
66105 path : spec.template.spec.volumes
67106 content :
68107 name : terraform
69- emptyDir : {}
108+ persistentVolumeClaim :
109+ claimName : terraform-storage
70110 template : dynamic-rp/deployment.yaml
71111
72112 - it : should mount terraform volume in dynamic-rp container
@@ -99,26 +139,28 @@ tests:
99139 any : true
100140 template : dynamic-rp/deployment.yaml
101141
102- # Both deployments use independent emptyDir volumes (pod-local storage)
103- - it : should use independent emptyDir volumes for each deployment
142+ # Both deployments use the same shared PVC
143+ - it : should use shared PVC for both deployments
104144 set :
105145 global.terraform.enabled : true
106146 rp.image : applications-rp
107147 rp.tag : latest
108148 dynamicrp.image : dynamic-rp
109149 dynamicrp.tag : latest
110150 asserts :
111- # applications-rp uses emptyDir
151+ # applications-rp uses shared PVC
112152 - contains :
113153 path : spec.template.spec.volumes
114154 content :
115155 name : terraform
116- emptyDir : {}
156+ persistentVolumeClaim :
157+ claimName : terraform-storage
117158 template : rp/deployment.yaml
118- # dynamic-rp uses emptyDir
159+ # dynamic-rp uses same shared PVC
119160 - contains :
120161 path : spec.template.spec.volumes
121162 content :
122163 name : terraform
123- emptyDir : {}
164+ persistentVolumeClaim :
165+ claimName : terraform-storage
124166 template : dynamic-rp/deployment.yaml
0 commit comments