-
Notifications
You must be signed in to change notification settings - Fork 15
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
Truncate the delete apiservice job name #471
Conversation
@@ -1,7 +1,7 @@ | |||
apiVersion: batch/v1 | |||
kind: Job | |||
metadata: | |||
name: {{ include "konk-service.fullname" . }}-delete-apiservice | |||
name: {{ include "konk-service.fullname" . | trunc 43 }}-delete-apiservice |
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 is fine, but it might be a little more obvious to the reader to truncate the whole string to the actual limit like
name: {{ include "konk-service.fullname" . | trunc 43 }}-delete-apiservice | |
name: {{ printf "%s-delete-apiservice" (include "konk-service.fullname" .) | trunc 63 }} |
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.
Never mind, I think I prefer the way you did it originally. A really long name that truncates the entire -delete-apiservice
part off the end could result in an ambiguous name.
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.
One thing I would do either way is trim double -
like the helpers do:
name: {{ include "konk-service.fullname" . | trunc 43 }}-delete-apiservice | |
name: {{ include "konk-service.fullname" . | trunc 43 | trimSuffix "-" }}-delete-apiservice |
962c6b2
to
1af2cad
Compare
1af2cad
to
e1de851
Compare
Observed an error where a long konk-service release name could potentially prevent a delete-apiservice job from triggering as it would surpass the 63 character limit allowed for job names. This PR resolves this by truncating the length of the job name to less than 63 characters.