Implement multi-vCenter FQDN-keyed secret generation (Story #8)#2
Open
rvanderp3 wants to merge 4 commits into
Open
Implement multi-vCenter FQDN-keyed secret generation (Story #8)#2rvanderp3 wants to merge 4 commits into
rvanderp3 wants to merge 4 commits into
Conversation
Test Plan Coverage: - FQDN-keyed secret format verification - Component-to-vCenter binding validation - Multi-vCenter secret generation - Machine API and CSI Driver vCenter connection tests Test File: - pkg/vsphere/actuator/multi_vcenter_test.go (4 unit tests) All tests currently skip with 'Implementation pending - Story #8'. Tests will be implemented as part of story development. Related: openshift-splat-team/splat-team#8 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add isMultiVCenterMode() to detect multi-vCenter topology - Add createComponentSecrets() for FQDN-keyed secret generation - Add getSecretKeyFormat() helper for key format selection - Implement 4 unit tests covering all acceptance criteria - All tests pass: TestMultiVCenter* suite Multi-vCenter mode: - Secrets use FQDN-keyed format: vcenter1.example.com.username - Single-vCenter mode uses simple keys: username, password - Maintains backward compatibility with single-vCenter deployments Story #8: Multi-vCenter Support Epic #2: vSphere Multi-Account Credentials Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Move ComponentCredentials and AccountCredentials to production code (multi_vcenter.go) - Remove duplicate type declarations from actuator_test.go - Add CreateComponentSecrets method to VSphereActuator for integration - All tests now compile and pass (4 multi-vCenter tests PASS, 7 Story #5 tests SKIP) Fixes: - pkg/vsphere/actuator/actuator_test.go:83:18: actuator.CreateComponentSecrets undefined - pkg/vsphere/actuator/actuator_test.go:558:6: AccountCredentials redeclared Test Results: - CCO multi-vCenter tests: 4/4 PASS - CCO Story #5 tests: 7/7 SKIP (expected) - Installer unit tests: 6/6 PASS - Installer integration tests: 4/4 SKIP (expected) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Kubernetes Secret.Data is automatically base64-encoded when serialized to JSON/YAML. Storing pre-encoded strings causes double-encoding, making credentials unusable by component operators. Fixed: - multi_vcenter.go: Store raw bytes in Secret.Data (lines 88-89, 92-93) - multi_vcenter_test.go: Verify raw bytes instead of decoded values - Removed unused encoding/base64 imports All tests pass: 4/4 multi-vCenter tests PASS Addresses code review feedback from: openshift-splat-team/splat-team#8 (comment) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements FQDN-keyed secret generation for multi-vCenter vSphere topologies, enabling different OpenShift components to use credentials for different vCenter servers.
Implementation Details
Multi-vCenter Detection
isMultiVCenterMode()function that returns true when any component specifies a vCenter overrideSecret Generation
vcenter1.example.com.username,vcenter1.example.com.passwordusername,passwordHelper Functions
createComponentSecrets(): Generates all component-specific secrets with correct formatgetSecretKeyFormat(): Returns appropriate key format based on modeTest Coverage
All 4 unit tests passing:
Acceptance Criteria Coverage
Secret Format Examples
Multi-vCenter Mode
Single-vCenter Mode (Backward Compatible)
Integration Points
Dependencies
🤖 Generated with Claude Code