argoproj / argo-cd

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

The ArgoCD v2.12.0 doesn't work with tag tracking #19495

Closed jackalbsd closed 1 week ago

jackalbsd commented 1 month ago

Hello.

Checklist:

Describe the bug

Unfortunately, after we did upgrade from version v2.8.3 to v.2.12.0 the tag tracking doesn't work anymore.

To Reproduce

This configuration doesn't work anymore

    - repoURL: https://github.com/org/repo
      path: .
      targetRevision: "0.41.36" 

Expected behavior

The Sync status is expected to be - Sync OK

Version

{
  "app.kubernetes.io/component": "server",
  "app.kubernetes.io/instance": "argocd",
  "app.kubernetes.io/managed-by": "Helm",
  "app.kubernetes.io/name": "argocd-server",
  "app.kubernetes.io/part-of": "argocd",
  "app.kubernetes.io/version": "v2.12.0",
  "helm.sh/chart": "argo-cd-7.4.1",
  "pod-template-hash": "75d8977c45"
}

Logs

{"error":"error parsing version for tag: Version segment starts with 0","grpc.code":"Unknown","grpc.method":"GenerateManifest","grpc.service":"repository.RepoServerService","grpc.start_time":"2024-08-12T13:03:37Z","grpc.time_ms":613.995,"level":"error","msg":"finished unary call with code Unknown","span.kind":"server","system":"grpc","time":"2024-08-12T13:03:37Z"}

Thank you for the help

jackalbsd commented 1 month ago

I would like to share a small update from my side.

If you use commit hash there will be no issue. 2024-08-13 09 03 57

ChristianCiach commented 1 month ago

The only relevant code change between v2.8.3 and v2.12.0 seems to be:

But it's still strange, because the added unit tests explicitly test versions with a starting zero.

jackalbsd commented 1 month ago

Yes, I found this PR when I tried to find something that could help me to solve this issue.

I am going to do some tests. I will post updates here.

migueleliasweb commented 4 weeks ago

I'm hitting something similar where my app in Argo defined in a central repo but points to another repo for its source. The tag is being tracked correctly but the UI links the tag anchor to the "parent" repo instead of the repo of the app itself.

Argo's functionality itself isn't broken (afaik) but the UI points to the wrong location when clicking on the tag link.

Running ArgoCD v2.12.0+ec30a48.

Ps: before the v2.12 upgrade, the link shown was the correct one pointing to the app's repository and not the central repo where the app itself is defined.

jackalbsd commented 3 weeks ago

Hello. I checked the version v.2.11.7

{
    "Version": "v2.11.7+e4a0246",
    "BuildDate": "2024-07-24T09:33:49Z",
    "GitCommit": "e4a0246c4d920bc1e5ee5f9048a99eca7e1d53cb",
    "GitTreeState": "clean",
    "GoVersion": "go1.21.10",
    "Compiler": "gc",
    "Platform": "linux/amd64",
    "KustomizeVersion": "v5.2.1 2023-10-19T20:13:51Z",
    "HelmVersion": "v3.14.4+g81c902a",
    "KubectlVersion": "v0.26.11",
    "JsonnetVersion": "v0.20.0"
}

and it works

Screenshot 2024-08-19 at 16 48 35
jackalbsd commented 3 weeks ago

And I just tried v2.12.0-rc5 it doesn't work with tags

{
    "Version": "v2.12.0-rc5+6f2ae0d",
    "BuildDate": "2024-08-01T23:28:03Z",
    "GitCommit": "6f2ae0dd4613ef3db43e5e7a505b8fa164685c40",
    "GitTreeState": "clean",
    "GoVersion": "go1.22.4",
    "Compiler": "gc",
    "Platform": "linux/amd64",
    "KustomizeVersion": "v5.4.2 2024-05-22T15:19:38Z",
    "HelmVersion": "v3.15.2+g1a500d5",
    "KubectlVersion": "v0.29.6",
    "JsonnetVersion": "v0.20.0"
}
Screenshot 2024-08-19 at 17 33 36

with the same error

{"error":"error parsing version for tag: Version segment starts with 0","grpc.code":"Unknown","grpc.method":"GenerateManifest","grpc.service":"repository.RepoServerService","grpc.start_time":"2024-08-12T13:03:37Z","grpc.time_ms":613.995,"level":"error","msg":"finished unary call with code Unknown","span.kind":"server","system":"grpc","time":"2024-08-12T13:03:37Z"}

migueleliasweb commented 3 weeks ago

Thanks for testing v2.11.7 @jackalbsd.

From the comment of @ChristianCiach , our issue seems related to users with certain semver tags. My revision has the format v1.23-build-123+env-name.

I'll try to isolate that code and test to check if there are cases where certain revisions end up breaking something.

jackalbsd commented 3 weeks ago

I just made an another test If I use a tag like this test-argo-tag it also works thus, in case tag starts from a number/digit it will fail

{
    "Version": "v2.12.0-rc5+6f2ae0d",
    "BuildDate": "2024-08-01T23:28:03Z",
    "GitCommit": "6f2ae0dd4613ef3db43e5e7a505b8fa164685c40",
    "GitTreeState": "clean",
    "GoVersion": "go1.22.4",
    "Compiler": "gc",
    "Platform": "linux/amd64",
    "KustomizeVersion": "v5.4.2 2024-05-22T15:19:38Z",
    "HelmVersion": "v3.15.2+g1a500d5",
    "KubectlVersion": "v0.29.6",
    "JsonnetVersion": "v0.20.0"
}
Screenshot 2024-08-20 at 16 32 55