-
Notifications
You must be signed in to change notification settings - Fork 2k
fix(argo-cd): do not use hardcoded commit server URL #3367
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): do not use hardcoded commit server URL #3367
Conversation
3bd9bfe
to
4b19374
Compare
This commit adds the required template logic to the Argo CD Helm chart to use the proper, release name dependent URL for the commit server. The current implementation uses the default hardcoded URL `argocd-commit-server:8086` from <https://github.com/argoproj/argo-cd/blob/v3.0.9/common/common.go#L31>. Signed-off-by: Alexej Disterhoft <alexej.disterhoft@redcare-pharmacy.com>
Signed-off-by: Alexej Disterhoft <alexej.disterhoft@redcare-pharmacy.com>
Signed-off-by: Alexej Disterhoft <alexej.disterhoft@redcare-pharmacy.com>
284ef73
to
5a969c8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Addresses the hardcoded commit server URL by making the service port and port name configurable, propagating the dynamic address into presets and controller environments, and bumping the chart version.
- Introduce
commitServer.service.port
andportName
values invalues.yaml
- Update Service template to use those values, add env var in application-controller, and set the
commit.server
preset in helpers - Bump chart version to 8.1.2, update documentation and changelog
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
charts/argo-cd/values.yaml | Added commitServer.service.port and portName entries to replace the hardcoded port |
charts/argo-cd/templates/argocd-commit-server/service.yaml | Templatized Service port name and port values |
charts/argo-cd/templates/argocd-application-controller/statefulset.yaml | Inject ARGOCD_APPLICATION_CONTROLLER_COMMIT_SERVER via ConfigMap |
charts/argo-cd/templates/argocd-application-controller/deployment.yaml | Inject ARGOCD_APPLICATION_CONTROLLER_COMMIT_SERVER via ConfigMap |
charts/argo-cd/templates/_helpers.tpl | Set the commit.server preset dynamically based on service fullname and port |
charts/argo-cd/README.md | Documented the new commitServer.service.port and portName values |
charts/argo-cd/Chart.yaml | Bumped chart version to 8.1.2 and updated the changelog entry |
Comments suppressed due to low confidence (1)
charts/argo-cd/templates/argocd-commit-server/service.yaml:23
- Hardcoding the targetPort value to "server" breaks custom portName overrides. Use the templated portName (e.g.,
{{ .Values.commitServer.service.portName }}
) instead of a static string.
targetPort: server
- name: ARGOCD_APPLICATION_CONTROLLER_COMMIT_SERVER | ||
valueFrom: | ||
configMapKeyRef: | ||
name: argocd-cmd-params-cm | ||
key: commit.server | ||
optional: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though Argo CD itself has interface for this, ref, we follow upstream's manifests. Could you please refactor the upstream's manifest at first? Once upstream releases it, we will also follow it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, thanks for the heads up - I've raised a PR with the required changes upstream: argoproj/argo-cd#23536
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fyi: upstream changes have been merged
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think since the changes are already accepted upstream and it only added the env vars (no new Golang logic), we can already merge this even before upstream releases a new version.
LGTM and thanks @nobbs for your contribution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution!
* fix(argo-cd): do not use hardcoded commit server URL This commit adds the required template logic to the Argo CD Helm chart to use the proper, release name dependent URL for the commit server. The current implementation uses the default hardcoded URL `argocd-commit-server:8086` from <https://github.com/argoproj/argo-cd/blob/v3.0.9/common/common.go#L31>. Signed-off-by: Alexej Disterhoft <alexej.disterhoft@redcare-pharmacy.com> * chore(argo-cd): update version to 8.1.2 Signed-off-by: Alexej Disterhoft <alexej.disterhoft@redcare-pharmacy.com> * docs(argo-cd): add commit server service port and port name to README Signed-off-by: Alexej Disterhoft <alexej.disterhoft@redcare-pharmacy.com> --------- Signed-off-by: Alexej Disterhoft <alexej.disterhoft@redcare-pharmacy.com>
Checklist: