Skip to content

OLS-2459 propagate APIServer TLS profile to olsconfig#1604

Open
onmete wants to merge 1 commit into
openshift:mainfrom
onmete:OLS-2459-apiserver-tls-profile
Open

OLS-2459 propagate APIServer TLS profile to olsconfig#1604
onmete wants to merge 1 commit into
openshift:mainfrom
onmete:OLS-2459-apiserver-tls-profile

Conversation

@onmete
Copy link
Copy Markdown
Contributor

@onmete onmete commented May 7, 2026

Summary

  • When the OLSConfig CR does not specify a tlsSecurityProfile, the operator now reads the cluster-wide TLS profile from the APIServer CR (config.openshift.io/v1, name cluster) and writes it into the generated olsconfig.yaml. Falls back to Intermediate defaults if neither source has a profile.
  • Adds an APIServer watch to SetupWithManager with a predicate that only triggers reconciliation when Spec.TLSSecurityProfile changes on the cluster object. The existing ConfigMap hash annotation mechanism handles the pod restart.
  • Fixes a pre-existing Makefile typo where the ImageStream CRD copy was overwriting the APIServer CRD test fixture.

Companion to openshift/lightspeed-service#2921 (service-side Postgres TLS hardening).

Test plan

  • Existing appserver unit tests pass (106 specs, 79.2% coverage)
  • New test: should generate configmap with TLS profile from APIServer when CR has none — sets Modern profile on APIServer, leaves CR nil, asserts generated config uses Modern
  • All other test packages pass (controller, console, lcore, postgres, utils, watchers, tls)

Made with Cursor

@openshift-ci openshift-ci Bot requested review from raptorsun and xrajesh May 7, 2026 10:51
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 7, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign bparees 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

"minTLSVersion": Equal(string(configv1.TLSProfiles[configv1.TLSProfileModernType].MinTLSVersion)),
}))))

apiServer.Spec.TLSSecurityProfile = nil
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.

In case of failure above this may not run - may be we can use DeferCleanup func @onmete

When the OLSConfig CR does not specify a TLS security profile,
read it from the cluster APIServer CR instead of falling back
to hardcoded Intermediate defaults. Add an APIServer watch so
the reconciler picks up profile changes automatically.

Also fix a Makefile typo where the ImageStream CRD copy target
was overwriting the APIServer CRD file.

Co-authored-by: Cursor <cursoragent@cursor.com>
@onmete onmete force-pushed the OLS-2459-apiserver-tls-profile branch from 54a7e06 to d5f3cf5 Compare May 11, 2026 06:13
@onmete
Copy link
Copy Markdown
Contributor Author

onmete commented May 11, 2026

@xrajesh Good catch — moved the APIServer cleanup into DeferCleanup so it runs even if the assertions fail. Fixed in d5f3cf5.

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 11, 2026

@onmete: all tests passed!

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants