argoproj / argo-cd

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

ApplicationSet PullRequest Generator Regex Mismatch error for webhook event #19150

Open hsalluri259 opened 4 months ago

hsalluri259 commented 4 months ago

Checklist:

Describe the bug I am using PullRequest generator for ApplicationSet with Github. I did setup webhook for applicationset via another ingress per the note mentioned in applicationset webhook configuration. My github host doesn't has a port, but the regex used in ArgoCD expects a colon followed by a port number as in :443. Without that, my webhook is not processed and PullRequest generator waits for time defined in requeueAfterSeconds parameter. The colon and port part of the regex after hostname should be optional and work without providing colon and port number.

My Github host: https://github.corp.redacted.com Regex expected github host: https://github.corp.redacted.com:443 To Reproduce

Expected behavior A refresh should happen in the application that is controlled by my applicationSet and show below message in logs

time="2024-07-22T18:12:20Z" level=info msg="refresh ApplicationSet kube-argocd/aws-ebs-csi-driver from webhook"

Screenshots

Version

argocd version
argocd: v2.10.7+b060053.dirty
  BuildDate: 2024-04-15T12:31:39Z
  GitCommit: b060053b099b4c81c1e635839a309c9c8c1863e9
  GitTreeState: dirty
  GoVersion: go1.22.2
  Compiler: gc
  Platform: darwin/arm64
argocd-server: v2.10.7+b060053

To fix the problem:

Logs

This is what I see when I don't use :443 for api parameter in pullRequest generator. This happens for all pull request events

time="2024-07-22T18:00:23Z" level=debug msg="https://github.corp.redacted.com does not match (?i)([http://|https://|\\w+@|ssh://(\\w+@)](about:blank)?)github.corp.redacted.com(:[0-9]+|)[:/]"

Once :443 is added to my github host and updated applicationset, I see the following in the logs.

time="2024-07-22T18:11:11Z" level=info msg="refresh ApplicationSet kube-argocd/aws-ebs-csi-driver from webhook"
time="2024-07-22T18:52:48Z" level=info msg="generated 1 applications" applicationset=kube-argocd/aws-ebs-csi-driver
andrii-korotkov-verkada commented 2 weeks ago

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