CORS-4549: gcp: set universe domain in Infrastructure status for GCD - #10759
CORS-4549: gcp: set universe domain in Infrastructure status for GCD#10759patrickdillon wants to merge 3 commits into
Conversation
Populate GCPPlatformStatus.UniverseDomain in the Infrastructure manifest when the GCPSovereignCloudInstall feature gate is enabled and the credential's universe domain is non-default. This allows downstream operators to read the universe domain from the Infrastructure CR. When the feature gate is not enabled, the block is skipped entirely so there is no change in behavior for standard GCP installs.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: ⛔ Files ignored due to path filters (7)
📒 Files selected for processing (1)
📝 WalkthroughWalkthroughGCP infrastructure generation now uses sovereign-cloud feature gating to obtain the GCP session and universe domain. It records non-default domains in infrastructure status and returns errors when either lookup fails. ChangesGCP sovereign-cloud infrastructure
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions Comment |
|
@patrickdillon: This pull request references CORS-4549 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 the "5.0.0" version, but no target version was set. 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. |
|
@patrickdillon: This pull request references CORS-4549 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 the "5.0.0" version, but no target version was set. 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. |
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
pkg/asset/manifests/infrastructure.go (1)
227-227: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAdd unit coverage for the GCP sovereign-cloud path
types.InstallConfig.Enabled(...)is valid. Keep the current feature-gate call. Add tests for universe-domain propagation and session errors.🤖 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/infrastructure.go` at line 227, Add unit tests for the GCP sovereign-cloud branch guarded by installConfig.Config.Enabled(features.FeatureGateGCPSovereignCloudInstall), covering universe-domain propagation and session-error handling. Preserve the existing feature-gate call and use types.InstallConfig.Enabled(...) in the test setup.Source: Coding guidelines
🤖 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/infrastructure.go`:
- Around line 227-239: Add deterministic tests in infrastructure_test.go for the
GCPSovereignCloudInstall logic in the infrastructure manifest flow, using mocked
or injected GCP session behavior rather than ambient credentials. Cover a
disabled feature gate, default and non-default universe domains, GetSession
errors, and GetUniverseDomain errors; verify non-default domains update
config.Status.PlatformStatus.GCP.UniverseDomain and all error paths return the
expected wrapped errors.
---
Nitpick comments:
In `@pkg/asset/manifests/infrastructure.go`:
- Line 227: Add unit tests for the GCP sovereign-cloud branch guarded by
installConfig.Config.Enabled(features.FeatureGateGCPSovereignCloudInstall),
covering universe-domain propagation and session-error handling. Preserve the
existing feature-gate call and use types.InstallConfig.Enabled(...) in the test
setup.
🪄 Autofix
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 YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: dc7d6e05-23e2-46c5-85c0-782d65224a80
📒 Files selected for processing (1)
pkg/asset/manifests/infrastructure.go
|
Scheduling tests matching the |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: tthvo The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/test e2e-gcd-ovn-private-techpreview |
|
Thanks for taking a look. Heads up:
Will not actually verify this, because the gate was in dev preview. openshift/api#2970 just merged, so I will pull it into this pr and then we can use that e2e to verify. |
Ah whoops, thanks! I kept forgetting that lol |
Hmm, that got me wonder if we should add any validation to allow GCD install only when the feature gate is enabled (like AWS EUSC). Right now, the gcd e2e can install just fine because there's none 🤔 |
Pull in GCD at TechPreview.
go mod vendor
|
now includes api bump /test e2e-gcd-ovn-private-techpreview |
|
/test e2e-gcp-ovn Expecting the field shouldn't be set there. |
|
Scheduling tests matching the |
Populate GCPPlatformStatus.UniverseDomain in the Infrastructure manifest when the GCPSovereignCloudInstall feature gate is enabled and the credential's universe domain is non-default. This allows downstream operators to read the universe domain from the Infrastructure CR.
When the feature gate is not enabled, the block is skipped entirely so there is no change in behavior for standard GCP installs.
Summary by CodeRabbit