_image.tpl 888 B

123456789101112131415161718192021222324252627
  1. {{/*
  2. Victoria Metrics Image
  3. */}}
  4. {{- define "vm.image" -}}
  5. {{- $Chart := (.helm).Chart | default .Chart -}}
  6. {{- $Values := (.helm).Values | default .Values -}}
  7. {{- $tag := .app.image.tag -}}
  8. {{- if empty $tag }}
  9. {{- $tag = $Chart.AppVersion -}}
  10. {{- $variant := .app.image.variant }}
  11. {{- if eq (include "vm.enterprise.disabled" .) "false" -}}
  12. {{- if $variant }}
  13. {{- $variant = printf "enterprise-%s" $variant }}
  14. {{- else }}
  15. {{- $variant = "enterprise" }}
  16. {{- end }}
  17. {{- end -}}
  18. {{- with $variant -}}
  19. {{- $tag = (printf "%s-%s" $tag .) -}}
  20. {{- end -}}
  21. {{- end -}}
  22. {{- $image := tpl (printf "%s:%s" .app.image.repository $tag) . -}}
  23. {{- with .app.image.registry | default (($Values.global).image).registry | default "" -}}
  24. {{- $image = (printf "%s/%s" . $image) -}}
  25. {{- end -}}
  26. {{- $image -}}
  27. {{- end -}}