argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
17.9k stars 5.46k forks source link

`ARGOCD_APP_REVISION_SHORT` not resolving #17278

Closed seddarj closed 1 day ago

seddarj commented 8 months ago

Checklist:

Describe the bug

Setting $ARGOCD_APP_REVISION_SHORT as a helm parameter override in an Application doesn't seem to resolve properly. Setting the same parameter to $ARGOCD_APP_REVISION does correctly resolve.

To Reproduce

Expected behavior

We expect the $ARGOCD_APP_REVISION_SHORT environment variable to resolve in the same way $ARGOCD_APP_REVISION does as both are documented as part of the Build Environment.

Screenshots

When using $ARGOCD_APP_REVISION we see the following diff:

Screenshot 2024-02-22 at 12 14 17

But when using $ARGOCD_APP_REVISION_SHORT, there is no diff (as we have a default value in case that particular parameter is empty) but we should be seeing the first 7 characters of the commit ID in the above diff.

Version

{
    "Version": "v2.9.6+ba62a0a",
    "BuildDate": "2024-02-02T19:17:57Z",
    "GitCommit": "ba62a0a86d19f71a65ec2b510a39ea55497e1580",
    "GitTreeState": "clean",
    "GoVersion": "go1.21.3",
    "Compiler": "gc",
    "Platform": "linux/amd64",
    "KustomizeVersion": "v5.2.1 2023-10-19T20:13:51Z",
    "HelmVersion": "v3.13.2+g2a2fb3b",
    "KubectlVersion": "v0.24.17",
    "JsonnetVersion": "v0.20.0"
}

Logs

seddarj commented 8 months ago

We updated to 2.10.1 and we're seeing the same issue. Here's the version we're running now:

{
    "Version": "v2.10.1+a79e0ea",
    "BuildDate": "2024-02-14T17:37:43Z",
    "GitCommit": "a79e0eaca415461dc36615470cecc25d6d38cefb",
    "GitTreeState": "clean",
    "GoVersion": "go1.21.3",
    "Compiler": "gc",
    "Platform": "linux/amd64",
    "KustomizeVersion": "v5.2.1 2023-10-19T20:13:51Z",
    "HelmVersion": "v3.14.0+g3fc9f4b",
    "KubectlVersion": "v0.26.11",
    "JsonnetVersion": "v0.20.0"
}
ilia-medvedev-codefresh commented 2 months ago

@seddarj can you please provide an example with a public chart where it doesn't work for you? I tried to reproduce it and ARGOCD_APP_REVISION_SHORT was correctly resolved when set under helm.parameters

andrii-korotkov-verkada commented 1 day ago

ArgoCD versions 2.10 and below have reached EOL. Can you upgrade and let us know if the issue is still present, please?

seddarj commented 1 day ago

@andrii-korotkov-verkada @ilia-medvedev-codefresh Sorry for the delayed response. I can confirm that it's working as expected on Argo 2.12 over here. Thanks for looking into this 🙏