Skip to content

CNTRLPLANE-2012: Wire signer certs to read PKI config via SignerKeyParams#10595

Open
hasbro17 wants to merge 3 commits into
openshift:mainfrom
hasbro17:pki-3-signer-wiring
Open

CNTRLPLANE-2012: Wire signer certs to read PKI config via SignerKeyParams#10595
hasbro17 wants to merge 3 commits into
openshift:mainfrom
hasbro17:pki-3-signer-wiring

Conversation

@hasbro17

@hasbro17 hasbro17 commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Part 3 of splitting #10396 into smaller PRs. Depends on #10593 and #10594.

Wires all 11 signer certificates to read PKI configuration for configurable key algorithms

Problem

The challenge is that 6 of these signers previously had zero dependencies — adding InstallConfig as a dependency
would break agent-based installer (ABI) codepaths that generate signer certs without an install-config on disk (e.g. agent create certificates used by set-node-zero.sh, node-joiner add-nodes). It would
also pull in standard InstallConfig validation, rejecting configs that are valid under the agent flow's more lenient OptionalInstallConfig rules (e.g. vSphere without credentials).

Solution

To solve this, we introduce SignerKeyParams — a WritableAsset with zero dependencies that reads install-config.yaml directly from disk, extracts only the PKI and FeatureSet fields, and resolves the
effective PKI config via EffectiveSignerPKIConfig(). When no install-config is found, Load() returns (false, nil) so the asset store falls back to the state file between multi-step invocations (e.g.
create manifests followed by create cluster, where install-config.yaml is consumed after the first step). In the agent flow where neither file nor state exists, Generate() leaves PKIConfig nil
(RSA-2048).

6 previously zero-dep signers — now depend on SignerKeyParams:

  • AdminKubeConfigSignerCertKey
  • KubeAPIServerLocalhostSignerCertKey
  • KubeAPIServerLBSignerCertKey
  • RootCA
  • KubeletBootstrapCertSigner

5 signers that already depended on InstallConfig — now use EffectiveSignerPKIConfig() to resolve the effective PKI config including feature gate defaults:

  • KubeAPIServerToKubeletSignerCertKey
  • AggregatorCA
  • AggregatorSignerCertKey
  • KubeControlPlaneSignerCertKey
  • KubeletCSRSignerCertKey

With TechPreview enabled and no explicit pki config, all signer certs are generated with RSA-4096 (the current DefaultPKIProfile default). Without TechPreview, all certs remain RSA-2048.

PR chain

  1. CNTRLPLANE-2012: Add PKI config types, validation, and CR manifest generation #10593 — PKI types, validation, CRD, feature gate, PKI CR manifest
  2. CNTRLPLANE-2012: Refactor TLS cert generation to support configurable key algorithms #10594 — TLS engine refactoring
  3. This PR — Wire signer certs + SignerKeyParams
  4. Documentation

Summary by CodeRabbit

  • New Features

    • Feature-gated configurable PKI in install-config: choose RSA or ECDSA signer keys (key sizes/curves) and emit a PKI manifest when enabled.
  • Improvements

    • Generalized key/certificate generation to support RSA and ECDSA with algorithm-specific defaults and derived key usages.
    • Improved PEM encoding/decoding and error handling; signer assets and TLS generation honor PKI configuration.
  • Tests

    • Added extensive unit tests for PKI defaults, validation, PEM helpers, key generation, and cross-algorithm signing.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 3, 2026
@openshift-ci-robot

openshift-ci-robot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

@hasbro17: This pull request references CNTRLPLANE-2012 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 either version "5.0." or "openshift-5.0.", but it targets "openshift-4.22" instead.

Details

In response to this:

Summary

Part 3 of splitting #10396 into smaller PRs. Depends on #10593 and #10594.

Wires all 11 signer certificates to read PKI configuration for configurable key algorithms

Problem

