Repository navigation
Privilege Validation for Per-Component Credentials - #2
Merged
Merged
Conversation
Add vSphere privilege validation logic using component-specific privilege lists. Validates that each OpenShift component account (installer, machine-api, csi-driver, cloud-controller, diagnostics) has required vCenter permissions before installation proceeds. Implementation: - PrivilegeValidator struct with ValidateComponentPrivileges method - ValidationResult struct with Valid, MissingPrivileges, Scope fields - GetRequiredPrivileges() function with comprehensive privilege lists - Installer: ~45 privileges for infrastructure deployment - Machine API: ~35 privileges for VM lifecycle - CSI Driver: ~12 privileges for storage provisioning - Cloud Controller: ~10 read-only privileges for node discovery - Diagnostics: ~5 read-only privileges for troubleshooting Test coverage: - 9 test scenarios covering all acceptance criteria - Missing privilege detection (machine-api, csi-driver) - Successful validation for all components - Component-specific privilege sets - Error handling Foundation for Story #4: Privilege Validation Parent Epic: #2 - vSphere Multi-Account Credentials Depends on: Story #3 (schema extension) Related: openshift-splat-team/splat-team#4 Related: openshift-splat-team/splat-team#2 Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
This was referenced Apr 14, 2026
rvanderp3
added a commit
that referenced
this pull request
Apr 14, 2026
- Add isMultiVCenterMode() helper to detect multi-vCenter topology - Add getComponentVCenter() to resolve component-specific vCenter - Add getAllReferencedVCenters() to collect all vCenter references - Add validateMultiVCenterCredentials() for credential validation - Implement 5 unit tests covering all acceptance criteria - All tests pass: TestMultiVCenter* suite Story #8: Multi-vCenter Support Epic #2: vSphere Multi-Account Credentials Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
rvanderp3
added a commit
that referenced
this pull request
Apr 14, 2026
… restart Address code review feedback: 1. Multi-vCenter secret format support (Critical #1): - Add isMultiVCenterMode() detection based on credentials file - Update createSecret() to use FQDN-keyed format when multi-vCenter - Support all vCenters from credentials file (not just first) - Align with Story #8 multi_vcenter.go implementation 2. Real operator restart implementation (Critical #2): - Replace stub restartComponentOperators() with real Kubernetes API calls - Trigger rollout restart via deployment annotation update - Wait for rollout completion with 5-minute timeout - Replace stub verifyComponentReconnection() with deployment ready checks 3. Complete rollback implementation (Major #3): - Restore original passthrough secret from backup - Delete backup secret after successful restoration - Add TODO for CCO CloudCredential CR revert logic 4. Namespace validation (Minor #4): - Add validateNamespacesExist() before creating secrets - Fail early with clear error if namespace missing 5. Multi-vCenter credentials support (Minor #5): - Process all vCenters from credentials file - Validate privileges for each vCenter Test updates: - Add mock operator deployments to integration test - Create all required namespaces in test setup - All 4 unit tests passing - Integration test (happy path) passing - 5 E2E tests appropriately skipped (require live cluster) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
rvanderp3
added a commit
that referenced
this pull request
Apr 14, 2026
…tials - Add comprehensive per-component-credentials.md documentation - Add create-component-roles.sh (govc-based, Linux/macOS) - Add create-component-roles.ps1 (PowerCLI-based, Windows) - Add generate-credentials-file.sh (YAML template generator) - Add scripts/README.md with quick start guide Scripts support: - Multi-vCenter deployments - Complete privilege lists per component (~45/35/12/9/5 privileges) - Secure credentials file generation with 0600 permissions - Role creation/update with validation Implements Story #10: Administrator Automation Scripts Parent Epic #2: vSphere Multi-Account Credentials Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
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 privilege validation for vSphere per-component credentials (Story #4). Adds logic to validate that each OpenShift component account has required vCenter privileges before installation proceeds.
Implementation Details
New Files
pkg/asset/installconfig/vsphere/privilegevalidator.go:PrivilegeValidatorstruct withValidateComponentPrivileges()methodValidationResultstruct withValid,MissingPrivileges,ScopefieldsGetRequiredPrivileges()function with component-specific privilege lists:pkg/asset/installconfig/vsphere/privilegevalidator_test.go:Design
Foundation for validation using vSphere
AuthorizationManager.FetchUserPrivilegeOnEntities()API. The current implementation provides the structure and privilege lists; actual vSphere API integration will be added in subsequent commits.Acceptance Criteria
✅ AC1: machine-api missing
VirtualMachine.Provisioning.Cloneprivilege → validation fails with specific error message✅ AC2: csi-driver missing
Datastore.AllocateSpaceprivilege → validation fails with specific error message✅ AC3: all component credentials have required privileges → validation passes for all components
Test Coverage
Dependencies
Related Issues
🤖 Generated with Claude Code