You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In PR generators, I noticed that when a branch name contains special characters or is too long to be used in a resource name (by using {{branch}}), the applicationset controller fails to create the resource throwing the below exception.
argocd-applicationset-controller-647f5948d6-bq7sn time="2022-05-20T08:58:18Z" level=error msg="failed to unchanged Application" action=unchanged app=nginx-github-feat/pr_special+character-2 appSet=test-app-set-github error="Application.argoproj.io \"nginx-github-feat/pr_special+character-2\" is invalid: metadata.name: Invalid value: \"nginx-github-feat/pr_special+character-2\": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')"
Motivation
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.
Summary
In PR generators, I noticed that when a branch name contains special characters or is too long to be used in a resource name (by using
{{branch}}
), the applicationset controller fails to create the resource throwing the below exception.argocd-applicationset-controller-647f5948d6-bq7sn time="2022-05-20T08:58:18Z" level=error msg="failed to unchanged Application" action=unchanged app=nginx-github-feat/pr_special+character-2 appSet=test-app-set-github error="Application.argoproj.io \"nginx-github-feat/pr_special+character-2\" is invalid: metadata.name: Invalid value: \"nginx-github-feat/pr_special+character-2\": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')"
Motivation
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
For that I suggest limiting and cleaning the 'branch' name to contain only 50 characters to give room to append/suffix-ing it with 13 more characters.
The text was updated successfully, but these errors were encountered: