Replace hasPrefix per printf

This commit is contained in:
disaster 2017-04-19 08:02:27 +00:00
parent c09e26e902
commit 75e26f78d7

View File

@ -65,7 +65,7 @@ services:
tty: true tty: true
image: webcenter/alpine-gocd-agent:17.3.0-1 image: webcenter/alpine-gocd-agent:17.3.0-1
volumes: volumes:
{{- if (contains .Values.VOLUME_DRIVER_AGENT "/")}} {{- if eq (printf "%.1s" .Values.VOLUME_DRIVER_AGENT) "/"}}
- ${VOLUME_DRIVER_AGENT}:/data - ${VOLUME_DRIVER_AGENT}:/data
{{- else}} {{- else}}
- gocd-agent-data:/data - gocd-agent-data:/data
@ -102,7 +102,7 @@ services:
io.rancher.container.hostname_override: container_name io.rancher.container.hostname_override: container_name
image: index.docker.io/docker:1.13-dind image: index.docker.io/docker:1.13-dind
volumes: volumes:
{{- if (contains .Values.VOLUME_DRIVER_AGENT "/")}} {{- if eq (printf "%.1s" .Values.VOLUME_DRIVER_AGENT) "/"}}
- ${VOLUME_DRIVER_AGENT}:/data - ${VOLUME_DRIVER_AGENT}:/data
{{- else}} {{- else}}
- gocd-agent-data:/data - gocd-agent-data:/data
@ -114,12 +114,12 @@ volumes:
gocd-scheduler-setting: gocd-scheduler-setting:
driver: local driver: local
per_container: true per_container: true
{{- if not (contains .Values.VOLUME_DRIVER_AGENT "/")}} {{- if ne (printf "%.1s" .Values.VOLUME_DRIVER_AGENT) "/"}}
gocd-agent-data: gocd-agent-data:
driver: ${VOLUME_DRIVER_AGENT} driver: ${VOLUME_DRIVER_AGENT}
per_container: true per_container: true
{{- end}} {{- end}}
{{- if not (contains .Values.VOLUME_DRIVER_SERVER "/")}} {{- if ne (printf "%.1s" .Values.VOLUME_DRIVER_SERVER) "/"}}
gocd-server-data: gocd-server-data:
driver: ${VOLUME_DRIVER_SERVER} driver: ${VOLUME_DRIVER_SERVER}
{{- end}} {{- end}}