CNTRLPLANE-2797: hypershift-operator webhooks port 9443 respect cluster TLS security profile#8078
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
Skipping CI for Draft Pull Request. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe PR moves discovery/capability detection earlier (using restConfig), adds a new capability constant CapabilityAPIServer, and extends DetectManagementClusterCapabilities to detect the config.openshift.io apiserver resource. When CapabilityAPIServer is present, the operator creates a typed config client, retrieves the APIServer "cluster" object, derives TLS min version and cipher suites via new helpers, and assigns those setters to webhook.Options.TLSOpts before constructing the webhook server. Errors from discovery, capability detection, config client creation, APIServer retrieval, or TLS option derivation are now returned. Sequence DiagramsequenceDiagram
participant Main as Operator Main
participant Rest as REST Config
participant Discovery as Discovery Client
participant Capabilities as Capability Detection
participant ConfigClient as Config Client
participant APIServer as APIServer Resource
participant Webhook as Webhook Server
Main->>Rest: use restConfig to create Discovery
Main->>Discovery: create discovery client
Main->>Capabilities: DetectManagementClusterCapabilities(discovery)
Capabilities->>Discovery: query config.openshift.io for apiservers
Discovery-->>Capabilities: resource present/absent
Capabilities-->>Main: return discovered capabilities
alt CapabilityAPIServer present
Main->>ConfigClient: create typed config client
Main->>APIServer: Get APIServer "cluster"
APIServer-->>Main: return Spec.TLSSecurityProfile
Main->>Main: SetMinTLSVersionUsingAPIServer()
Main->>Main: SetCipherSuitesUsingAPIServer()
Main->>Main: assign TLSOpts on webhook.Options
else CapabilityAPIServer absent
Main->>Main: leave webhook.Options TLSOpts unset
end
Main->>Webhook: NewServer(webhook.Options)
Webhook-->>Main: server initialized / error
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@ricardomaraschini: This pull request references CNTRLPLANE-2797 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
225cbcd to
8edfea9
Compare
|
@ricardomaraschini: This pull request references CNTRLPLANE-2797 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
Keeping this on hold for now. /hold |
8edfea9 to
2bcbf06
Compare
|
@ricardomaraschini: This pull request references CNTRLPLANE-2797 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
Pre-merge verified |
|
/verified by @gangwgr |
|
@gangwgr: This PR has been marked as verified by DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
/test e2e-aks |
|
Tests from second stage were triggered manually. Pipeline can be controlled only manually, until HEAD changes. Use command to trigger second stage. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bryan-cox, ricardomaraschini 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 |
|
/lgtm cancel |
Test Resultse2e-aks
|
|
/unhold |
|
/lgtm |
|
Tests from second stage were triggered manually. Pipeline can be controlled only manually, until HEAD changes. Use command to trigger second stage. |
Configure hypershift-operator webhook server to use TLS settings from the management cluster's APIServer configuration when available. - Detect CapabilityAPIServer to check for OpenShift APIServer config - Apply cluster TLS min version and cipher suites to webhook server - Gracefully skip on non-OpenShift clusters
2bcbf06 to
6aea3a7
Compare
|
@ricardomaraschini: This pull request references CNTRLPLANE-2797 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
/verified by @gangwgr |
|
@bryan-cox: This PR has been marked as verified by DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
/lgtm putting it back on from rebase |
|
Scheduling tests matching the |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #8078 +/- ##
==========================================
+ Coverage 26.86% 26.90% +0.03%
==========================================
Files 1090 1090
Lines 105285 105327 +42
==========================================
+ Hits 28281 28333 +52
+ Misses 74573 74561 -12
- Partials 2431 2433 +2
🚀 New features to boost your workflow:
|
|
/retest |
|
@ricardomaraschini: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. |
What this PR does / why we need it:
Configure hypershift-operator webhook server to use TLS settings from the management cluster's APIServer configuration when available.
Which issue(s) this PR fixes:
Fixes
Special notes for your reviewer:
Checklist:
Summary by CodeRabbit
New Features
Tests