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

fix(argo-cd): Avoid invalid labels when image tags have digest #1427

Closed
wants to merge 1 commit into from

Conversation

sathieu
Copy link
Contributor

@sathieu sathieu commented Aug 26, 2022

This was missing from #1368
to fix #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])?'')]

Ref: https://gitlab.com/kubitus-project/kubitus-installer/-/jobs/2922927151#L1878

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.

@sathieu
Copy link
Contributor Author

sathieu commented Aug 26, 2022

Tested with:

$ helm template . \
>   --set global.image.tag=v2.4.4@sha256:9d78128c71e88daf7c6bb45c7c2d58ac293786fea6ae1c5725fe4052681950dc \
>   --set dex.image.tag=v2.33.0@sha256:62902bd3a7ce4a73ed44e28884bffec04bcaa4a07e31e043173bdce289717e80 \
>   --set redis.image.tag=7.0.4-alpine@sha256:7c9e7c305125c68354c4902ed09a3c6da96436a5a2929b73f29748d56cf8e3c3 \
>   | grep -F app.kubernetes.io/version
    app.kubernetes.io/version: "v2.4.4-sha256-9d78128c71e88daf7c6bb45c7c2d58ac293786fea6ae1c572"
        app.kubernetes.io/version: "v2.4.4-sha256-9d78128c71e88daf7c6bb45c7c2d58ac293786fea6ae1c572"
    app.kubernetes.io/version: "v2.4.4-sha256-9d78128c71e88daf7c6bb45c7c2d58ac293786fea6ae1c572"
        app.kubernetes.io/version: "v2.4.4-sha256-9d78128c71e88daf7c6bb45c7c2d58ac293786fea6ae1c572"
    app.kubernetes.io/version: "v2.4.4-sha256-9d78128c71e88daf7c6bb45c7c2d58ac293786fea6ae1c572"
        app.kubernetes.io/version: "v2.4.4-sha256-9d78128c71e88daf7c6bb45c7c2d58ac293786fea6ae1c572"
    app.kubernetes.io/version: "v2.4.4-sha256-9d78128c71e88daf7c6bb45c7c2d58ac293786fea6ae1c572"
        app.kubernetes.io/version: "v2.4.4-sha256-9d78128c71e88daf7c6bb45c7c2d58ac293786fea6ae1c572"
    app.kubernetes.io/version: "v2.33.0-sha256-62902bd3a7ce4a73ed44e28884bffec04bcaa4a07e31e043"
        app.kubernetes.io/version: "v2.33.0-sha256-62902bd3a7ce4a73ed44e28884bffec04bcaa4a07e31e043"
    app.kubernetes.io/version: "7.0.4-alpine-sha256-7c9e7c305125c68354c4902ed09a3c6da96436a5a29"
        app.kubernetes.io/version: "7.0.4-alpine-sha256-7c9e7c305125c68354c4902ed09a3c6da96436a5a29"
    app.kubernetes.io/version: "v2.4.4-sha256-9d78128c71e88daf7c6bb45c7c2d58ac293786fea6ae1c572"
        app.kubernetes.io/version: "v2.4.4-sha256-9d78128c71e88daf7c6bb45c7c2d58ac293786fea6ae1c572"

@sathieu sathieu force-pushed the fix_invalid_version_label branch from 8b3bd14 to a83160a Compare August 26, 2022 09:38
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 sathieu force-pushed the fix_invalid_version_label branch from a83160a to c1e5e61 Compare August 26, 2022 09:41
@mkilchhofer
Copy link
Member

mkilchhofer commented Aug 26, 2022

What about dropping the version label completely @mbevc1, @jmeridth, @pdrastil, @yu-croco ?

Upstream manifests does not define the version label:

https://github.com/argoproj/argo-cd/blob/3d9e9f2f95b7801b90377ecfc4073e5f0f07205b/manifests/install.yaml#L9670-L9676

@yu-croco
Copy link
Collaborator

Aligning to upstream's way sounds good to me. 🙋

@sathieu
Copy link
Contributor Author

sathieu commented Aug 30, 2022

I've created another PR: #1432

@mbevc1
Copy link
Collaborator

mbevc1 commented Aug 30, 2022

Yup, let's try to keep it aligned with the upstream 👍

@mkilchhofer
Copy link
Member

Solved via #1432

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
4 participants