Fix/chartadditional annotations for cli args#637
Fix/chartadditional annotations for cli args#637jrhoward wants to merge 5 commits intocert-manager:mainfrom
Conversation
…<jayhow@gmail.com> Signed-off-by: jrhoward <jrhowd@gmail.com>
removed example as it is auto generated anyway Signed-off-by: jrhoward <jayhow@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: jrhoward <jayhow@gmail.com>
added additional set of quotes to annotations in cli args Signed-off-by: jrhoward <jayhow@gmail.com>
|
[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. DetailsNeeds 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. DetailsInstructions 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 <jayhow@gmail.com>
|
/ok-to-test |
There was a problem hiding this comment.
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 -}} |
There was a problem hiding this comment.
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 }}" |
There was a problem hiding this comment.
the quotes need to be passed through as it is part of the json structure passed as a command line argument to the container. Copilot is wrong in this case
There was a problem hiding this comment.
the quotes need to be passed through as it is part of the json structure passed as a command line argument to the container. Copilot is wrong in this case
| {{ $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 -}} |
There was a problem hiding this comment.
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 -}} |
There was a problem hiding this comment.
the quotes need to be passed through as it is part of the json structure passed as a command line argument to the container. Copilot is wrong in this case
|
@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. DetailsInstructions 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: