File tree 1 file changed +9
-1
lines changed
resource-definitions/template-driver/volumes
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -6,11 +6,19 @@ resource "humanitec_resource_definition" "volume-nfs" {
6
6
driver_inputs = {
7
7
values_string = jsonencode ({
8
8
" templates" = {
9
- " init" = << END_OF_TEXT
9
+ " cookie" = << END_OF_TEXT
10
+ # Store the volumeUid in a cookie to be reused for subsequent deployments
11
+ volumeUid: {{ .init.volumeUid }}
12
+ END_OF_TEXT
13
+ " init" = << END_OF_TEXT
10
14
# Generate a unique id for each pv/pvc combination.
11
15
# Every Workload will have a separate pv and pvc created for it,
12
16
# but pointing to the same NFS server endpoint.
17
+ {{- if and .cookie .cookie.volumeUid }}
18
+ volumeUid: {{ .cookie.volumeUid }}
19
+ {{- else }}
13
20
volumeUid: {{ randNumeric 4 }}-{{ randNumeric 4 }}
21
+ {{- end }}
14
22
pvBaseName: pv-tmpl-
15
23
pvcBaseName: pvc-tmpl-
16
24
volBaseName: vol-tmpl-
You can’t perform that action at this time.
0 commit comments