NO-JIRA: Dynamic namespace instead of hard coded openshift-config-managed - #2401
NO-JIRA: Dynamic namespace instead of hard coded openshift-config-managed#2401ardaguclu wants to merge 1 commit into
Conversation
|
@ardaguclu: This pull request explicitly references no jira issue. 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. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ardaguclu The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (16)
🚧 Files skipped from review as they are similar to previous changes (15)
WalkthroughEncryption controller APIs now accept a namespace. Controllers, informers, Secret operations, state retrieval, and integration setup use the supplied namespace instead of a fixed namespace. ChangesEncryption namespace propagation
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 14 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (14 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
pkg/operator/encryption/secrets/secrets_test.go (1)
226-226: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert the namespace written by
FromKeyState.
TestRoundtripcompares onlyKeyState;ToKeyStateignoresSecret.Namespace. The test can pass even ifFromKeyStateignores the new argument. Use a non-default namespace and asserts.Namespace.Suggested assertion
- s, err := FromKeyState("openshift-config-managed", tt.component, tt.ks) + const namespace = "custom-config-managed" + s, err := FromKeyState(namespace, tt.component, tt.ks) if err != nil { t.Fatalf("unexpected FromKeyState() error: %v", err) } + if s.Namespace != namespace { + t.Fatalf("unexpected namespace: got %q, want %q", s.Namespace, namespace) + }🤖 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/secrets/secrets_test.go` at line 226, Update TestRoundtrip around the FromKeyState call to pass a non-default namespace and assert that the returned Secret’s Namespace matches it. Keep the existing KeyState comparison, ensuring the test verifies both round-trip state and namespace propagation.
🤖 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/apiserver/controllerset/apiservercontrollerset.go`:
- Line 506: Replace the hard-coded "openshift-config-managed" argument in
encryptionControllerBuilder.build with the configured namespace, and thread that
value through WithEncryptionControllers into encryptionControllerBuilder so
NewControllers uses it for all encryption secret operations.
---
Nitpick comments:
In `@pkg/operator/encryption/secrets/secrets_test.go`:
- Line 226: Update TestRoundtrip around the FromKeyState call to pass a
non-default namespace and assert that the returned Secret’s Namespace matches
it. Keep the existing KeyState comparison, ensuring the test verifies both
round-trip state and namespace propagation.
🪄 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: 52415f2d-841e-4c53-b8b7-696c7823f48e
📒 Files selected for processing (16)
pkg/operator/apiserver/controllerset/apiservercontrollerset.gopkg/operator/encryption/controllers.gopkg/operator/encryption/controllers/condition_controller.gopkg/operator/encryption/controllers/key_controller.gopkg/operator/encryption/controllers/key_controller_test.gopkg/operator/encryption/controllers/migration_controller.gopkg/operator/encryption/controllers/migration_controller_test.gopkg/operator/encryption/controllers/prune_controller.gopkg/operator/encryption/controllers/prune_controller_test.gopkg/operator/encryption/controllers/state_controller.gopkg/operator/encryption/controllers/state_controller_test.gopkg/operator/encryption/preconditions.gopkg/operator/encryption/secrets/secrets.gopkg/operator/encryption/secrets/secrets_test.gopkg/operator/encryption/statemachine/transition.gotest/e2e-encryption/encryption_test.go
|
@ardaguclu: 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. |
|
#2402 supersedes this PR |
|
@ardaguclu: Closed this PR. 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 kubernetes-sigs/prow repository. |
Summary by CodeRabbit