feat(tls): inject centrally managed TLS config into pipelines-as-code#3385
Conversation
|
/kind feature |
03034ff to
6894bb5
Compare
Evidence: TLS injection into PAC controller, watcher, and webhook + dynamic propagationThis comment extends the original evidence to cover the full PAC TLS scope:
And validates the automatic propagation flow end-to-end after a fix to the InstallerSet hash computation. 1. Baseline — APIServer: Intermediate (TLSv1.2)All three PAC deployments — TLS_MIN_VERSION=1.2, confirmed in both the InstallerSet manifests and the live Deployments: 2. Switch to Old profile (TLSv1.0)~20 seconds later, automatic propagation — no operator restart, no manual intervention: All three PAC deployments updated automatically: 3. Restore Intermediate — reverts automatically~20 seconds later: Summary table
Operator image: |
|
/kind feature |
|
@jkhelil - same comment as for PR#3383 and PR#3384 related to webhook env vars. Please consider updating the var names prefixed with WEBHOOK_ |
|
@jkhelil - Thank you for the update. The controller and watcher correctly have the env vars as Could you check the ci failure for e2e tests? |
| expectedHash, err := hash.Compute(struct { | ||
| Spec interface{} | ||
| PlatformDataHash string | ||
| }{ | ||
| Spec: comp.GetSpec(), | ||
| PlatformDataHash: comp.GetAnnotations()[v1alpha1.PlatformDataHashKey], | ||
| }) |
There was a problem hiding this comment.
Question: Why did we need to replace the usage of specHashInput here when it essentially does the same thing, with the key name being different (PlatformData -> PlatformDataHash)?
Same for other occurrences of hash calculation.
|
/retest |
2c8f2cd to
0041dde
Compare
|
/retest |
|
@jkhelil - NIT: Do we need the TLS vars injected to controller and watcher deployments? |
|
/lgtm |
… deployment and webhook Extend the OpenShift TLS centralization pattern to the Pipelines-as-Code webhook. The openshiftpipelinesascode extension now resolves the cluster-wide APIServer TLS security profile in PreReconcile and injects the resulting TLS_MIN_VERSION and TLS_CIPHER_SUITES environment variables into the pipelines-as-code-webhook deployment (pac-webhook container) via the Transformers step. PlatformDataHashKey propagation is wired through EnsureOpenShiftPipelinesAsCodeExists / createOPAC / updateOPAC so that any change to the cluster APIServer TLS profile automatically re-reconciles the OpenShiftPipelinesAsCode CR and redeploys the webhook with the updated settings. Resolves: SRVKP-9616 Made-with: Cursor
|
/retest |
|
/lgtm |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: anithapriyanatarajan, theakshaypant 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 |
Summary
Extends the OpenShift TLS centralization pattern to the pipelines-as-code-webhook deployment (SRVKP-9616), completing the webhook TLS trilogy alongside the Pipelines and Triggers PRs.
What changes
openshiftpipelinesascode/extension.go — switched to pointer receiver; added tektonConfigLister and resolvedTLSConfig fields. PreReconcile resolves the cluster APIServer TLS profile via ResolveCentralTLSToEnvVars. Transformers injects TLS_MIN_VERSION and TLS_CIPHER_SUITES into the pipelines-as-code-webhook deployment (pac-webhook container) when a profile is resolved.
pipelinesascode/pipelinesascode.go — EnsureOpenShiftPipelinesAsCodeExists, createOPAC, and updateOPAC now accept and propagate a platformData string parameter, stamped as the operator.tekton.dev/platform-data-hash annotation on the OpenShiftPipelinesAsCode CR. This triggers re-reconciliation when the APIServer TLS profile changes.
openshift/tektonconfig/extension.go — PostReconcile passes oe.GetPlatformData() (the APIServer TLS hash) into EnsureOpenShiftPipelinesAsCodeExists.
kubernetes/tektonconfig/extension.go — Kubernetes-side caller updated to pass "" (no platform data on Kubernetes).
extension_test.go (new) — 3 table-driven tests: no TLS config, injection into pac-webhook, no injection into unrelated deployments.
Evidence
Submitter 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