Skip to content

OCPBUGS-122133: gcp: skip disk type check when the permission is denied - #10862

Merged
openshift-merge-bot[bot] merged 2 commits into
openshift:release-4.22from
barbacbd:release-4.22-disk-type-403
Sep 10, 2026
Merged

OCPBUGS-122133: gcp: skip disk type check when the permission is denied#10862
openshift-merge-bot[bot] merged 2 commits into
openshift:release-4.22from
barbacbd:release-4.22-disk-type-403

Conversation

@barbacbd

@barbacbd barbacbd commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

The disk type availability check queries compute.diskTypes.get once per
zone. Service accounts holding only the documented minimum install
permissions do not have that permission, so the lookup returns 403 and
the install fails before any resource is created:

  platform.gcp.defaultMachinePlatform.diskType: Invalid value: "pd-ssd":
  googleapi: Error 403: Required 'compute.diskTypes.get' permission

The disk type is valid; only the check is unavailable. Reading a disk
type is not needed to install, so treat a denial the same way as a
backend error and skip the check rather than report a bad value.

This PR also includes the backport for 9fb3564.

Summary by CodeRabbit

  • Bug Fixes
    • Disk type validation now continues when Google Cloud verification encounters permission-related, service-unavailable, or other server-side failures.
    • These recoverable issues are reported as warnings instead of blocking validation.
    • Invalid disk type requests continue to produce validation errors.

patrickdillon and others added 2 commits September 9, 2026 12:42
Add 500-type errors, such as 503 Service Unavailable to the
graceful handling of the disk type validation. The disk type
validation is supposed to prevent known failures, but if for some
reason the API call fails we do not want that in and of itself to
be fatal.

That was the original design of the validation, this commit just
adds 503 to that handling.

(cherry picked from commit 9fb3564)
The disk type availability check queries compute.diskTypes.get once per
zone. Service accounts holding only the documented minimum install
permissions do not have that permission, so the lookup returns 403 and
the install fails before any resource is created:

  platform.gcp.defaultMachinePlatform.diskType: Invalid value: "pd-ssd":
  googleapi: Error 403: Required 'compute.diskTypes.get' permission

The disk type is valid; only the check is unavailable. Reading a disk
type is not needed to install, so treat a denial the same way as a
backend error and skip the check rather than report a bad value.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@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 jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Sep 9, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@barbacbd: This pull request references Jira Issue OCPBUGS-122133, which is invalid:

  • expected the bug to target the "4.22.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

The disk type availability check queries compute.diskTypes.get once per
zone. Service accounts holding only the documented minimum install
permissions do not have that permission, so the lookup returns 403 and
the install fails before any resource is created:

 platform.gcp.defaultMachinePlatform.diskType: Invalid value: "pd-ssd":
 googleapi: Error 403: Required 'compute.diskTypes.get' permission

The disk type is valid; only the check is unavailable. Reading a disk
type is not needed to install, so treat a denial the same way as a
backend error and skip the check rather than report a bad value.

This PR also includes the backport for 9fb3564.

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 Sep 9, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 13657276-9637-4bd4-9071-a42f015cf481

📥 Commits

Reviewing files that changed from the base of the PR and between dd98639 and 5eab363.

📒 Files selected for processing (2)
  • pkg/asset/installconfig/gcp/validation.go
  • pkg/asset/installconfig/gcp/validation_test.go

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.


Walkthrough

Disk type availability validation now reports only fatal client errors. Permission failures, server errors, and non-API failures produce warnings and allow validation to continue. Tests cover error classification and warning output.

Changes

GCP disk type validation

Layer / File(s) Summary
Disk type error handling and coverage
pkg/asset/installconfig/gcp/validation.go, pkg/asset/installconfig/gcp/validation_test.go
The validator reports Google API errors below HTTP 500 except HTTP 403. It logs warnings for HTTP 403, server errors, and non-API failures. Tests verify validation errors, warning output, and graceful continuation.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 5eab3

