Skip to content

CORS-4537: Add API-backed disk type availability validation#10687

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
barbacbd:CORS-4537
Jul 23, 2026
Merged

CORS-4537: Add API-backed disk type availability validation#10687
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
barbacbd:CORS-4537

Conversation

@barbacbd

@barbacbd barbacbd commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Disk type validation was previously entirely static, relying on
hardcoded maps (InstanceTypeToDiskTypeMap, ComputeSupportedDisks) that
encode which disk types are compatible with which instance families.
This works for public GCP where all standard disk types are available
in every region, but fails for sovereign clouds where regional
availability differs. For example, pd-ssd is not available in
u-germany-northeast1, but the static map would allow c3 + pd-ssd
since c3 supports pd-ssd in public GCP.

This change adds an API-backed availability check that queries each
zone individually via DiskTypes.Get, following the existing pattern
established by GetMachineTypeWithZones for machine type validation.
Per-zone Get calls are used instead of DiskTypes.AggregatedList because
the aggregated list does not return results on sovereign clouds.

The two validation layers are complementary:

1. Static check (validateInstanceAndDiskType): Is this disk type
   compatible with this instance family? Uses the hardcoded
   InstanceTypeToDiskTypeMap. Catches combinations that never work
   anywhere (e.g. n2 + hyperdisk-balanced).

2. API check (validateDiskTypeAvailability): Is this disk type
   available in this specific region and zones? Calls the GCP API.
   Catches disk types that are valid in general but unavailable in the
   target region (e.g. pd-ssd in sovereign cloud regions).

The API check runs after the static check passes, so incompatible
combinations are caught early without an API call. If the DiskTypes
API is unreachable due to a non-googleapi error (e.g. network issues,
missing permissions), validation degrades gracefully by logging a
warning and continuing with only the static check.

Summary by CodeRabbit

  • New Features

    • GCP install configuration now validates disk type availability across regions and selected zones.
    • Added support for detecting disk types and their available zones.
    • Improved handling of sovereign GCP environments and custom universe domains.
  • Bug Fixes

    • Improved error handling for GCP resource and validation failures.
    • Corrected disk type defaults and availability checks for sovereign projects.
  • Tests

    • Added coverage for disk type validation, sovereign environments, universe domains, and disk type defaults.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 15, 2026
@openshift-ci-robot

openshift-ci-robot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

@barbacbd: This pull request references CORS-4537 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.

Details

In response to this:

Disk type validation was previously entirely static, relying on
hardcoded maps (InstanceTypeToDiskTypeMap, ComputeSupportedDisks) that
encode which disk types are compatible with which instance families.
This works for public GCP where all standard disk types are available
in every region, but fails for sovereign clouds where regional
availability differs. For example, pd-ssd is not available in
u-germany-northeast1, but the static map would allow c3 + pd-ssd
since c3 supports pd-ssd in public GCP.

This change adds an API-backed availability check that queries each
zone individually via DiskTypes.Get, following the existing pattern
established by GetMachineTypeWithZones for machine type validation.
Per-zone Get calls are used instead of DiskTypes.AggregatedList because
the aggregated list does not return results on sovereign clouds.

The two validation layers are complementary:

  1. Static check (validateInstanceAndDiskType): Is this disk type
    compatible with this instance family? Uses the hardcoded
    InstanceTypeToDiskTypeMap. Catches combinations that never work
    anywhere (e.g. n2 + hyperdisk-balanced).

  2. API check (validateDiskTypeAvailability): Is this disk type
    available in this specific region and zones? Calls the GCP API.
    Catches disk types that are valid in general but unavailable in the
    target region (e.g. pd-ssd in sovereign cloud regions).

The API check runs after the static check passes, so incompatible
combinations are caught early without an API call. If the DiskTypes
API is unreachable due to a non-googleapi error (e.g. network issues,
missing permissions), validation degrades gracefully by logging a
warning and continuing with only the static check.

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.

@coderabbitai

coderabbitai Bot commented Jul 15, 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

Walkthrough

Changes

GCP disk availability and validation

