Skip to content

Commit f11d354

Browse files
authored
Update generated example library content (#155)
2 parents a94bc3d + b2ebb6f commit f11d354

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

resource-definitions/template-driver/volumes/volume-nfs.tf

+9-1
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,19 @@ resource "humanitec_resource_definition" "volume-nfs" {
66
driver_inputs = {
77
values_string = jsonencode({
88
"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
1014
# Generate a unique id for each pv/pvc combination.
1115
# Every Workload will have a separate pv and pvc created for it,
1216
# but pointing to the same NFS server endpoint.
17+
{{- if and .cookie .cookie.volumeUid }}
18+
volumeUid: {{ .cookie.volumeUid }}
19+
{{- else }}
1320
volumeUid: {{ randNumeric 4 }}-{{ randNumeric 4 }}
21+
{{- end }}
1422
pvBaseName: pv-tmpl-
1523
pvcBaseName: pvc-tmpl-
1624
volBaseName: vol-tmpl-

0 commit comments

Comments
 (0)