Skip to content

Integrate central TLS profile via controller-runtime-common - #83

Merged
openshift-merge-bot[bot] merged 5 commits into
medik8s:mainfrom
JonahSussman:JonahSussman/use-cluster-tls-profile
Aug 24, 2026
Merged

openshift-merge-bot[bot] merged 5 commits into
medik8s:mainfrom
JonahSussman:JonahSussman/use-cluster-tls-profile

Conversation

@JonahSussman

@JonahSussman JonahSussman commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Adds support for reading the cluster's centrally configured TLS profile from the APIServer CR and applying it to the metrics and webhook servers, enabling compliance with cluster-wide TLS policies. Follows the same pattern established in FAR PR #214.

What this PR does

  1. Fetches the TLS profile at startup using openshifttls.FetchAPIServerTLSProfile from controller-runtime-common. On non-OpenShift clusters, falls back to default TLS settings gracefully.

  2. Applies the TLS profile to metrics and webhook servers via openshifttls.NewTLSConfigFromProfile, which configures MinVersion and CipherSuites based on the cluster's TLS security profile (e.g. Old, Intermediate, Modern, or Custom).

  3. Watches for runtime TLS profile changes using openshifttls.SecurityProfileWatcher. If the admin changes the TLS profile on a running cluster, the manager restarts to pick up the new settings.

  4. Adds RBAC for get/list/watch on config.openshift.io/apiservers.

  5. Migrates webhook validator to typed generics (admission.Validator[*StorageBasedRemediationConfig]) as required by the new controller-runtime API.

  6. Sets tls-profiles OLM annotation to "true" in the Makefile bundle target to declare TLS profile support.

Dependency bumps

  • sigs.k8s.io/controller-runtime: v0.21.0 -> v0.24.1
  • k8s.io/api, k8s.io/apimachinery, k8s.io/client-go: v0.34.7 -> v0.36.2
  • github.com/openshift/api: updated to latest
  • github.com/openshift/controller-runtime-common: added (new dependency)

Other fixes

  • Fixed pre-existing go vet warning: non-constant format string passed to emitEventf (exposed by Go 1.26)

Testing

  • All unit tests pass (7 packages, including 57.1% coverage on controller)
  • Binary builds successfully
  • Bundle validates with operator-sdk bundle validate

Related

@openshift-ci

openshift-ci Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Hi @JonahSussman. Thanks for your PR.

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

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.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6f09d35d-003e-47ad-8ab5-43301fd73734


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@openshift-ci
openshift-ci Bot requested review from eemcmullan and razo7 July 30, 2026 18:55
Add support for reading the cluster's centrally configured TLS profile
from the APIServer CR and applying it to metrics and webhook servers.
On non-OpenShift clusters, falls back to default TLS settings gracefully.

Bump controller-runtime to v0.24.1 and k8s.io libraries to v0.36.2.
Migrate webhook validator to typed generics (admission.Validator[*T])
required by the new controller-runtime API.

Following the pattern established in FAR PR #214.

Signed-off-by: JonahSussman <sussmanjonah@gmail.com>
@JonahSussman
JonahSussman force-pushed the JonahSussman/use-cluster-tls-profile branch from db56c56 to 862c99e Compare July 30, 2026 19:10
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
Validation Failed: {"resource":"IssueComment","code":"custom","field":"body","message":"body is too long (maximum is 65536 characters)"} - https://docs.github.com/rest/issues/comments#update-an-issue-comment

The operator now supports centralized TLS profiles, so the
features.operators.openshift.io/tls-profiles annotation should
reflect that.

Signed-off-by: JonahSussman <sussmanjonah@gmail.com>
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
Validation Failed: {"resource":"IssueComment","code":"custom","field":"body","message":"body is too long (maximum is 65536 characters)"} - https://docs.github.com/rest/issues/comments#update-an-issue-comment

@weshayutin

Copy link
Copy Markdown
Contributor

/ok-to-test

@weshayutin

Copy link
Copy Markdown
Contributor

@pranavgaikwad please review

@pranavgaikwad pranavgaikwad left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

pranavgaikwad
pranavgaikwad previously approved these changes Aug 6, 2026

@pranavgaikwad pranavgaikwad left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

categories: OpenShift Optional
containerImage: quay.io/medik8s/storage-based-remediation-operator:latest
createdAt: ""
createdAt: "2026-07-30T19:35:27Z"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should be empty

Address review feedback on PR medik8s#83 (razo7): reset createdAt so the field
does not churn on bundle regeneration.

Signed-off-by: JonahSussman <sussmanjonah@gmail.com>
@openshift-ci openshift-ci Bot removed the lgtm label Aug 12, 2026
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Caution

CodeRabbit couldn't update its existing comment. The review summary may be out of date.

Error details
Validation Failed: {"resource":"IssueComment","code":"custom","field":"body","message":"body is too long (maximum is 65536 characters)"} - https://docs.github.com/rest/issues/comments#update-an-issue-comment

@JonahSussman

Copy link
Copy Markdown
Collaborator Author

/retest

@razo7

razo7 commented Aug 21, 2026

Copy link
Copy Markdown
Member

This PR uses controller-runtime-common v0.0.0-20260428152732-64ee174f5e2e, which doesn't include CurvePreferences/Groups support that was merged on 2026-08-13 and adds TLS groups/curve preferences (including PQC groups like X25519MLKEM768).

Please bump to v0.0.0-20260813135806-e1187ec555fc before merging. FAR PR#214 already includes this bump as a reference.

/hold

…in.go

Signed-off-by: JonahSussman <sussmanjonah@gmail.com>
Pick up openshift/controller-runtime-common#22 which adds TLS
groups/curve preferences (including PQC groups like X25519MLKEM768)
to the central TLS profile configuration.

Signed-off-by: JonahSussman <sussmanjonah@gmail.com>
@weshayutin

Copy link
Copy Markdown
Contributor

/override "ci/prow/4.22-tls-pqc-readiness"

@openshift-ci

openshift-ci Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

@weshayutin: Overrode contexts on behalf of weshayutin: ci/prow/4.22-tls-pqc-readiness

Details

In response to this:

/override "ci/prow/4.22-tls-pqc-readiness"

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.

@weshayutin

Copy link
Copy Markdown
Contributor

/override "ci/prow/4.23-tls-pqc-readiness"

@openshift-ci

openshift-ci Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

@weshayutin: Overrode contexts on behalf of weshayutin: ci/prow/4.23-tls-pqc-readiness

Details

In response to this:

/override "ci/prow/4.23-tls-pqc-readiness"

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.

weshayutin
weshayutin approved these changes Aug 21, 2026

@weshayutin weshayutin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see @razo7's comment

@openshift-ci openshift-ci Bot removed the lgtm label Aug 21, 2026
@weshayutin

Copy link
Copy Markdown
Contributor

ugh.. apologies.. too many tabs opened and I made comments in the wrong pr

@razo7

razo7 commented Aug 23, 2026

Copy link
Copy Markdown
Member

/retest

@razo7 razo7 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/unhold

@razo7

razo7 commented Aug 23, 2026

Copy link
Copy Markdown
Member

/retest

@weshayutin weshayutin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/LGTM

@openshift-ci

openshift-ci Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JonahSussman, pranavgaikwad, razo7, weshayutin

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:
  • OWNERS [JonahSussman,pranavgaikwad,razo7,weshayutin]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot
openshift-merge-bot Bot merged commit a6098b0 into medik8s:main Aug 24, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants