-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for setting the service name #113
base: main
Are you sure you want to change the base?
Conversation
{{- if .Values.service.name }} | ||
name: {{ .Values.service.name }} | ||
{{- else }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, I think this could be written as:
{{- if .Values.service.name }} | |
name: {{ .Values.service.name }} | |
{{- else }} | |
name: {{ .Values.service.name | default template "docker-registry.fullname" . }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works with include
instead of template
, and some extra parens:
{{- if .Values.service.name }} | |
name: {{ .Values.service.name }} | |
{{- else }} | |
name: {{ .Values.service.name | default (include "docker-registry.fullname" .) }} |
I found a nice reference about template vs. include here: https://stackoverflow.com/a/71091339
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@perangel Nice catch, this is a much needed feature! I left a suggestion that I've tested locally and confirmed works for me.
If that suggestion looks good to you, please apply it and we can get this merged in 👍
Edit: we do also need to make that change anywhere the service name is referenced, for example from the ingress resource.
{{- if .Values.service.name }} | ||
name: {{ .Values.service.name }} | ||
{{- else }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works with include
instead of template
, and some extra parens:
{{- if .Values.service.name }} | |
name: {{ .Values.service.name }} | |
{{- else }} | |
name: {{ .Values.service.name | default (include "docker-registry.fullname" .) }} |
I found a nice reference about template vs. include here: https://stackoverflow.com/a/71091339
Problem
It would be useful to be able to specify the service name and not rely on the
fullname
(which requires usingfullnameOverride
to set).While
service.name
is defined in thevalues.yaml
, it is not referenced anywhere.Proposed Solution
service.name
to""
and add anif/else
conditional in the service template that will allow you to specify the service name.