-
Notifications
You must be signed in to change notification settings - Fork 5k
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
App names with non-alphanumeric characters in position 63 break syncs due to invalid label name #18237
Closed
3 tasks done
Labels
bug
Something isn't working
Comments
Merged
14 tasks
This seems to be a duplicate of #10110 |
Thanks for the catch - see my comment on #18256. |
todaywasawesome
pushed a commit
that referenced
this issue
May 22, 2024
…syncs (issue #18237) (#18256) * Ensure truncated app label does not end in a special character Signed-off-by: Zack Robinson <robinsoz@arcesium.com> * Move regex to global variable and add out of bounds check Signed-off-by: Zack Robinson <robinsoz@arcesium.com> * Add test for out-of-bounds check Signed-off-by: Zack Robinson <robinsoz@arcesium.com> --------- Signed-off-by: Zack Robinson <robinsoz@arcesium.com>
gcp-cherry-pick-bot bot
pushed a commit
that referenced
this issue
May 28, 2024
…syncs (issue #18237) (#18256) * Ensure truncated app label does not end in a special character Signed-off-by: Zack Robinson <robinsoz@arcesium.com> * Move regex to global variable and add out of bounds check Signed-off-by: Zack Robinson <robinsoz@arcesium.com> * Add test for out-of-bounds check Signed-off-by: Zack Robinson <robinsoz@arcesium.com> --------- Signed-off-by: Zack Robinson <robinsoz@arcesium.com>
pasha-codefresh
pushed a commit
that referenced
this issue
May 28, 2024
…syncs (issue #18237) (#18256) (#18439) * Ensure truncated app label does not end in a special character * Move regex to global variable and add out of bounds check * Add test for out-of-bounds check --------- Signed-off-by: Zack Robinson <robinsoz@arcesium.com> Co-authored-by: Zack Robinson <zkislakrobinson@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Checklist:
argocd version
.Describe the bug
When using
annotation+label
tracking method, app names with more than 63 characters are truncated to 63 characters. If the 63rd character is a hyphen, then the label value is invalid and the sync fails with the following error:Failed sync attempt to a3e64b7ba2ba8ddc3d5878bc6aa2e116d29e0a50: one or more objects failed to apply, reason: ConfigMap "test" is invalid: metadata.labels: Invalid value: "the-very-suspicious-name-with-precisely-sixty-three-characters-": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?') (retried 1 times).
I believe the issue is in this code:
argo-cd/util/argo/resource_tracking.go
Lines 156 to 158 in 2b89d6c
To Reproduce
application.resourceTrackingMethod: annotation+label
inargocd-cm
the-very-suspicious-name-with-precisely-sixty-three-characters-with-hyphen
, containing any resourcesExpected behavior
The application syncs normally.
Screenshots
Version
Logs
N/A
The text was updated successfully, but these errors were encountered: