Skip to content

fix: sanitize wildcard hostnames in certificate resource ID for ACM tags#4846

Open
Dasmat13 wants to merge 1 commit into
kubernetes-sigs:mainfrom
Dasmat13:fix/acm-wildcard-tagging
Open

fix: sanitize wildcard hostnames in certificate resource ID for ACM tags#4846
Dasmat13 wants to merge 1 commit into
kubernetes-sigs:mainfrom
Dasmat13:fix/acm-wildcard-tagging

Conversation

@Dasmat13

Copy link
Copy Markdown

Description

This pull request resolves a bug where ACM certificate requests fail for Ingresses with wildcard hostnames due to invalid character restrictions in AWS tag values (#4836).

The certificate resourceID embeds the DomainName and is used as the ingress.k8s.aws/resource tracking tag value. However, AWS ACM API validation rejects * in tag values ([\p{L}\p{Z}\p{N}_.:/=+\-@]*), causing RequestCertificate calls to fail with a 400 ValidationException for wildcard host configurations.

This change sanitizes the resourceID by replacing the * character with "wildcard" in buildCertificateResourceID(). The actual DomainName and SubjectAlternativeNames sent to ACM remain unchanged, ensuring certificate coverage is unaffected while preventing the validation failure.

Testing

  • Added unit tests covering all wildcard/non-wildcard/multi-wildcard cases for buildCertificateResourceID().
  • Added an E2E test case in test/e2e/ingress/acm_ingress_test.go exercising wildcard-host Ingress certificate validation.
  • All unit tests (go test ./pkg/...) pass successfully.

@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

The full list of commands accepted by this bot can be found here.

Details 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

@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 18, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

Hi @Dasmat13. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

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.

Details

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.

@kubernetes-prow kubernetes-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 18, 2026
@Dasmat13
Dasmat13 marked this pull request as draft July 18, 2026 10:44
@kubernetes-prow kubernetes-prow Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 18, 2026
@Dasmat13
Dasmat13 marked this pull request as ready for review July 21, 2026 17:23
@kubernetes-prow kubernetes-prow Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 21, 2026
@kubernetes-prow
kubernetes-prow Bot requested a review from oliviassss July 21, 2026 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant