-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Fix: Sticking to DNS label standard in branch_slug (Gitlab PR Generators) #10622
Comments
I'd like to fix this, can this issue been assigend to me ? |
@Aym3nTN I pulled a request for this, I don't know is it ok. PTAL. |
Have you tested the case when 63 characters cuts a word in 2? |
I tested for it, it passed! |
Fixes: argoproj#10622 Signed-off-by: cleverhu <shouping.hu@daocloud.io>
Run a test with this branch name |
You mean that there will be a word divided into two at the end. I misunderstood your meaning, and this may not be fixed. |
@cleverhu I can take it from if you'd like, I might have a solution for it, alright? |
@Aym3nTN I think I'd like to avoid changing the
You could augment the ApplicationSet functions map with a wrapper for the slug function. You'd add the function here: argo-cd/applicationset/utils/utils.go Line 30 in 0a02a63
|
Of course. I may not be familiar with this area. Please deal with it. |
Hi there, I've noticed another issue with the
When trying to use
Also, in sticking with the original issue, I'm also trying to use that |
@whitelancer I think the best solution is to augment the ApplicationSet functions map with a parameterized wrapper for the slug function. |
@crenshaw-dev Is there anyway for us to do that, as the user of the app? Or is that only if Argo's codebase gets modified to fix/change this? |
This will require a feature PR. Basically, just like we added a argo-cd/applicationset/utils/utils.go Line 30 in 0a02a63
|
I have just created a PR for this #15188 , please have a look at it and let me know |
Summary
When using the "Build" job from Gitlab auto-devops, the image name includes the slugified version of the branch ( using this variable
CI_COMMIT_REF_SLUG
) which is limited to 63 characters. So when trying to use thebranch_slug
key to building the path of the image, Argo won't find it because in my old PR #9462 I hardcoded the slug max length to 50.Motivation
Same motivation as #9462
In order to follow the DNS label standard as defined in RFC 1123, manifests' name metadata should not exceed 63 and must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character.
Docs: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-label-names
Proposal
This time after falling into the limit trap, I suggest sticking to DN label standard and keep the limit as 63 characters.
The text was updated successfully, but these errors were encountered: