Skip to content

Conversation

@jrhoward
Copy link
Contributor

@jrhoward jrhoward commented Sep 23, 2025

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:

app:
  certmanager:
    additionalAnnotations:
      - name: some.cert-manager.io/custom-fields
        value: |
          [{ "Name": "field1", "Value": "value1" },{ "Name": "field2", "Value": "value2" }]
      - name: another.cert-manager.io/custom-field2
        value: "a value"

jrhoward and others added 4 commits April 25, 2025 08:24
removed example as it is auto generated anyway

Signed-off-by: jrhoward <[email protected]>
added additional set of quotes to annotations in cli args

Signed-off-by: jrhoward <[email protected]>
@cert-manager-prow cert-manager-prow bot added the dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. label Sep 23, 2025
@cert-manager-prow
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign jakexks for approval. For more information see the Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@cert-manager-prow cert-manager-prow bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 23, 2025
@cert-manager-prow
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@cert-manager-prow cert-manager-prow bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Sep 23, 2025
@cert-manager-prow cert-manager-prow bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 24, 2025
@erikgb erikgb requested a review from Copilot October 2, 2025 15:19
@erikgb
Copy link
Member

erikgb commented Oct 2, 2025

/ok-to-test

@cert-manager-prow cert-manager-prow bot added ok-to-test and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 2, 2025
Copy link
Contributor

Copilot AI left a 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 -}}
Copy link

Copilot AI Oct 2, 2025

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:

Suggested change
- {{ printf "\"%s=%s\"" "--certificate-request-additional-annotations" ( join "," $annotations ) | quote -}}
- --certificate-request-additional-annotations="{{ join "," $annotations }}"

Copilot uses AI. Check for mistakes.
{{ $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 -}}
Copy link

Copilot AI Oct 2, 2025

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 -}}
Suggested change
- {{ printf "\"%s=%s\"" "--istiod-cert-additional-annotations" ( join "," $annotationList ) | quote -}}
- {{ printf "%s=%s" "--istiod-cert-additional-annotations" ( join "," $annotationList ) | quote -}}

Copilot uses AI. Check for mistakes.
@cert-manager-prow
Copy link
Contributor

@jrhoward: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cert-manager-istio-csr-istio-v1-20 bd99e0e link true /test pull-cert-manager-istio-csr-istio-v1-20
pull-cert-manager-istio-csr-istio-v1-21 bd99e0e link true /test pull-cert-manager-istio-csr-istio-v1-21
pull-cert-manager-istio-csr-istio-v1-22 bd99e0e link true /test pull-cert-manager-istio-csr-istio-v1-22
pull-cert-manager-istio-csr-istio-ambient bd99e0e link true /test pull-cert-manager-istio-csr-istio-ambient
pull-cert-manager-istio-csr-istio-v1-23 bd99e0e link true /test pull-cert-manager-istio-csr-istio-v1-23
pull-cert-manager-istio-csr-istio-v1-24 bd99e0e link true /test pull-cert-manager-istio-csr-istio-v1-24
pull-cert-manager-istio-csr-istio-v1-27 bd99e0e link true /test pull-cert-manager-istio-csr-istio-v1-27
pull-cert-manager-istio-csr-istio-v1-26 bd99e0e link true /test pull-cert-manager-istio-csr-istio-v1-26
pull-cert-manager-istio-csr-istio-v1-28 bd99e0e link true /test pull-cert-manager-istio-csr-istio-v1-28

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. ok-to-test size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants