Skip to content

[WIP] kms: compute dry-run encryption config secret for preflight pod - #2377

Open
bertinatto wants to merge 3 commits into
openshift:masterfrom
bertinatto:kms-preflight-create-ec-manifestclient
Open

[WIP] kms: compute dry-run encryption config secret for preflight pod#2377
bertinatto wants to merge 3 commits into
openshift:masterfrom
bertinatto:kms-preflight-create-ec-manifestclient

Conversation

@bertinatto

@bertinatto bertinatto commented Jul 24, 2026

Copy link
Copy Markdown
Member

When deploying a new KMS preflight pod, the preflight controller now computes the required encryption configuration Secret using a dry-run sandbox.

Summary by CodeRabbit

  • New Features
    • KMS preflight now computes the managed encryption-config via a dry-run and deploys the preflight workload using the computed, validated result.
    • Preflight reconciles until encryption state converges while continuing to rewrite KMS provider endpoints to the preflight socket.
  • Bug Fixes
    • Prevents deploying the preflight workload with a missing/nil encryption-config when no preflight pod exists.
  • Tests
    • Added unit tests for dry-run encryption-config generation and for the dry-run secrets overlay.
    • Updated controller tests to verify the generated encryption-config is passed to the deployer.

@openshift-ci

openshift-ci Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 24, 2026
@openshift-ci

openshift-ci Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bertinatto

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:

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

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 24, 2026
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

The KMS preflight controller now computes an encryption configuration Secret through sandboxed key and state reconciliation, rewrites its KMS endpoint for preflight, supports convergence requeues, and passes the resulting Secret to the preflight deployer. Key and state controllers now expose concrete controller types.

Changes

KMS preflight encryption flow

Layer / File(s) Summary
Exported encryption controllers
pkg/operator/encryption/controllers/key_controller.go, pkg/operator/encryption/controllers/state_controller.go, pkg/operator/encryption/controllers/*_test.go
Key and state controllers now expose concrete types with exported Sync, Run, and Name methods, with tests updated for the exported key controller.
Dry-run Secret overlay
pkg/operator/encryption/controllers/kms_preflight_overlay.go, pkg/operator/encryption/controllers/kms_preflight_overlay_test.go
Secret reads and lists combine live data with in-memory dry-run writes, while unsupported live mutations return errors; overlay behavior is covered by unit tests.
Sandbox reconciliation and preflight wiring
pkg/operator/encryption/controllers/kms_preflight_sandbox.go, pkg/operator/encryption/controllers/kms_preflight_controller.go, pkg/operator/encryption/controllers/*_test.go
Sandboxed key and state synchronization produces and rewrites the encryption-config Secret, while the preflight controller requeues for convergence and deploys with the computed Secret.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant KMSPreflightController
  participant DryRunSandbox
  participant KeyController
  participant StateController
  participant PreflightDeployer
  KMSPreflightController->>DryRunSandbox: compute encryption-config Secret
  DryRunSandbox->>KeyController: reconcile key Secret
  KeyController-->>DryRunSandbox: capture generated key Secret
  DryRunSandbox->>StateController: reconcile encryption-config Secret
  StateController-->>DryRunSandbox: return generated configuration Secret
  DryRunSandbox-->>KMSPreflightController: return rewritten Secret or requeue
  KMSPreflightController->>PreflightDeployer: deploy with encryption-config Secret
Loading

Suggested reviewers: ardaguclu

🚥 Pre-merge checks | ✅ 4 | ❌ 11

❌ Failed checks (1 warning, 10 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 13.64% 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
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: computing a dry-run encryption config secret for the KMS preflight pod.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@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/operator/encryption/controllers/kms_preflight_sandbox.go`:
- Around line 108-156: Update seedPreflightSandboxFS to reuse the
already-fetched liveDeployed encryption-config secret instead of performing a
second live Secrets.Get for managedEncryptionConfigName. Pass that shared value
into the function or otherwise connect it to the existing source-of-truth flow,
while preserving handling for an absent secret and the existing putSecretYAML
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: 05fc02de-036a-4b69-aeb1-d99be8615bba

📥 Commits

Reviewing files that changed from the base of the PR and between e4053a9 and 7336383.

📒 Files selected for processing (4)
  • pkg/operator/encryption/controllers/kms_preflight_controller.go
  • pkg/operator/encryption/controllers/kms_preflight_controller_test.go
  • pkg/operator/encryption/controllers/kms_preflight_sandbox.go
  • pkg/operator/encryption/controllers/kms_preflight_sandbox_test.go

Comment thread pkg/operator/encryption/controllers/kms_preflight_sandbox.go Outdated
@bertinatto
bertinatto force-pushed the kms-preflight-create-ec-manifestclient branch 2 times, most recently from 2634b8b to cf6b6ed Compare July 25, 2026 12:11

@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.

🧹 Nitpick comments (1)
pkg/operator/encryption/controllers/kms_preflight_sandbox.go (1)

352-394: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Silent fallback could preflight-check the wrong KMS provider.

When the write key can't be precisely matched (lines 376-391), the function silently rewrites the first KMS provider's endpoint instead of failing or surfacing the ambiguity. In a multi-provider config this can validate the wrong provider, giving a false-positive preflight result for exactly the scenario this controller exists to catch.

🤖 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/operator/encryption/controllers/kms_preflight_sandbox.go` around lines
352 - 394, Remove the silent first-provider fallback in
rewritePreflightWriteKeyEndpoint. When no KMS provider matches the requested
keyID or expected endpoint, return an explicit error instead of rewriting any
provider; preserve the existing successful rewrite and secret serialization
behavior for precise matches.
🤖 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.

Nitpick comments:
In `@pkg/operator/encryption/controllers/kms_preflight_sandbox.go`:
- Around line 352-394: Remove the silent first-provider fallback in
rewritePreflightWriteKeyEndpoint. When no KMS provider matches the requested
keyID or expected endpoint, return an explicit error instead of rewriting any
provider; preserve the existing successful rewrite and secret serialization
behavior for precise matches.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 968ce6eb-6617-4a11-85c0-f5e2ae1e6d4e

📥 Commits

Reviewing files that changed from the base of the PR and between 2634b8b and cf6b6ed.

📒 Files selected for processing (7)
  • pkg/operator/encryption/controllers/key_controller.go
  • pkg/operator/encryption/controllers/key_controller_test.go
  • pkg/operator/encryption/controllers/kms_preflight_controller.go
  • pkg/operator/encryption/controllers/kms_preflight_controller_test.go
  • pkg/operator/encryption/controllers/kms_preflight_sandbox.go
  • pkg/operator/encryption/controllers/kms_preflight_sandbox_test.go
  • pkg/operator/encryption/controllers/state_controller.go
🚧 Files skipped from review as they are similar to previous changes (5)
  • pkg/operator/encryption/controllers/key_controller_test.go
  • pkg/operator/encryption/controllers/kms_preflight_sandbox_test.go
  • pkg/operator/encryption/controllers/kms_preflight_controller_test.go
  • pkg/operator/encryption/controllers/state_controller.go
  • pkg/operator/encryption/controllers/kms_preflight_controller.go

@ardaguclu ardaguclu 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.

This sandboxing looks brilliant to me. I just commented about a few items that logically differ between preflight and key controller.

Comment thread pkg/operator/encryption/controllers/kms_preflight_sandbox.go
@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 28, 2026

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
pkg/operator/encryption/controllers/kms_preflight_sandbox.go (1)

92-95: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Reuse one operator snapshot for both dry-runs. Each call to operatorClientForDryRun() reads live state independently, so KeyController and StateController can observe different spec/status if the operator changes between calls. Capture the fake client once and share it across both paths.

🤖 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/operator/encryption/controllers/kms_preflight_sandbox.go` around lines 92
- 95, Update the dry-run setup in the surrounding preflight flow to create one
fake operator client snapshot and reuse it for both KeyController and
StateController paths. Replace separate operatorClientForDryRun calls with the
shared client, while preserving the existing error propagation when snapshot
creation fails.
🧹 Nitpick comments (1)
pkg/operator/encryption/controllers/kms_preflight_sandbox.go (1)

117-122: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Wrap the underlying finder error for easier debugging.

The original error from findWrittenWithPrefix is discarded in favor of a fixed message. Minor, but wrapping it would preserve useful detail (e.g., which prefix/namespace was searched) if this ever fires in practice.

♻️ Proposed fix
 	created, err := overlay.findWrittenWithPrefix(openshiftConfigManagedNS, prefix)
 	if err != nil {
-		return "", fmt.Errorf("preflight required but key controller dry-run did not create a new encryption key secret")
+		return "", fmt.Errorf("preflight required but key controller dry-run did not create a new encryption key secret: %w", err)
 	}
🤖 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/operator/encryption/controllers/kms_preflight_sandbox.go` around lines
117 - 122, Update the error handling after overlay.findWrittenWithPrefix in the
preflight key lookup to wrap and retain the underlying err while preserving the
existing contextual message; include the original error as the cause rather than
discarding it.
🤖 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.

Outside diff comments:
In `@pkg/operator/encryption/controllers/kms_preflight_sandbox.go`:
- Around line 92-95: Update the dry-run setup in the surrounding preflight flow
to create one fake operator client snapshot and reuse it for both KeyController
and StateController paths. Replace separate operatorClientForDryRun calls with
the shared client, while preserving the existing error propagation when snapshot
creation fails.

---

Nitpick comments:
In `@pkg/operator/encryption/controllers/kms_preflight_sandbox.go`:
- Around line 117-122: Update the error handling after
overlay.findWrittenWithPrefix in the preflight key lookup to wrap and retain the
underlying err while preserving the existing contextual message; include the
original error as the cause rather than discarding it.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 10885456-5564-4850-9edb-c25485bb872c

📥 Commits

Reviewing files that changed from the base of the PR and between cf6b6ed and aa75446.

📒 Files selected for processing (4)
  • pkg/operator/encryption/controllers/kms_preflight_overlay.go
  • pkg/operator/encryption/controllers/kms_preflight_overlay_test.go
  • pkg/operator/encryption/controllers/kms_preflight_sandbox.go
  • pkg/operator/encryption/controllers/kms_preflight_sandbox_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • pkg/operator/encryption/controllers/kms_preflight_sandbox_test.go

@ardaguclu ardaguclu 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.

Since we agree upon pursuing this mechanism, I dropped some comments about the code.

Comment thread pkg/operator/encryption/controllers/kms_preflight_controller.go Outdated
if err != nil {
return false, fmt.Errorf("failed to compute encryption config for preflight: %w", err)
}
if requeueForConvergence {

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.

It is better to document why we requeue when there is no convergence for future readers.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

added 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.

@p0lyn0mial since in-place field updates work even if there is no convergence, preflight should work too.

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.

yes, i think so.

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.

so this needs to be removed

Comment thread pkg/operator/encryption/controllers/kms_preflight_overlay.go Outdated
Comment thread pkg/operator/encryption/controllers/kms_preflight_overlay.go Outdated
Comment thread pkg/operator/encryption/controllers/kms_preflight_sandbox.go Outdated
@bertinatto
bertinatto force-pushed the kms-preflight-create-ec-manifestclient branch from aa75446 to 1edb9fb Compare July 29, 2026 16:07
@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 29, 2026
@bertinatto
bertinatto marked this pull request as ready for review July 29, 2026 16:16
@bertinatto bertinatto changed the title kms: compute dry-run encryption config secret for preflight pod [WIP] kms: compute dry-run encryption config secret for preflight pod Jul 29, 2026
@openshift-ci openshift-ci Bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Jul 29, 2026
@openshift-ci
openshift-ci Bot requested review from dgrisonnet and p0lyn0mial July 29, 2026 16:26
@bertinatto
bertinatto force-pushed the kms-preflight-create-ec-manifestclient branch from 1edb9fb to 54ac90b Compare July 29, 2026 19:22
@bertinatto
bertinatto force-pushed the kms-preflight-create-ec-manifestclient branch from e20ad1a to 820dda3 Compare July 29, 2026 22:39
@bertinatto
bertinatto force-pushed the kms-preflight-create-ec-manifestclient branch from 820dda3 to 33f19d7 Compare July 30, 2026 18:37
@bertinatto

Copy link
Copy Markdown
Member Author

/retest

// encryptionDeployer is the same statemachine.Deployer used by the key and state
// controllers. It is consulted once when seeding the dry-run that produces the
// encryption-config Secret for the preflight pod.
encryptionDeployer statemachine.Deployer,

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.

nit: Naming is confusing for me especially looking with the one line above.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

would it be better if we renamed deployer to preflightDeployet in a separate PR?

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 works for me

if err != nil {
return false, fmt.Errorf("failed to compute encryption config for preflight: %w", err)
}
if requeueForConvergence {

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.

@p0lyn0mial since in-place field updates work even if there is no convergence, preflight should work too.

if s, ok := c.parent.written[c.ns][name]; ok {
return s.DeepCopy(), nil
}
return c.parent.real.Secrets(c.ns).Get(ctx, name, opts)

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.

result should not be written to c.parent.written back, because this does not work as cache

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

agreed; the object we get from the apiserver should not be stored in written (which should only contain objects that were tried to be 'written' [created/updated]). At least that's the idea, are you suggesting it's not currently doing that?

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.

Current mechanism looks good to me

if err != nil {
return nil, err
}
list, err := c.parent.real.Secrets(c.ns).List(ctx, opts)

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.

Would make sense adding nil checks for c.parent.real and return error

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I can add a nil check in the constructor (rather than checking it on every Get/List call. PTAL

for i := range cfg.Encryption.Resources {
for j := range cfg.Encryption.Resources[i].Providers {
kms := cfg.Encryption.Resources[i].Providers[j].KMS
if kms == nil || kms.Endpoint != wantOld {

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.

it is better to compare against providerName instead of endpoint.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done

}

// recordedKeySecret returns the single encryption-key secret recorded for instanceName.
func recordedKeySecret(overlay *dryRunSecretsGetter, instanceName string) (*corev1.Secret, error) {

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.

This sounds like leaking the knowledge of encryption controllers. Instead of this function, can't we get keyID like this;

keySecrets, err := secrets.ListKeySecrets(ctx, overlay, encryptionSecretSelector)
  if err != nil {
      return false, nil, err
  }

  var latestKeyID uint64
  for _, s := range keySecrets {
      if id, ok := state.NameToKeyID(s.Name); ok && id > latestKeyID {
          latestKeyID = id
      }
  }

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done, PTAL

//
// TODO: once preflight dials the write-key socket (kms-{id}.sock) directly,
// this rewrite can be removed and the dry-run secret can be used as-is.
func rewritePreflightWriteKeyEndpoint(secret *corev1.Secret, keyID uint64) (*corev1.Secret, error) {

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.

Instead of having this function, can't we call this in the caller;

target := fmt.Sprintf("%d_", latestKeyID)
  for i := range cfg.Encryption.Resources {
      for j := range cfg.Encryption.Resources[i].Providers {
          if kms := cfg.Encryption.Resources[i].Providers[j].KMS; kms != nil && strings.HasPrefix(kms.Name, target) {
              kms.Endpoint = preflightKMSSocketEndpoint
          }
      }
  }

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

if I understand correctly, that's just part of what this function do, the caller still needs to call encryptiondata.FromSecret. Inlining this in computeEncryptionConfigSecretDryRun() would make it even bigger. Also, the idea is that this would be dropped in the future, so a helpers makes that easier. WDYT? Am I misunderstanding it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

oh, and the caller would also need encryptiondata.ToSecret

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.

Yeah, it would be better to leave this func as is

@bertinatto
bertinatto force-pushed the kms-preflight-create-ec-manifestclient branch 2 times, most recently from bef1557 to 8483711 Compare July 31, 2026 15:23
@bertinatto
bertinatto force-pushed the kms-preflight-create-ec-manifestclient branch from 8483711 to fa25e8f Compare July 31, 2026 15:38
@openshift-ci

openshift-ci Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

@bertinatto: 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.

@ardaguclu ardaguclu 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.

Overall looks good to me

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants