You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.1 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. {{- define "suffix-name" -}}
  2. {{- if .Values.app.name -}}
  3. {{- .Values.app.name -}}
  4. {{- else -}}
  5. {{- .Release.Name -}}
  6. {{- end -}}
  7. {{- end -}}
  8. {{- define "sql-name" -}}
  9. {{- if .Values.inf.sql.host -}}
  10. {{- .Values.inf.sql.host -}}
  11. {{- else -}}
  12. {{- printf "%s" "sql-data" -}}
  13. {{- end -}}
  14. {{- end -}}
  15. {{- define "mongo-name" -}}
  16. {{- if .Values.inf.mongo.host -}}
  17. {{- .Values.inf.mongo.host -}}
  18. {{- else -}}
  19. {{- printf "%s" "nosql-data" -}}
  20. {{- end -}}
  21. {{- end -}}
  22. {{- define "url-of" -}}
  23. {{- $name := first .}}
  24. {{- $ctx := last .}}
  25. {{- if eq $name "" -}}
  26. {{- $ctx.Values.inf.k8s.dns -}}
  27. {{- else -}}
  28. {{- printf "%s/%s" $ctx.Values.inf.k8s.dns $name -}} {{/*Value is just <dns>/<name> */}}
  29. {{- end -}}
  30. {{- end -}}
  31. {{- define "pathBase" -}}
  32. {{- if .Values.inf.k8s.suffix -}}
  33. {{- $suffix := include "suffix-name" . -}}
  34. {{- printf "%s-%s" .Values.pathBase $suffix -}}
  35. {{- else -}}
  36. {{- .Values.pathBase -}}
  37. {{- end -}}
  38. {{- end -}}
  39. {{- define "fqdn-image" -}}
  40. {{- if .Values.inf.registry -}}
  41. {{- printf "%s/%s" .Values.inf.registry.server .Values.image.repository -}}
  42. {{- else -}}
  43. {{- .Values.image.repository -}}
  44. {{- end -}}
  45. {{- end -}}