-
Notifications
You must be signed in to change notification settings - Fork 275
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
Helm: sanitize resource name lengths #3250
base: main
Are you sure you want to change the base?
Helm: sanitize resource name lengths #3250
Conversation
The committers listed above are authorized under a signed CLA. |
Welcome @mruoss! |
Hi @mruoss. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
✅ Deploy Preview for kubernetes-sigs-kueue ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
LGTM, but I would prefer to also give it a pass by @mbobrovskyi or @tenzen-y
/ok-to-test |
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.
Thank you!
/lgtm
/approve
LGTM label has been added. Git tree hash: 349bf9f82635964031b89b1094f32c5883f92094
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mruoss, tenzen-y The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold I tried to test with "project-foo-cluster-bar-kueue-controller-manager-metrics-service" and it's not working.
|
+1 on e2e tests, feel free to open the issue and follow up. I guess they could have a dedicated run like mk, but we can discuss details later. We often have issues with helm which are hard to see just by static code analysis. Thanks for checking. |
Yeah okay, if the release name itself is longer than 63 chars, all resources are named the same (first 63 chars of the release name). I haven't seen any chart accounting for that, though. But one could change the order (start with the specific resource name and suffix it with the release name). Or obviously: truncate the release name to a max length instead of the resulting resource name...
Agreed. Especially these bulk search-and-replace fixes don't come without risks... Chart tests would however already be a start. |
We already do that: kueue/charts/kueue/templates/_helpers.tpl Lines 8 to 24 in 9332a5a
|
I see. But it should be truncated to a length that is |
Can we calculate |
I don't think you can do that globally in |
We can probably calculate it in |
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.
I'm not convinced that we should be doing this.
For one, it's a lot more (and repetitive) code to maintain. Maybe you can submit a PR to helm to support a method called resource-name-sanitize
(or something along those lines) that can be used in templates.
Second, a user might still come and put invalid characters in their value.yaml
file and not be able to install Kueue.
So I would categorize this as user-error unless helm provides some better mechanism to prevent this issues.
- '{{ printf "%s-webhook-service.%s.svc" (include "kueue.fullname" .) .Release.Namespace | trunc 63 | trimSuffix "-" }}' | ||
- '{{ printf "%s-webhook-service.%s.svc.%s" (include "kueue.fullname" .) .Release.Namespace .Values.kubernetesClusterDomain | 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.
would this actually work?
Doesn't it always have to finish in .svc
or .svc.{ClusterDomain}
?
Do we need to worry about length for dns names?
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
@mruoss: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
This PR addresses a but in the Helm chart. Some of the resources generated by the Helm chart are very long. Combined with the release name, they can easily get too long.
Example
Let's look at the resource
{{ include "kueue.fullname" . }}-controller-manager-metrics-service
ofkind: Service
. When generated for a somewhat long release name likeproject-foo-cluster-bar-kueue
, the resulting resource name isproject-foo-cluster-bar-kueue-controller-manager-metrics-service
which is 65 characters long and we get the following error when trying to apply/install:Which issue(s) this PR fixes:
Special notes for your reviewer:
Does this PR introduce a user-facing change?
NONE (it only affects names for resources that would have been too long and therefore failed anyway. Existing resources remain unchanged)