Skip to content

Prevent duplicate hosts in Ingress rules when using ACME#16312

Merged
knative-prow[bot] merged 1 commit intoknative:mainfrom
linkvt:prevent-duplicate-hosts-in-ingress-rules
Jan 19, 2026
Merged

Prevent duplicate hosts in Ingress rules when using ACME#16312
knative-prow[bot] merged 1 commit intoknative:mainfrom
linkvt:prevent-duplicate-hosts-in-ingress-rules

Conversation

@linkvt
Copy link
Copy Markdown
Contributor

@linkvt linkvt commented Dec 17, 2025

The basic idea is that we don't create ingress rules with multiple hosts for external visibility, as we need to be able merge ACME rules into these hosts.
I don't really like that though as it puts the knowledge of exactly 1 host per external rule in two places (rule creation and ACME rule merging).

Another alternative would be that we accept the incorrect rule merging with multiple hosts that we had before:

rules:
  - hosts: a, b
    paths:
      - acme-of-a
      - acme-of-b

This would result in 4 possible routes in the Ingress:

  • host a with path acme-of-a - correct
  • host b with path acme-of-a - wrong
  • host a with path acme-of-b - wrong
  • host b with path acme-of-b - correct

This won't be a problem in practice though as the ACME server would not try to do a request to host a with path acme-of-b.
This would be a simple loop over existing rules, check if it contains a matching host and merge it inside there (while still preventing double duplicate rules that we had before #16259 )

Let me know what you think of this approach in general.

/cc @dprotaso

Proposed Changes

Release Note


@knative-prow knative-prow Bot requested a review from dprotaso December 17, 2025 11:10
@knative-prow knative-prow Bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 17, 2025
@linkvt linkvt force-pushed the prevent-duplicate-hosts-in-ingress-rules branch from 343a4c7 to b08bcab Compare December 17, 2025 11:29
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.76%. Comparing base (1e52818) to head (b08bcab).
⚠️ Report is 31 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16312      +/-   ##
==========================================
+ Coverage   80.07%   80.76%   +0.68%     
==========================================
  Files         215      216       +1     
  Lines       13361    13901     +540     
==========================================
+ Hits        10699    11227     +528     
- Misses       2304     2305       +1     
- Partials      358      369      +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@linkvt
Copy link
Copy Markdown
Contributor Author

linkvt commented Jan 15, 2026

/retest

1 similar comment
@linkvt
Copy link
Copy Markdown
Contributor Author

linkvt commented Jan 18, 2026

/retest

@dprotaso
Copy link
Copy Markdown
Member

Unfortunately e2e github actions have a build => run test stage and in between those stages it uploads/downloads build artifacts.

After a certain time the build artifacts will be purged from the cache so it requires a full re-run all the tests. I'm not sure how to do that with prow. I'll open an issue in k8s/prow repo

@dprotaso
Copy link
Copy Markdown
Member

For now I'll re-trigger the entire github action build to re-run all jobs

@dprotaso
Copy link
Copy Markdown
Member

weird - i don't see a re-run button in the GitHub UI for some reason. I'm going to close and re-open the PR

@dprotaso dprotaso closed this Jan 18, 2026
@dprotaso dprotaso reopened this Jan 18, 2026
@knative-prow
Copy link
Copy Markdown

knative-prow Bot commented Jan 18, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: linkvt

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

The pull request process is described 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

@knative-prow knative-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 18, 2026
@dprotaso
Copy link
Copy Markdown
Member

This diff seems pretty straightforward - I'd be open to merging this and we stick to having all related rules under a single domain.

@dprotaso
Copy link
Copy Markdown
Member

/lgtm

feel free to drop the [wip]

@knative-prow knative-prow Bot added the lgtm Indicates that a PR is ready to be merged. label Jan 18, 2026
@linkvt linkvt changed the title [wip] Prevent duplicate hosts in Ingress rules when using ACME Prevent duplicate hosts in Ingress rules when using ACME Jan 19, 2026
@knative-prow knative-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 Jan 19, 2026
@linkvt
Copy link
Copy Markdown
Contributor Author

linkvt commented Jan 19, 2026

Nice, thank you for the review!

@knative-prow knative-prow Bot merged commit 05daab6 into knative:main Jan 19, 2026
230 of 236 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. 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.

2 participants