The challenge is that 6 of these signers previously had zero dependencies — adding InstallConfig as a dependency
would break agent-based installer (ABI) codepaths that generate signer certs without an install-config on disk (e.g. agent create certificates used by set-node-zero.sh, node-joiner add-nodes). It would
also pull in standard InstallConfig validation, rejecting configs that are valid under the agent flow's more lenient OptionalInstallConfig rules (e.g. vSphere without credentials).

Solution

To solve this, we introduce SignerKeyParams — a WritableAsset with zero dependencies that reads install-config.yaml directly from disk, extracts only the PKI and FeatureSet fields, and resolves the
effective PKI config via EffectiveSignerPKIConfig(). When no install-config is present, it defaults to nil (RSA-2048).

6 previously zero-dep signers — now depend on SignerKeyParams:

  • AdminKubeConfigSignerCertKey
  • KubeAPIServerLocalhostSignerCertKey
  • KubeAPIServerLBSignerCertKey
  • RootCA
  • KubeletBootstrapCertSigner

5 signers that already depended on InstallConfig — now use EffectiveSignerPKIConfig() to resolve the effective PKI config including feature gate defaults:

  • KubeAPIServerToKubeletSignerCertKey
  • AggregatorCA
  • AggregatorSignerCertKey
  • KubeControlPlaneSignerCertKey
  • KubeletCSRSignerCertKey

With TechPreview enabled and no explicit pki config, all signer certs are generated with RSA-4096 (the current DefaultPKIProfile default). Without TechPreview, all certs remain RSA-2048.

PR chain

  1. CNTRLPLANE-2012: Add PKI config types, validation, and CR manifest generation #10593 — PKI types, validation, CRD, feature gate, PKI CR manifest
  2. CNTRLPLANE-2012: Refactor TLS cert generation to support configurable key algorithms #10594 — TLS engine refactoring
  3. This PR — Wire signer certs + SignerKeyParams
  4. Documentation

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.

@openshift-ci openshift-ci Bot requested review from bfournie and eranco74 June 3, 2026 20:12
@openshift-ci

openshift-ci Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