GCP disk-type validation now allows installation to continue when availability cannot be verified because of permission, server, or lookup failures, while retaining validation for actionable client errors. The change is covered by targeted error-classification tests and is ready to merge.

🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. 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 describes the main change: skip the GCP disk type check when permission is denied.
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 The pull request adds three static subtest names: “GCP 403 permission denied degrades gracefully”, “GCP 503 server error degrades gracefully”, and “Non-API error degrades gracefully”. The titles conta…
Test Structure And Quality ✅ Passed PASS: The changed tests are ordinary table-driven Go unit tests (TestValidateDiskTypeAvailability with t.Run), not Ginkgo tests. They use a mocked API and log hook; they create no cluster resource…
Microshift Test Compatibility ✅ Passed The check is not applicable. The pull request changes only pkg/asset/installconfig/gcp/validation.go and validation_test.go. The added tests use the standard Go testing.T style (`TestValidateDis…
Single Node Openshift (Sno) Test Compatibility ✅ Passed The pull request adds no Ginkgo e2e tests. The only test changes are in pkg/asset/installconfig/gcp/validation_test.go, which uses the standard Go testing.T framework and modifies table cases for …
Topology-Aware Scheduling Compatibility ✅ Passed PASS: The pull request changes only GCP disk-type validation and its tests. The committed diff adds HTTP error handling and warning behavior; it does not add or modify deployment manifests, operators,…
Ote Binary Stdout Contract ✅ Passed PASS: The pull request adds only HTTP status handling and a logrus.Warnf call in validateDiskTypeAvailability. It adds no fmt.Print*, log.Print*, klog, Ginkgo, or direct stdout write. The ve…
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PASS: The pull request adds no Ginkgo e2e tests. The changed test remains a standard Go testing table test with t.Run, mocked GetDiskTypeWithZones responses, and log assertions. The added lines …
No-Weak-Crypto ✅ Passed PASS: The pull request changes GCP API error handling by adding net/http, excluding HTTP 403 from validation errors, and updating tests. The changed lines introduce no MD5, SHA1, DES, RC4, Blowfish,…
Container-Privileges ✅ Passed PASS: The pull request changes only pkg/asset/installconfig/gcp/validation.go and validation_test.go. The diff adds HTTP error handling and tests; it does not change a container or Kubernetes mani…
No-Sensitive-Data-In-Logs ✅ Passed The new warning logs the disk type, GCP region, and verification error. The changed code does not log credentials, tokens, API keys, PII, session IDs, or customer payloads. The request authentication …
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Some tools did not complete. Review the errors below.

🔧 golangci-lint (2.13.2)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


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

@barbacbd

barbacbd commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

/cc @patrickdillon
/cc @rochacbruno

@barbacbd

barbacbd commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Sep 9, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@barbacbd: This pull request references Jira Issue OCPBUGS-122133, which is valid. The bug has been moved to the POST state.

7 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)
  • release note text is set and does not match the template
  • dependent bug Jira Issue OCPBUGS-122132 is in the state Verified, which is one of the valid states (MODIFIED, ON_QA, VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA))
  • dependent Jira Issue OCPBUGS-122132 targets the "5.0.0" version, which is one of the valid target versions: 5.0.0
  • bug has dependents
Details

In response to this:

/jira refresh

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 requested a review from jhixson74 September 9, 2026 17:39
@tthvo

tthvo commented Sep 9, 2026

Copy link
Copy Markdown
Member

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@barbacbd: This pull request references Jira Issue OCPBUGS-122133, which is valid.

7 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)
  • release note text is set and does not match the template
  • dependent bug Jira Issue OCPBUGS-122132 is in the state Verified, which is one of the valid states (MODIFIED, ON_QA, VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA))
  • dependent Jira Issue OCPBUGS-122132 targets the "5.0.0" version, which is one of the valid target versions: 5.0.0
  • bug has dependents
Details

In response to this:

The disk type availability check queries compute.diskTypes.get once per
zone. Service accounts holding only the documented minimum install
permissions do not have that permission, so the lookup returns 403 and
the install fails before any resource is created:

 platform.gcp.defaultMachinePlatform.diskType: Invalid value: "pd-ssd":
 googleapi: Error 403: Required 'compute.diskTypes.get' permission

The disk type is valid; only the check is unavailable. Reading a disk
type is not needed to install, so treat a denial the same way as a
backend error and skip the check rather than report a bad value.

This PR also includes the backport for 9fb3564.

Summary by CodeRabbit

  • Bug Fixes
  • Disk type validation now continues when Google Cloud verification encounters permission-related, service-unavailable, or other server-side failures.
  • These recoverable issues are reported as warnings instead of blocking validation.
  • Invalid disk type requests continue to produce validation errors.

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.

@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

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

Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/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

@rochacbruno

Copy link
Copy Markdown
Member

/approve

@tthvo

tthvo commented Sep 9, 2026

Copy link
Copy Markdown
Member

/approve

On behalf of Bruno, since owner file is not updated in 4.22 :D

@openshift-ci

openshift-ci Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rochacbruno, tthvo

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 Sep 9, 2026
@tthvo

tthvo commented Sep 10, 2026

Copy link
Copy Markdown
Member

/test e2e-gcd-ovn-private-techpreview

@openshift-ci

openshift-ci Bot commented Sep 10, 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-secureboot 5eab363 link false /test e2e-gcp-secureboot
ci/prow/e2e-gcp-ovn-xpn 5eab363 link false /test e2e-gcp-ovn-xpn
ci/prow/e2e-gcp-xpn-custom-dns 5eab363 link false /test e2e-gcp-xpn-custom-dns
ci/prow/gcp-custom-endpoints-proxy-wif 5eab363 link false /test gcp-custom-endpoints-proxy-wif
ci/prow/e2e-gcp-ovn-byo-vpc 5eab363 link false /test e2e-gcp-ovn-byo-vpc
ci/prow/e2e-gcp-custom-endpoints 5eab363 link false /test e2e-gcp-custom-endpoints

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.

@barbacbd

Copy link
Copy Markdown
Contributor Author

/verified by unit

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

Copy link
Copy Markdown
Contributor

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

Details

In response to this:

/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.

@sadasu

sadasu commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

/label backport-risk-assessed

@openshift-ci openshift-ci Bot added the backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. label Sep 10, 2026
@openshift-merge-bot
openshift-merge-bot Bot merged commit cdaf698 into openshift:release-4.22 Sep 10, 2026
23 of 29 checks passed
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@barbacbd: Jira Issue Verification Checks: Jira Issue OCPBUGS-122133
✔️ This pull request was pre-merge verified.
✔️ All associated pull requests have merged.
✔️ All associated, merged pull requests were pre-merge verified.

Jira Issue OCPBUGS-122133 has been moved to the MODIFIED state and will move to the VERIFIED state when the change is available in an accepted nightly payload. 🕓

Details

In response to this:

The disk type availability check queries compute.diskTypes.get once per
zone. Service accounts holding only the documented minimum install
permissions do not have that permission, so the lookup returns 403 and
the install fails before any resource is created:

 platform.gcp.defaultMachinePlatform.diskType: Invalid value: "pd-ssd":
 googleapi: Error 403: Required 'compute.diskTypes.get' permission

The disk type is valid; only the check is unavailable. Reading a disk
type is not needed to install, so treat a denial the same way as a
backend error and skip the check rather than report a bad value.

This PR also includes the backport for 9fb3564.

Summary by CodeRabbit

  • Bug Fixes
  • Disk type validation now continues when Google Cloud verification encounters permission-related, service-unavailable, or other server-side failures.
  • These recoverable issues are reported as warnings instead of blocking validation.
  • Invalid disk type requests continue to produce validation errors.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. 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.

6 participants