fix(tektonresult): default route TLS termination to reencrypt - #4029
fix(tektonresult): default route TLS termination to reencrypt#4029divyansh42 wants to merge 1 commit into
Conversation
a1fc393 to
9146282
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4029 +/- ##
==========================================
+ Coverage 27.64% 27.71% +0.06%
==========================================
Files 477 477
Lines 25458 25485 +27
==========================================
+ Hits 7039 7062 +23
- Misses 17696 17699 +3
- Partials 723 724 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 Changes recommended
Existing installations are not migrated, TektonConfig bypasses the new validation, and stale test expectations will fail.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Updates OpenShift Results routes to use re-encrypt TLS and validates supported termination modes.
Changes:
- Defaults route TLS termination to
reencrypt. - Updates route manifests and RBAC resource names.
- Adds validation and tests for TLS termination values.
File summaries
| File | Description |
|---|---|
pkg/reconciler/openshift/tektonresult/testdata/static/tekton-results/route-rbac/rbac.yaml |
Updates test route and RBAC. |
pkg/reconciler/openshift/tektonresult/extension_test.go |
Tests re-encrypt route injection. |
pkg/apis/operator/v1alpha1/tektonresult_validation.go |
Validates termination modes. |
pkg/apis/operator/v1alpha1/tektonresult_validation_test.go |
Tests termination validation. |
pkg/apis/operator/v1alpha1/tektonresult_defaults.go |
Changes the default to re-encrypt. |
pkg/apis/operator/v1alpha1/tektonresult_defaults_test.go |
Updates the primary default assertion. |
cmd/openshift/operator/kodata/static/tekton-results/route-rbac/rbac.yaml |
Updates deployed route and RBAC. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 3
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Addressed the Copilot review comments in the follow-up commit (06d301f):
|
There was a problem hiding this comment.
🔵 Needs a closer look
The release note overstates external certificate trust, which still depends on the cluster ingress certificate configuration.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
cmd/openshift/operator/kodata/static/tekton-results/route-rbac/rbac.yaml:61
- The PR states that this eliminates
--insecure-skip-tls-verify, butreencryptonly changes router-to-backend encryption; this Route still presents the cluster ingress certificate. A default OpenShift ingress certificate is internally signed and may remain untrusted by external clients. Please qualify the description/release note so this benefit is conditional on clients trusting the ingress CA (or on a trusted custom ingress certificate being configured).
- Files reviewed: 9/9 changed files
- Comments generated: 0 new
- Review effort level: Balanced
|
Don't we also need to handle the upgrade scenario (updating TLS termination |
|
@divyansh42 can you adress @pratap0007 concerns? what happens on upgrade, please post a proof of work |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: enarha The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@divyansh42 can we deprecate passthroug ? |
06d301f to
3f31f8f
Compare
I have handled the upgrade but still need to test end to end. Will update once done. |
|
/hold |
There was a problem hiding this comment.
🟡 Changes recommended
The non-OpenShift test is environment-dependent, and the TLS documentation incorrectly associates --insecure with the edge failure.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 14/14 changed files
- Comments generated: 4
- Review effort level: Balanced
3f31f8f to
97feb9d
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The documentation inaccurately characterizes external certificate trust and recommends --insecure as mandatory for passthrough.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 14/14 changed files
- Comments generated: 2
- Review effort level: Balanced
The Results API route was defaulting to `edge` TLS termination which causes TLS handshake failures: the router terminates TLS and forwards unencrypted traffic to the gRPC backend, which only speaks TLS. `reencrypt` is the correct mode: the router presents a trusted cert to external clients while re-encrypting to the backend (which has an OpenShift service-serving cert). This eliminates the need for `--insecure-skip-tls-verify` when using `opc results`. Changes: - Default `route_tls_termination` changed from `edge` to `reencrypt` - Route YAML updated from `passthrough` to `reencrypt` - Fix RBAC `resourceNames` from `tekton-results-api-service` to `tekton-results-api` to match the actual Route resource name - Add validation: only `edge`, `reencrypt`, `passthrough` are accepted, shared between TektonResult.Validate and TektonConfig.Validate Existing installs persist the previous `edge` default, so add a version-gated pre-upgrade migration that updates the Results route TLS termination from `edge` to `reencrypt` on TektonConfig (the source of truth), which then syncs to the TektonResult CR. Only `edge` is migrated; values set manually to `reencrypt` or `passthrough` are left untouched. Also document that only `reencrypt` is supported on OpenShift. Signed-off-by: divyansh42 <diagrawa@redhat.com> Assisted-by: Claude Opus 4.8 (via Claude Code) Assisted-by: Claude Sonnet 4.6 (via Cursor) Co-authored-by: Cursor <cursoragent@cursor.com>
97feb9d to
6b2e6f0
Compare
Changes
The Results API route on OpenShift was defaulting to
edgeTLS termination,which causes TLS handshake failures when clients try to connect. The router
terminates TLS at the edge and forwards unencrypted traffic to the gRPC
backend — but the backend only speaks TLS.
Additionally, when
passthroughwas used as a workaround, clients had topass
--insecure-skip-tls-verifybecause the OpenShift service-servingcertificate was not trusted by external clients.
reencryptis the correct termination type:--insecureneeded)Upgrade migration
Changing the default only affects new installs — existing installs persist
the previous
edgevalue in theirTektonConfig/TektonResultCR, so theywould stay broken after upgrading. A version-gated pre-upgrade migration
(
migrateResultsRouteTLSToReencrypt) updates the Results route TLS terminationfrom
edge→reencryptonTektonConfig(the source of truth), which thensyncs to the
TektonResultCR. It runs on OpenShift only and migrates onlyedge; values set manually toreencryptorpassthroughare left untouched.Changes made
tektonresult_defaults.goroute_tls_terminationchanged fromedge→reencryptroute-rbac/rbac.yaml(kodata)passthrough→reencryptroute-rbac/rbac.yaml(testdata)resourceNamesfixed:tekton-results-api-service→tekton-results-api(matches actual Route name)tektonresult_validation.govalidateRouteTLSTermination; onlyedge,reencrypt,passthroughacceptedtektonconfig_validation.gospec.result.route_tls_terminationat the parent CR level tooupgrade.go/pre_upgrade.goedge→reencryptdocs/TektonResult.md,docs/TektonConfig.mdreencryptis supported on OpenShift; note the upgrade migration*_test.goTektonResult/TektonConfigvalidation, route injection, and the migrationSubmitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
make test lintbefore submitting a PRSee the contribution guide for more details.
Release Notes