[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 jhixson74 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

@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown

Walkthrough

This PR adds configurable PKI to InstallConfig and CRD, implements PKI defaults/conversion and validation, generalizes TLS key/certificate generation for RSA/ECDSA, introduces a PKI manifest asset, wires PKI into certificate assets via SignerKeyParams, and adds tests covering defaults, validation, key generation, PEM utilities, and manifest output.

Changes

Configurable PKI Feature Implementation

Layer / File(s) Summary
CRD Schema and PKI Configuration Types
data/data/install.openshift.io_installconfigs.yaml, pkg/types/installconfig.go
Adds spec.pki block to CRD with signerCertificates.key supporting RSA/ECDSA algorithm selection. Introduces PKIConfig, CertificateConfig, KeyConfig (with algorithm discriminator), RSAKeyConfig/ECDSAKeyConfig, and KeyAlgorithm/ECDSACurve enums to InstallConfig type.
PKI defaults and conversion
pkg/types/pki/defaults.go, pkg/types/pki/conversion.go, pkg/types/pki/defaults_test.go, pkg/types/pki/conversion_test.go
Adds DefaultPKIProfile() and EffectiveSignerPKIConfig(), and CertificateConfigToUpstream() conversion helper with unit tests validating synthesized defaults and marshaling output.
PKI manifest asset & manifests wiring
pkg/asset/manifests/pki.go, pkg/asset/manifests/pki_test.go, pkg/asset/manifests/operators.go
Adds PKIConfiguration asset that emits cluster-pki-02-config.yaml when ConfigurablePKI is enabled and wires the asset into manifests generation; tests validate generated PKI CR content.
PKI validation & feature-gate integration
pkg/types/pki/validation.go, pkg/types/pki/validation_test.go, pkg/types/validation/featuregates.go, pkg/types/validation/installconfig.go, pkg/types/validation/installconfig_test.go, pkg/types/validation/featuregate_test.go
Implements ValidatePKIConfig and ValidateKeyConfig (RSA key-size and ECDSA curve checks), integrates gated validation for ConfigurablePKI, and adds tests covering valid/invalid configurations and feature-gate scenarios.
Generalized TLS core & utilities
pkg/asset/tls/tls.go, pkg/asset/tls/tls_test.go, pkg/asset/tls/utils.go, pkg/asset/tls/utils_test.go
Introduces PrivateKeyParams, PKIConfigToKeyParams(), GeneratePrivateKeyWithParams() with RSA/ECDSA implementations, generalizes certificate creation to accept crypto.Signer/crypto.PrivateKey, implements GenerateSelfSignedCertificate(cfg, params), and broadens PEM/parse utilities to support multiple key types with tests for generation, usages, and signature selection.
SignerKeyParams asset & certificate asset updates
pkg/asset/tls/signerkey_params.go, pkg/asset/tls/*
Implements SignerKeyParams asset that loads install-config.yaml to resolve effective signer PKIConfig. Updates RootCA and signer assets to depend on SignerKeyParams, remove hardcoded KeyUsages, thread PKIConfig into SelfSignedCertKey.Generate(), and improves private-key PEM/error handling.
Asset integrations, tests & small fixes
pkg/asset/manifests/*, pkg/asset/ignition/machine/*, pkg/asset/imagebased/configimage/ingressoperatorsigner.go, pkg/explain/printer_test.go
Wires PKIConfiguration into manifests, updates ignition/machine tests to pass SignerKeyParams parents to RootCA generation, updates ingress operator signer to handle PEM errors, adds/updates unit tests for assets and explain output, and includes a small whitespace adjustment.

🎯 5 (Critical) | ⏱️ ~120 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 11

❌ Failed checks (1 warning, 10 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 55.77% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Stable And Deterministic Test Names ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Test Structure And Quality ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Microshift Test Compatibility ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Single Node Openshift (Sno) Test Compatibility ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Topology-Aware Scheduling Compatibility ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Ote Binary Stdout Contract ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Ipv6 And Disconnected Network Test Compatibility ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
No-Weak-Crypto ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Container-Privileges ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
No-Sensitive-Data-In-Logs ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title precisely describes the main change: wiring signer certificates to read PKI configuration via a new SignerKeyParams asset, which is the core objective of the PR.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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

@hasbro17

hasbro17 commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

/hold

Blocked by #10593 and #10594

Also need to retest and check the ABI codepaths for the SignerKeyParams dependency (Integration tests should show that) and see if the new signers generate correctly.

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 3, 2026
@hasbro17

hasbro17 commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

/test e2e-aws-ovn-pki-default-techpreview
/test e2e-aws-ovn-pki-rsa-techpreview

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pkg/types/pki/defaults.go`:
- Around line 36-53: EffectiveSignerPKIConfig currently returns ic.PKI before
checking the ConfigurablePKI feature gate, allowing user PKI to be honored even
when the gate is off; change the logic in EffectiveSignerPKIConfig so it first
checks ic.Enabled(features.FeatureGateConfigurablePKI) and if the gate is
disabled return nil, and only when the gate is enabled honor ic.PKI (return it)
or fall back to the default SignerCertificates config; update references in
EffectiveSignerPKIConfig to enforce the gate-first behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: b8a25289-d43e-4637-8509-4498d6ba55cf

📥 Commits

Reviewing files that changed from the base of the PR and between d3fba60 and 0e262ca.

⛔ Files ignored due to path filters (1)
  • pkg/types/zz_generated.deepcopy.go is excluded by !**/zz_generated*
📒 Files selected for processing (39)
  • data/data/install.openshift.io_installconfigs.yaml
  • pkg/asset/ignition/machine/arbiter_ignition_customizations_test.go
  • pkg/asset/ignition/machine/arbiter_test.go
  • pkg/asset/ignition/machine/master_ignition_customizations_test.go
  • pkg/asset/ignition/machine/master_test.go
  • pkg/asset/ignition/machine/worker_ignition_customizations_test.go
  • pkg/asset/ignition/machine/worker_test.go
  • pkg/asset/imagebased/configimage/ingressoperatorsigner.go
  • pkg/asset/manifests/operators.go
  • pkg/asset/manifests/pki.go
  • pkg/asset/manifests/pki_test.go
  • pkg/asset/tls/adminkubeconfig.go
  • pkg/asset/tls/aggregator.go
  • pkg/asset/tls/apiserver.go
  • pkg/asset/tls/boundsasigningkey.go
  • pkg/asset/tls/certkey.go
  • pkg/asset/tls/certkey_test.go
  • pkg/asset/tls/ironictls.go
  • pkg/asset/tls/keypair.go
  • pkg/asset/tls/kubecontrolplane.go
  • pkg/asset/tls/kubelet.go
  • pkg/asset/tls/root.go
  • pkg/asset/tls/signerkey_params.go
  • pkg/asset/tls/tls.go
  • pkg/asset/tls/tls_test.go
  • pkg/asset/tls/utils.go
  • pkg/asset/tls/utils_test.go
  • pkg/explain/printer_test.go
  • pkg/types/defaults/installconfig.go
  • pkg/types/installconfig.go
  • pkg/types/pki/conversion.go
  • pkg/types/pki/defaults.go
  • pkg/types/pki/defaults_test.go
  • pkg/types/pki/validation.go
  • pkg/types/pki/validation_test.go
  • pkg/types/validation/featuregate_test.go
  • pkg/types/validation/featuregates.go
  • pkg/types/validation/installconfig.go
  • pkg/types/validation/installconfig_test.go

Comment thread pkg/types/pki/defaults.go
Comment on lines +36 to +53
func EffectiveSignerPKIConfig(ic *types.InstallConfig) *types.PKIConfig {
if ic.PKI != nil {
return ic.PKI
}

if ic.Enabled(features.FeatureGateConfigurablePKI) {
// Default signer config matches DefaultPKIProfile().SignerCertificates
return &types.PKIConfig{
SignerCertificates: types.CertificateConfig{
Key: types.KeyConfig{
Algorithm: types.KeyAlgorithmRSA,
RSA: types.RSAKeyConfig{KeySize: 4096},
},
},
}
}

return nil

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Honor ConfigurablePKI before applying user PKI config.

Line 37 returns ic.PKI even when the feature gate is off. pkg/asset/tls/signerkey_params.go:64-81 calls this helper on a raw install-config.yaml without running install-config validation, so zero-dependency signer assets can still generate custom signer keys from a gated field. Return nil when ConfigurablePKI is disabled and only honor ic.PKI once the gate is enabled.

Suggested fix
 func EffectiveSignerPKIConfig(ic *types.InstallConfig) *types.PKIConfig {
-	if ic.PKI != nil {
-		return ic.PKI
-	}
-
-	if ic.Enabled(features.FeatureGateConfigurablePKI) {
-		// Default signer config matches DefaultPKIProfile().SignerCertificates
-		return &types.PKIConfig{
-			SignerCertificates: types.CertificateConfig{
-				Key: types.KeyConfig{
-					Algorithm: types.KeyAlgorithmRSA,
-					RSA:       types.RSAKeyConfig{KeySize: 4096},
-				},
-			},
-		}
-	}
-
-	return nil
+	if ic == nil || !ic.Enabled(features.FeatureGateConfigurablePKI) {
+		return nil
+	}
+
+	if ic.PKI != nil {
+		return ic.PKI
+	}
+
+	// Default signer config matches DefaultPKIProfile().SignerCertificates
+	return &types.PKIConfig{
+		SignerCertificates: types.CertificateConfig{
+			Key: types.KeyConfig{
+				Algorithm: types.KeyAlgorithmRSA,
+				RSA:       types.RSAKeyConfig{KeySize: 4096},
+			},
+		},
+	}
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
func EffectiveSignerPKIConfig(ic *types.InstallConfig) *types.PKIConfig {
if ic.PKI != nil {
return ic.PKI
}
if ic.Enabled(features.FeatureGateConfigurablePKI) {
// Default signer config matches DefaultPKIProfile().SignerCertificates
return &types.PKIConfig{
SignerCertificates: types.CertificateConfig{
Key: types.KeyConfig{
Algorithm: types.KeyAlgorithmRSA,
RSA: types.RSAKeyConfig{KeySize: 4096},
},
},
}
}
return nil
func EffectiveSignerPKIConfig(ic *types.InstallConfig) *types.PKIConfig {
if ic == nil || !ic.Enabled(features.FeatureGateConfigurablePKI) {
return nil
}
if ic.PKI != nil {
return ic.PKI
}
// Default signer config matches DefaultPKIProfile().SignerCertificates
return &types.PKIConfig{
SignerCertificates: types.CertificateConfig{
Key: types.KeyConfig{
Algorithm: types.KeyAlgorithmRSA,
RSA: types.RSAKeyConfig{KeySize: 4096},
},
},
}
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/types/pki/defaults.go` around lines 36 - 53, EffectiveSignerPKIConfig
currently returns ic.PKI before checking the ConfigurablePKI feature gate,
allowing user PKI to be honored even when the gate is off; change the logic in
EffectiveSignerPKIConfig so it first checks
ic.Enabled(features.FeatureGateConfigurablePKI) and if the gate is disabled
return nil, and only when the gate is enabled honor ic.PKI (return it) or fall
back to the default SignerCertificates config; update references in
EffectiveSignerPKIConfig to enforce the gate-first behavior.

@hasbro17 hasbro17 force-pushed the pki-3-signer-wiring branch from 0e262ca to 2ab8c63 Compare June 3, 2026 22:45
@hasbro17

hasbro17 commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

/test e2e-aws-ovn-pki-default-techpreview
/test e2e-aws-ovn-pki-rsa-techpreview

@hasbro17

hasbro17 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

Okay the e2e tests pass now:
https://prow.ci.openshift.org/view/gs/test-platform-results/pr-logs/pull/openshift_installer/10595/pull-ci-openshift-installer-main-e2e-aws-ovn-pki-rsa-techpreview/2062305090953285632

So the SignerKeyParams helps walk the line between IPI and ABI for those signers.

@hasbro17 hasbro17 force-pushed the pki-3-signer-wiring branch from 2ab8c63 to 0a3fbe6 Compare June 4, 2026 19:59
hasbro17 added 3 commits June 8, 2026 11:31
Add the configurable PKI API surface to InstallConfig behind the
ConfigurablePKI feature gate. When the gate is active, the installer
generates a config.openshift.io/v1alpha1 PKI custom resource manifest
that day-2 operators use for certificate rotation parameters.

The default PKI profile uses RSA-4096 until all day-2 operators (CKAO,
CKMO, etc.) support ECDSA rotation. When pki is not specified in
install-config the PKI CR uses mode: Default. When pki is specified the
PKI CR uses mode: Custom with DefaultPKIProfile as the base and user
signerCertificates overrides layered on top.

No certificate generation changes are included — all certs remain
RSA-2048. Non-TechPreview clusters are completely unaffected.

Assisted-by: Claude Code (Opus 4.6)
Refactor pkg/asset/tls/ to support generating signer certificates with
configurable key algorithms (RSA or ECDSA). PrivateKeyToPem now returns
([]byte, error) instead of calling logrus.Fatalf, and
GenerateSelfSignedCertificate accepts PrivateKeyParams to control key
generation. KeyUsage flags are set based on the algorithm since ECDSA
keys cannot perform key encipherment.

All signer certs pass nil for pkiConfig in this commit, preserving
the existing RSA-2048 behavior. Wiring signers to read PKI config
is deferred to a follow-up to avoid breaking codepaths that generate
signer certs without an install-config on disk (e.g. agent create
certificates, node-joiner add-nodes).

Assisted-by: Claude Code (Opus 4.6)
Introduce SignerKeyParams, a WritableAsset with zero dependencies that
reads install-config.yaml directly from disk and extracts the effective
PKI configuration via EffectiveSignerPKIConfig(). When no install-config
is present, Load() returns (false, nil) so the asset store falls back to
the state file between multi-step invocations (e.g. create manifests
followed by create cluster, where install-config.yaml is consumed after
the first step). In the agent flow where neither file nor state exists,
Generate() leaves PKIConfig nil (RSA-2048).

Signers that previously had zero dependencies now depend on
SignerKeyParams instead of InstallConfig, avoiding validation that
would reject configs valid in the agent flow. Signers that already
depended on InstallConfig use EffectiveSignerPKIConfig() to resolve
the effective PKI config including feature gate defaults.

With TechPreview enabled and no explicit pki config, all signer certs
are generated with RSA-4096 (the current DefaultPKIProfile default).

Assisted-by: Claude Code (Opus 4.6)
@hasbro17 hasbro17 force-pushed the pki-3-signer-wiring branch from 0a3fbe6 to 9d66374 Compare June 8, 2026 18:45
@hasbro17

hasbro17 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

/test e2e-aws-ovn-pki-default-techpreview
/test e2e-aws-ovn-pki-rsa-techpreview

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pkg/asset/manifests/pki.go`:
- Around line 42-48: The Generate method on PKIConfiguration exits early when
the FeatureGateConfigurablePKI is disabled but doesn't clear previously
generated state; ensure you reset p.FileList (e.g., set to nil or an empty
slice) before the early return in PKIConfiguration.Generate so stale PKI
manifests aren't retained across runs when the feature gate is off.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 2313bdbb-b13e-49c2-89f3-c0d815a13343

📥 Commits

Reviewing files that changed from the base of the PR and between 0a3fbe6 and 9d66374.

⛔ Files ignored due to path filters (1)
  • pkg/types/zz_generated.deepcopy.go is excluded by !**/zz_generated*
📒 Files selected for processing (40)
  • data/data/install.openshift.io_installconfigs.yaml
  • pkg/asset/ignition/machine/arbiter_ignition_customizations_test.go
  • pkg/asset/ignition/machine/arbiter_test.go
  • pkg/asset/ignition/machine/master_ignition_customizations_test.go
  • pkg/asset/ignition/machine/master_test.go
  • pkg/asset/ignition/machine/worker_ignition_customizations_test.go
  • pkg/asset/ignition/machine/worker_test.go
  • pkg/asset/imagebased/configimage/ingressoperatorsigner.go
  • pkg/asset/manifests/operators.go
  • pkg/asset/manifests/pki.go
  • pkg/asset/manifests/pki_test.go
  • pkg/asset/tls/adminkubeconfig.go
  • pkg/asset/tls/aggregator.go
  • pkg/asset/tls/apiserver.go
  • pkg/asset/tls/boundsasigningkey.go
  • pkg/asset/tls/certkey.go
  • pkg/asset/tls/certkey_test.go
  • pkg/asset/tls/ironictls.go
  • pkg/asset/tls/keypair.go
  • pkg/asset/tls/kubecontrolplane.go
  • pkg/asset/tls/kubelet.go
  • pkg/asset/tls/root.go
  • pkg/asset/tls/signerkey_params.go
  • pkg/asset/tls/tls.go
  • pkg/asset/tls/tls_test.go
  • pkg/asset/tls/utils.go
  • pkg/asset/tls/utils_test.go
  • pkg/explain/printer_test.go
  • pkg/types/defaults/installconfig.go
  • pkg/types/installconfig.go
  • pkg/types/pki/conversion.go
  • pkg/types/pki/conversion_test.go
  • pkg/types/pki/defaults.go
  • pkg/types/pki/defaults_test.go
  • pkg/types/pki/validation.go
  • pkg/types/pki/validation_test.go
  • pkg/types/validation/featuregate_test.go
  • pkg/types/validation/featuregates.go
  • pkg/types/validation/installconfig.go
  • pkg/types/validation/installconfig_test.go
✅ Files skipped from review due to trivial changes (5)
  • pkg/asset/ignition/machine/arbiter_test.go
  • pkg/explain/printer_test.go
  • pkg/types/defaults/installconfig.go
  • pkg/asset/manifests/pki_test.go
  • pkg/types/validation/featuregates.go
🚧 Files skipped from review as they are similar to previous changes (30)
  • pkg/asset/imagebased/configimage/ingressoperatorsigner.go
  • pkg/asset/tls/ironictls.go
  • pkg/asset/tls/utils_test.go
  • pkg/asset/ignition/machine/worker_test.go
  • pkg/asset/ignition/machine/master_test.go
  • pkg/types/validation/featuregate_test.go
  • pkg/asset/ignition/machine/arbiter_ignition_customizations_test.go
  • pkg/types/validation/installconfig_test.go
  • pkg/types/validation/installconfig.go
  • pkg/types/pki/validation.go
  • pkg/types/pki/defaults.go
  • pkg/types/pki/defaults_test.go
  • pkg/asset/tls/boundsasigningkey.go
  • pkg/types/installconfig.go
  • data/data/install.openshift.io_installconfigs.yaml
  • pkg/asset/tls/keypair.go
  • pkg/asset/tls/kubecontrolplane.go
  • pkg/asset/tls/apiserver.go
  • pkg/asset/tls/certkey.go
  • pkg/asset/tls/tls_test.go
  • pkg/asset/tls/adminkubeconfig.go
  • pkg/asset/tls/signerkey_params.go
  • pkg/asset/tls/kubelet.go
  • pkg/asset/tls/aggregator.go
  • pkg/asset/ignition/machine/worker_ignition_customizations_test.go
  • pkg/asset/tls/utils.go
  • pkg/asset/tls/root.go
  • pkg/asset/tls/certkey_test.go
  • pkg/types/pki/validation_test.go
  • pkg/asset/tls/tls.go

Comment on lines +42 to +48
func (p *PKIConfiguration) Generate(_ context.Context, dependencies asset.Parents) error {
installConfig := &installconfig.InstallConfig{}
dependencies.Get(installConfig)

if !installConfig.Config.Enabled(features.FeatureGateConfigurablePKI) {
return nil
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Reset generated state before the feature-gate early return.

On Line 47, Generate exits when the gate is disabled but does not clear p.FileList. Reusing the same asset instance can retain stale PKI manifest output from a previous enabled run.

Suggested fix
 func (p *PKIConfiguration) Generate(_ context.Context, dependencies asset.Parents) error {
+	p.FileList = nil
+
 	installConfig := &installconfig.InstallConfig{}
 	dependencies.Get(installConfig)
 
 	if !installConfig.Config.Enabled(features.FeatureGateConfigurablePKI) {
 		return nil
 	}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
func (p *PKIConfiguration) Generate(_ context.Context, dependencies asset.Parents) error {
installConfig := &installconfig.InstallConfig{}
dependencies.Get(installConfig)
if !installConfig.Config.Enabled(features.FeatureGateConfigurablePKI) {
return nil
}
func (p *PKIConfiguration) Generate(_ context.Context, dependencies asset.Parents) error {
p.FileList = nil
installConfig := &installconfig.InstallConfig{}
dependencies.Get(installConfig)
if !installConfig.Config.Enabled(features.FeatureGateConfigurablePKI) {
return nil
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/asset/manifests/pki.go` around lines 42 - 48, The Generate method on
PKIConfiguration exits early when the FeatureGateConfigurablePKI is disabled but
doesn't clear previously generated state; ensure you reset p.FileList (e.g., set
to nil or an empty slice) before the early return in PKIConfiguration.Generate
so stale PKI manifests aren't retained across runs when the feature gate is off.

@openshift-ci

openshift-ci Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

@hasbro17: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/golint 9d66374 link true /test golint
ci/prow/e2e-aws-ovn-pki-default-techpreview 9d66374 link false /test e2e-aws-ovn-pki-default-techpreview
ci/prow/e2e-metal-ovn-two-node-fencing 9d66374 link false /test e2e-metal-ovn-two-node-fencing
ci/prow/gofmt 9d66374 link true /test gofmt
ci/prow/e2e-metal-single-node-live-iso 9d66374 link false /test e2e-metal-single-node-live-iso

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

do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants