Skip to content
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

feat(argo-cd): Truncate version labels to 63 characters #1368

Merged
merged 1 commit into from
Jul 21, 2022

Conversation

sathieu
Copy link
Contributor

@sathieu sathieu commented Jul 12, 2022

Allow to use digests.
#417

Before this PR, a values.yaml like this:

argo-cd:
  global:
    image:
      repository:  "quay.io/argoproj/argocd"
      tag: "v2.4.4@sha256:9d78128c71e88daf7c6bb45c7c2d58ac293786fea6ae1c5725fe4052681950dc"

  dex:
    image:
      repository:  "ghcr.io/dexidp/dex"
      tag: "v2.32.0@sha256:85481bc46e04163ad0f2b6a003aef441ad324ffd48e78e5076c166b308c4f5fe"

  redis:
    image:
      repository:  "redis"
      tag: "7.0.2-alpine@sha256"

Fails with:

Error: Deployment.apps "argocd-redis" is invalid: [metadata.labels: Invalid value: "7.0.2-alpine@sha256": 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])?''), spec.template.labels: Invalid value: "7.0.2-alpine@sha256": 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])?'')]

Checklist:

  • I have bumped the chart version according to versioning
  • I have updated the documentation according to documentation
  • I have updated the chart changelog with all the changes that come with this pull request according to changelog.
  • Any new values are backwards compatible and/or have sensible default.
  • I have signed off all my commits as required by DCO.
  • My build is green (troubleshooting builds).

Changes are automatically published when merged to main. They are not published on branches.

@mkilchhofer
Copy link
Member

Not sure if we should implement only a workaround for the label issue or if we want to properly support digests like my proposal in the past:
#643

@sathieu sathieu force-pushed the truncate_version_label branch from b912109 to 50553e0 Compare July 12, 2022 13:37
@sathieu
Copy link
Contributor Author

sathieu commented Jul 12, 2022

@mkilchhofer I've seen PR #643, but I want to keep the version and the digest (i.e. I want image: quay.io/argoproj/argocd:v2.4.4@sha256:9d78128c71e88daf7c6bb45c7c2d58ac293786fea6ae1c5725fe4052681950dc and not image: quay.io/argoproj/argocd@sha256:9d78128c71e88daf7c6bb45c7c2d58ac293786fea6ae1c5725fe4052681950dc)

This is a common practice to use version@digest as tag value, and this is what works with helm create .

Inputs @arul-gupta @sarahhenkens ?

Allow to use digests.
argoproj#417

Signed-off-by: Mathieu Parent <mathieu.parent@insee.fr>
@sathieu sathieu force-pushed the truncate_version_label branch from 50553e0 to f6cf5b1 Compare July 21, 2022 09:30
@sathieu
Copy link
Contributor Author

sathieu commented Jul 21, 2022

@mkilchhofer I've rebased, please review again 🙏 .

Copy link
Member

@mkilchhofer mkilchhofer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mkilchhofer mkilchhofer merged commit 8f0914d into argoproj:main Jul 21, 2022
@sathieu sathieu deleted the truncate_version_label branch July 21, 2022 11:36
terrych0u pushed a commit to terrych0u/argo-helm that referenced this pull request Aug 4, 2022
Allow to use digests.
argoproj#417

Signed-off-by: Mathieu Parent <mathieu.parent@insee.fr>
sathieu added a commit to sathieu/argo-helm that referenced this pull request Aug 26, 2022
This was missing from argoproj#1368
to fix argoproj#417.

Fix the following validation error:

Error: failed to create resource: Deployment.apps
"argocd-applicationset-controller" is invalid: [metadata.labels: Invalid
value:
"v2.4.4@sha256:9d78128c71e88daf7c6bb45c7c2d58ac293786fea6ae1c572": 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])?''), spec.template.labels:
Invalid value:
"v2.4.4@sha256:9d78128c71e88daf7c6bb45c7c2d58ac293786fea6ae1c572": 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])?'')]

Signed-off-by: Mathieu Parent <mathieu.parent@insee.fr>
sathieu added a commit to sathieu/argo-helm that referenced this pull request Aug 30, 2022
Truncating (from argoproj#1368)
is not enough to fix argoproj#417.

Signed-off-by: Mathieu Parent <mathieu.parent@insee.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using image digest results in invalid label value in ArgoCD deployment templates
2 participants