-
Notifications
You must be signed in to change notification settings - Fork 77
Fix/chartadditional annotations for cli args #637
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
base: main
Are you sure you want to change the base?
Fix/chartadditional annotations for cli args #637
Conversation
…<[email protected]> Signed-off-by: jrhoward <[email protected]>
removed example as it is auto generated anyway Signed-off-by: jrhoward <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: jrhoward <[email protected]>
added additional set of quotes to annotations in cli args Signed-off-by: jrhoward <[email protected]>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Hi @jrhoward. Thanks for your PR. I'm waiting for a cert-manager member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Signed-off-by: jrhoward <[email protected]>
|
/ok-to-test |
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
Fix chart templating for passing cert-manager additionalAnnotations via CLI flags so values with commas are handled.
- Wraps certain flag strings in extra quotes within the template
- Applies the change to both certificate-request and istiod-cert annotation flags
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| {{- $annotations = append $annotations $x }} | ||
| {{- end }} | ||
| - {{ printf "%s=%s" "--certificate-request-additional-annotations" ( join "," $annotations ) | quote -}} | ||
| - {{ printf "\"%s=%s\"" "--certificate-request-additional-annotations" ( join "," $annotations ) | quote -}} |
Copilot
AI
Oct 2, 2025
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.
Adding inner quotes via printf ""%s=%s"" and then piping to quote will produce a literal argument that starts and ends with a double-quote, e.g. ""--certificate-request-additional-annotations=..."" in argv. Kubernetes does not invoke a shell for container args, so these quotes are not stripped and become part of the flag string, which can break flag parsing. If the intent is to quote only the value to preserve commas, quote the value portion instead of the entire flag, for example:
| - {{ printf "\"%s=%s\"" "--certificate-request-additional-annotations" ( join "," $annotations ) | quote -}} | |
| - --certificate-request-additional-annotations="{{ join "," $annotations }}" |
| {{ $annotationList = append $annotationList (printf "%s=%s" $annotation.name $annotation.value) }} | ||
| {{- end }} | ||
| - {{ printf "%s=%s" "--istiod-cert-additional-annotations" ( join "," $annotationList ) | quote -}} | ||
| - {{ printf "\"%s=%s\"" "--istiod-cert-additional-annotations" ( join "," $annotationList ) | quote -}} |
Copilot
AI
Oct 2, 2025
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.
Same double-quoting issue as above; this will pass a literal string beginning and ending with a quote to the process. Prefer quoting the value portion only, or revert if literal quotes are not required. For example:
- {{ printf "%s=%s" "--istiod-cert-additional-annotations" ( printf ""%s"" ( join "," $annotationList ) ) | quote -}}
| - {{ printf "\"%s=%s\"" "--istiod-cert-additional-annotations" ( join "," $annotationList ) | quote -}} | |
| - {{ printf "%s=%s" "--istiod-cert-additional-annotations" ( join "," $annotationList ) | quote -}} |
|
@jrhoward: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
this contains the fix for a bug introduced in pull request #537
It is now handling the cli args correctly.
Validated by following the following document
https://cert-manager.io/docs/usage/istio-csr/installation/
using the following helm values for annotations: