-
Notifications
You must be signed in to change notification settings - Fork 456
feat: add nameOverride
support to helm templates
#3864
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
Conversation
✅ Deploy Preview for tetragon ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Hey just fyi we have a draft PR opened for that #3604 which seems a bit abandoned. Will review this one thanks! :) |
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.
looks great 🥰
Resources names | ||
*/}} | ||
{{- define "tetragon.name" -}} | ||
{{- default .Release.Name .Values.tetragon.nameOverride | trunc 63 | trimSuffix "-" }} |
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.
Why is trimSuffix
needed here?
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.
Most k8s object names and ids must start and end with alphanumeric chars, this is common failsafe.
You could theoretically set your release name or nameOverride to
amazing-tetragon-deployment-named-long-with-dashes-because-why-not
(66 chars), truncated to 63 would result intoamazing-tetragon-deployment-named-long-with-dashes-because-why-
, which would fail
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.
Overall looks good! Should you also update the remaining app.kubernetes.io/instance: {{ .Release.Name }}
labels around?
Best practice is for |
- adds `nameOverride` to tetragon and tetragonOperator Helm values. - adds helper templates and makes resources names dependent on tetragon and operator names Signed-off-by: Mikita Iwanowski <[email protected]>
Signed-off-by: Mikita Iwanowski <[email protected]>
0da7b72
to
5f79a22
Compare
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.
All right thanks for the answers, let's merge this :)
Description
When using Tetragon as a Helm dependency, all resources are named after the release name, causing:
Solution
Added
tetragon.nameOverride
andtetragonOperator.nameOverride
fields to allow explicit control over resource naming independent of the Helm release name.Benefits:
Example usage:
This maintains backward compatibility (defaults to release name when empty) while solving the dependency naming pain point.
Changelog
nameOverride
to tetragon and tetragonOperator Helm values.