Layer / File(s) Summary
Disk availability API
pkg/asset/installconfig/gcp/client.go, pkg/asset/installconfig/gcp/mock/gcpclient_generated.go
Adds regional disk-type lookup across zones, mock support, and standard-library error wrapping.
Disk validation integration
pkg/asset/installconfig/gcp/validation.go, pkg/asset/installconfig/gcp/validation_test.go
Validates disk types by region and requested zones, with expanded API-error handling and table-driven tests.

GCP universe-domain handling

Layer / File(s) Summary
Universe-domain controller wiring
pkg/clusterapi/system.go, pkg/types/gcp/*_test.go
Derives non-default universe domains from session credentials, passes them to CAPG, and adds coverage for sovereign environments and disk defaults.

Azure generated metadata

Layer / File(s) Summary
MockGen header update
pkg/asset/installconfig/azure/mock/azureclient_generated.go
Updates the generated header to document ./client.go as the source path.

Estimated code review effort: 3 (Moderate) | ~25 minutes

🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 41.18% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (14 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: API-backed disk type availability validation for GCP.
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.
Stable And Deterministic Test Names ✅ Passed All added/changed test titles are static table names; no dynamic IDs, timestamps, or generated values appear in titles.
Test Structure And Quality ✅ Passed No Ginkgo or cluster-interacting tests were added; the new table-driven unit tests are single-purpose, need no cleanup/timeouts, and match repo style.
Microshift Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the touched tests are standard Go unit tests with no MicroShift-sensitive OpenShift APIs.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PASS: The PR only adds/updates Go unit tests in pkg/...; no Ginkgo e2e tests or multi-node assumptions were added.
Topology-Aware Scheduling Compatibility ✅ Passed PR only changes GCP disk-type validation/tests; no deployment manifests, controllers, or topology-aware scheduling constraints were modified.
Ote Binary Stdout Contract ✅ Passed No main/init/TestMain/BeforeSuite stdout writes were added; searches found no fmt.Print/klog stdout calls in the modified code.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the changed tests are unit tests and show no public-network or IPv4-only assumptions.
No-Weak-Crypto ✅ Passed No weak crypto, custom crypto, or unsafe secret comparisons were added in the touched GCP/Azure/system files; only API validation and tests changed.
Container-Privileges ✅ Passed The PR only changes GCP validation Go code/tests; no manifests or container security fields like privileged, hostPID, or allowPrivilegeEscalation are introduced.
No-Sensitive-Data-In-Logs ✅ Passed No new log lines expose passwords, tokens, PII, internal hostnames, or customer data; added logs only reference instance/disk types and a credentials file path.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci
openshift-ci Bot requested review from patrickdillon and rna-afk July 15, 2026 19:21

@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: 4

🧹 Nitpick comments (1)
pkg/types/gcp/platform.go (1)

216-228: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low value

Minor: avoid rebuilding the prefix set on every call.

sets.New(sovereignCloudProjectPrefixes...) allocates a new set from the same static slice on every GetCloudEnvironment call. With only one entry today the cost is trivial, but it's wasted work on a function invoked repeatedly during defaulting/validation. Consider hoisting the set to a package-level var.

♻️ Suggested refactor
 var (
 	// sovereignCloudProjectPrefixes contains known project ID prefixes for sovereign clouds.
 	// Project IDs in sovereign clouds use the format: <prefix>:<project-id>
 	// This list helps distinguish from organization-scoped public GCP projects (orgname:project-id).
 	sovereignCloudProjectPrefixes = []string{
 		"eu0", // European sovereign cloud (Germany)
 	}
+	sovereignCloudProjectPrefixSet = sets.New(sovereignCloudProjectPrefixes...)
 )

 func GetCloudEnvironment(projectID string) string {
 	if strings.Contains(projectID, ":") {
 		parts := strings.SplitN(projectID, ":", 2)
-		if len(parts) == 2 && sets.New(sovereignCloudProjectPrefixes...).Has(parts[0]) {
+		if len(parts) == 2 && sovereignCloudProjectPrefixSet.Has(parts[0]) {
 			return CloudEnvironmentSovereign
 		}
 	}
 	return ""
 }
🤖 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/types/gcp/platform.go` around lines 216 - 228, Hoist the set built from
sovereignCloudProjectPrefixes into a package-level variable, then update
GetCloudEnvironment to reuse that variable instead of calling sets.New on each
invocation. Preserve the existing prefix parsing and CloudEnvironmentSovereign
return behavior.
🤖 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/installconfig/gcp/client.go`:
- Around line 230-267: Add direct unit tests for Client.GetDiskTypeWithZones
covering 404 responses that continue to later zones, accumulation of all
successful zone names, empty-region handling, and propagation of non-404 API
errors. Mock the compute service and GetZones dependencies while preserving the
method’s existing behavior and return values.

In `@pkg/asset/installconfig/gcp/validation.go`:
- Around line 249-251: Update the sovereign-cloud branch in the relevant
instance-type validation function to account for arch instead of always
returning c3-standard-4. For ARM64, select a sovereign-supported ARM instance
family or explicitly reject the unsupported default; preserve the existing
c3-standard-4 behavior only for architectures it supports and keep validation
consistent with the c3 ARM64 restriction.

In `@pkg/clusterapi/system.go`:
- Around line 310-321: Remove the later duplicate GetUniverseDomain handling
block following the new guarded logic in the surrounding setup function. Keep
the existing universeDomain retrieval and gcp.IsNonDefaultUniverseDomain check
as the sole source of GOOGLE_CLOUD_UNIVERSE_DOMAIN configuration, including its
error handling and logging.

In `@pkg/types/gcp/platform.go`:
- Around line 211-235: Add focused tests covering GetCloudEnvironment
sovereign-prefix detection and public/unknown project IDs,
IsNonDefaultUniverseDomain for empty, default, and custom domains, and
DefaultDiskTypeForInstanceAndProjectID plus SetMachinePoolDefaults for sovereign
disk selection and public/fallback behavior. Update tests in
pkg/types/gcp/platform.go (lines 211-235), pkg/types/gcp/machinepools.go (lines
375-412), and pkg/types/gcp/defaults/machinepool.go (line 38); no production
changes are required.

---

Nitpick comments:
In `@pkg/types/gcp/platform.go`:
- Around line 216-228: Hoist the set built from sovereignCloudProjectPrefixes
into a package-level variable, then update GetCloudEnvironment to reuse that
variable instead of calling sets.New on each invocation. Preserve the existing
prefix parsing and CloudEnvironmentSovereign return 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 YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 97589c8c-5219-485f-ac96-50c5b9fea387

📥 Commits

Reviewing files that changed from the base of the PR and between 8eb9219 and 99d0f13.

📒 Files selected for processing (13)
  • pkg/asset/installconfig/azure/mock/azureclient_generated.go
  • pkg/asset/installconfig/gcp/client.go
  • pkg/asset/installconfig/gcp/mock/gcpclient_generated.go
  • pkg/asset/installconfig/gcp/session.go
  • pkg/asset/installconfig/gcp/validation.go
  • pkg/asset/installconfig/gcp/validation_test.go
  • pkg/asset/machines/clusterapi.go
  • pkg/asset/machines/master.go
  • pkg/asset/machines/worker.go
  • pkg/clusterapi/system.go
  • pkg/types/gcp/defaults/machinepool.go
  • pkg/types/gcp/machinepools.go
  • pkg/types/gcp/platform.go

Comment thread pkg/asset/installconfig/gcp/client.go
Comment thread pkg/asset/installconfig/gcp/validation.go Outdated
Comment thread pkg/clusterapi/system.go Outdated
Comment thread pkg/types/gcp/platform.go Outdated
@barbacbd

Copy link
Copy Markdown
Contributor Author

/cc @rochacbruno

@openshift-ci
openshift-ci Bot requested a review from rochacbruno July 16, 2026 10:29
Comment thread pkg/asset/installconfig/gcp/session.go Outdated
@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 20, 2026
@barbacbd
barbacbd requested a review from rna-afk July 20, 2026 21:33
@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 20, 2026
Comment thread pkg/asset/machines/worker.go Outdated

func defaultGCPMachinePoolPlatform(arch types.Architecture) gcptypes.MachinePool {
instanceType := icgcp.DefaultInstanceTypeForArch(arch)
func defaultGCPMachinePoolPlatform(arch types.Architecture, projectID, region string) gcptypes.MachinePool {

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.

Suggested change
func defaultGCPMachinePoolPlatform(arch types.Architecture, projectID, region string) gcptypes.MachinePool {
func defaultGCPMachinePoolPlatform(arch types.Architecture, projectID) gcptypes.MachinePool {

We can remove region as it is unused, right?

Comment thread pkg/clusterapi/system.go Outdated
Comment on lines +317 to +319
if gcp.IsNonDefaultUniverseDomain(universeDomain) {
capgEnvVars["GOOGLE_CLOUD_UNIVERSE_DOMAIN"] = universeDomain
logrus.Infof("setting GOOGLE_CLOUD_UNIVERSE_DOMAIN to %s for capg infrastructure controller", universeDomain)

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.

Did you mean to include this change or it should be removed to limit the PR scope to disk validations?

Comment thread pkg/types/gcp/platform.go Outdated
Comment on lines +225 to +232
// Check if project ID has a known sovereign cloud prefix
if strings.Contains(projectID, ":") {
parts := strings.SplitN(projectID, ":", 2)
if len(parts) == 2 && sets.New(sovereignCloudProjectPrefixes...).Has(parts[0]) {
// Known sovereign prefix is definitive - this IS a sovereign cloud project
return CloudEnvironmentSovereign
}
}

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.

We can skip the strings.Contains(projectID, ":") check because strings.splitN will return 1 part without :, thus making the if on line 228 false (same as GetDefaultServiceAccount).

// Domain-scoped project IDs (e.g. "eu0:openshift") use a reversed
// dot-separated format in SA emails: "openshift.eu0".
if parts := strings.SplitN(projectID, ":", 2); len(parts) == 2 && sets.New(sovereignCloudProjectPrefixes...).Has(parts[0]) {
  // Known sovereign prefix is definitive - this IS a sovereign cloud project
  return CloudEnvironmentSovereign
}

Comment thread pkg/types/gcp/machinepools.go Outdated
Comment on lines +383 to +392
func DefaultDiskTypeForInstanceAndProjectID(instanceType, projectID string) string {
defaultDiskType := PDSSD
diskTypes, ok := GetDiskTypes(instanceType)
if ok {
supportedDiskTypes := sets.New(diskTypes...)
switch {
case supportedDiskTypes.Has(PDSSD):
defaultDiskType = PDSSD
case supportedDiskTypes.Has(HyperDiskBalanced):
defaultDiskType = HyperDiskBalanced
default:
// this shouldn't happen because all supported instance types
// have either pd-ssd or hyperdisk balanced
defaultDiskType = diskTypes[0]
cloudEnv := GetCloudEnvironment(projectID)

// Sovereign cloud prefers hyperdisk-balanced
if cloudEnv == CloudEnvironmentSovereign {
switch {

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.

I notice the two branches differ only in preference order. How about below where we define a precedence slice of disk types?

func DefaultDiskTypeForInstanceAndProjectID(instanceType, projectID string) string {
	diskTypes, ok := GetDiskTypes(instanceType)
	if !ok {
		return PDSSD
	}

	preferred := []string{PDSSD, HyperDiskBalanced}
	if GetCloudEnvironment(projectID) == CloudEnvironmentSovereign {
		preferred = []string{HyperDiskBalanced, PDSSD}
	}

	supportedDiskTypes := sets.New(diskTypes...)
	for _, dt := range preferred {
		if supportedDiskTypes.Has(dt) {
			return dt
		}
	}
	return diskTypes[0]
}

Comment on lines +214 to +220
userZones := sets.New(zones...)
if len(userZones) > 0 {
if diff := userZones.Difference(dtZones); len(diff) > 0 {
errMsg := fmt.Sprintf("disk type %s is not available in zones: %v", diskType, sets.List(diff))
allErrs = append(allErrs, field.Invalid(fieldPath.Child("diskType"), diskType, errMsg))
}
}

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.

When the user doesn't define zones, the installer defaults to use zones where machine type is available, right 👇?

userZones := sets.New(zones...)
if len(userZones) == 0 {
userZones = typeZones
}
if diff := userZones.Difference(typeZones); len(diff) > 0 {
errMsg := fmt.Sprintf("instance type not available in zones: %v", sets.List(diff))
allErrs = append(allErrs, field.Invalid(fieldPath.Child("type"), instanceType, errMsg))
}

In that case, the base zone list (if not defined by users) should be zones where machine type is available. For example, we can:

// Move validateDiskTypeAvailability call after line 171
// Variable userZones is either user-defined or default zones
// where machine type is available so we should pass that in
// instead of variable zones.
allErrs = append(allErrs, validateDiskTypeAvailability(client,
  fieldPath, project, region,
  sets.List(userZones), // We use the userZones variable instead of zones
  diskType)...)

Comment on lines +205 to +206
logrus.Warnf("Unable to validate disk type %s availability: %v", diskType, err)
return allErrs

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.

I think non-API errors (e.g. DNS failures, TCP timeouts, TLS handshake errors, etc) should fail the validation right? That is: field.InternalError.

We should fail fast so bad combination won't come up late during machine provisioning 🤔

Comment on lines +868 to +879
if isSovereignCloud && osImage.Project == "" {
allErrs = append(allErrs, field.Required(
field.NewPath("controlPlane", "platform", "gcp", "osImage", "project"),
"must specify image project for sovereign cloud"))
}
if osImage.Project != "" {
image, err = client.GetImage(context.TODO(), osImage.Name, osImage.Project)
if err != nil {
allErrs = append(allErrs, field.Invalid(field.NewPath("controlPlane", "platform", "gcp", "osImage"), *osImage, fmt.Sprintf(errorMessage, err)))
}
}
} else if isSovereignCloud && defaultOsImage == nil {

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.

I guess we can drop the validations that requires BYO osImage in GCD since we have #10686, right?

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.

If we plan to keep only if isSovereignCloud && osImage.Project == "". Then, we should only validate it for controlPlane and compute pool since users can populate directly.

Also, defaultMachinePlatform is already merged into each controlPlane and compute pool before validation runs. So, by the time validateInstanceTypes runs, each controlPlane and compute pool already has the defaultMachinePlatform values baked in.

func Apply(defaultMachinePlatform, machinePool *gcp.MachinePool) {
tempMP := &gcp.MachinePool{}
tempMP.Set(defaultMachinePlatform)
tempMP.Set(machinePool)
machinePool.Set(tempMP)
}

Comment thread pkg/asset/installconfig/gcp/validation_test.go

@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/asset/installconfig/gcp/validation.go`:
- Around line 201-206: Update the disk lookup error handling in
pkg/asset/installconfig/gcp/validation.go lines 201-206: preserve the
googleapi.Error validation error, but log a warning and return no
disk-availability field error for other failures. Update the network-timeout
expectation in pkg/asset/installconfig/gcp/validation_test.go lines 1451-1455 to
assert that validation succeeds without an error.
🪄 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 YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: b604c75e-b166-4cb5-bcaa-da7855b17d8f

📥 Commits

Reviewing files that changed from the base of the PR and between ebdaf3f and b92812e.

📒 Files selected for processing (8)
  • pkg/asset/installconfig/azure/mock/azureclient_generated.go
  • pkg/asset/installconfig/gcp/client.go
  • pkg/asset/installconfig/gcp/mock/gcpclient_generated.go
  • pkg/asset/installconfig/gcp/validation.go
  • pkg/asset/installconfig/gcp/validation_test.go
  • pkg/clusterapi/system.go
  • pkg/types/gcp/machinepools_test.go
  • pkg/types/gcp/platform_test.go
💤 Files with no reviewable changes (1)
  • pkg/clusterapi/system.go
🚧 Files skipped from review as they are similar to previous changes (5)
  • pkg/types/gcp/machinepools_test.go
  • pkg/asset/installconfig/azure/mock/azureclient_generated.go
  • pkg/asset/installconfig/gcp/mock/gcpclient_generated.go
  • pkg/types/gcp/platform_test.go
  • pkg/asset/installconfig/gcp/client.go

Comment thread pkg/asset/installconfig/gcp/validation.go
Comment thread pkg/clusterapi/system.go
Comment on lines -315 to -319
// Google Cloud Dedicated support: detect universe domain from
// credentials and pass it to the CAPG controller via env var.
ud, err := session.Credentials.GetUniverseDomain()
if err != nil {
return fmt.Errorf("failed to get universe domain from gcp credentials: %w", err)

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.

Maybe we don't wanna remove this code block. Let's drop the changes in this file?

Disk type validation was previously entirely static, relying on
hardcoded maps that encode which disk types are compatible with which
instance families. This works for public GCP where all standard disk
types are available in every region, but fails for sovereign clouds
where regional availability differs.

This change adds an API-backed availability check that queries each
zone individually via DiskTypes.Get, following the existing pattern
established by GetMachineTypeWithZones for machine type validation.

The two validation layers are complementary:

1. Static check (validateInstanceAndDiskType): Is this disk type
   compatible with this instance family? Catches combinations that
   never work anywhere.

2. API check (validateDiskTypeAvailability): Is this disk type
   available in this specific region and zones? Catches disk types
   that are valid in general but unavailable in the target region.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@patrickdillon

Copy link
Copy Markdown
Contributor

/lgtm
/approve
/verified by unit

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Jul 22, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@patrickdillon: This PR has been marked as verified by unit.

Details

In response to this:

/lgtm
/approve
/verified by unit

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.

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 22, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e-azure-nat-gateway-single-zone

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-azure-default-config
/test e2e-azure-ovn
/test e2e-azure-ovn-shared-vpc
/test e2e-azurestack
/test e2e-gcp-custom-dns
/test e2e-gcp-custom-endpoints
/test e2e-gcp-default-config
/test e2e-gcp-ovn
/test e2e-gcp-ovn-byo-vpc
/test e2e-gcp-ovn-xpn
/test e2e-gcp-secureboot
/test e2e-gcp-xpn-custom-dns
/test e2e-gcp-xpn-dedicated-dns-project
/test e2e-aws-ovn

@openshift-ci

openshift-ci Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: patrickdillon

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 22, 2026

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

/lgtm

Let's get some e2e runs to see whether this change requires any new permissions 👀

@barbacbd

Copy link
Copy Markdown
Contributor Author

/label acknowledge-critical-fixes-only

@openshift-ci openshift-ci Bot added the acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. label Jul 23, 2026
@barbacbd

Copy link
Copy Markdown
Contributor Author

/retest-required

1 similar comment
@tthvo

tthvo commented Jul 23, 2026

Copy link
Copy Markdown
Member

/retest-required

@openshift-ci

openshift-ci Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

@barbacbd: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-gcp-custom-endpoints a789f94 link false /test e2e-gcp-custom-endpoints
ci/prow/e2e-gcp-ovn-byo-vpc a789f94 link false /test e2e-gcp-ovn-byo-vpc
ci/prow/e2e-azurestack a789f94 link false /test e2e-azurestack
ci/prow/e2e-azure-ovn-shared-vpc a789f94 link false /test e2e-azure-ovn-shared-vpc
ci/prow/e2e-gcp-custom-dns a789f94 link false /test e2e-gcp-custom-dns
ci/prow/e2e-gcp-ovn-xpn a789f94 link false /test e2e-gcp-ovn-xpn
ci/prow/gcp-custom-endpoints-proxy-wif a789f94 link false /test gcp-custom-endpoints-proxy-wif
ci/prow/azure-ovn-marketplace-images a789f94 link false /test azure-ovn-marketplace-images
ci/prow/e2e-gcp-xpn-custom-dns a789f94 link false /test e2e-gcp-xpn-custom-dns
ci/prow/e2e-gcp-xpn-dedicated-dns-project a789f94 link false /test e2e-gcp-xpn-dedicated-dns-project
ci/prow/e2e-gcp-secureboot a789f94 link false /test e2e-gcp-secureboot

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.

@openshift-merge-bot
openshift-merge-bot Bot merged commit 15956c8 into openshift:main Jul 23, 2026
22 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants