Skip to content

OCPSTRAT-3624: Add GCP disk license passthrough support - #184

Open
redhat-chai-bot wants to merge 2 commits into
openshift:mainfrom
redhat-chai-bot:mapi-gcp-disk-licenses
Open

OCPSTRAT-3624: Add GCP disk license passthrough support#184
redhat-chai-bot wants to merge 2 commits into
openshift:mainfrom
redhat-chai-bot:mapi-gcp-disk-licenses

Conversation

@redhat-chai-bot

@redhat-chai-bot redhat-chai-bot commented Aug 13, 2026

Copy link
Copy Markdown

Summary

Passes Licenses from the GCPDisk spec through to compute.AttachedDiskInitializeParams.Licenses when creating GCP instances via the Machine API reconciler.

This enables specifying GCP license self-link URLs (e.g. for on-demand Windows licensing on bare metal nodes) in the Machine spec, which are then applied to the disk during instance provisioning.

Changes

  • reconciler.go: Added Licenses: disk.Licenses to the AttachedDiskInitializeParams struct construction (~line 332)
  • reconciler_test.go: Added 2 test cases:
    • Disk licenses are passed through to the GCP API call — verifies populated licenses flow through
    • Nil disk licenses preserves existing behavior — verifies backward compatibility
  • vendor/.../types_gcpprovider.go: Temporarily added Licenses []string to the vendored GCPDisk struct (pending openshift/api#2980 merge and vendor bump)

Dependencies

Jira

OCPSTRAT-3624

Note

GCP documentation states the AttachedDiskInitializeParams.Licenses field may be reserved for Google's use. CI/E2E testing will determine whether this approach works for on-demand Windows licensing. If not, an alternative approach (creating a standalone disk with licenses via disks.insert, then attaching it) would be needed."


AI-generated. Review for accuracy.

@damdo requested in Slack thread

Summary by CodeRabbit

  • Bug Fixes

    • Disk license information is now preserved when creating GCP compute instances.
    • Disks without license information continue to be created without assigned licenses.
  • Tests

    • Added coverage for disks with and without license lists.

Pass the Licenses field from GCPDisk spec through to the GCP
AttachedDiskInitializeParams when creating instances. This enables
users to specify license URLs on disks for BYOL and software
licensing tracking scenarios.

The vendored openshift/api GCPDisk struct is temporarily updated
to include the Licenses field, pending the merge of openshift/api#2980.

Co-Authored-By: Claude Opus 4.6 <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 the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 13, 2026
@openshift-ci-robot

openshift-ci-robot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

@redhat-chai-bot: This pull request references OCPSTRAT-3624 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 feature to target either version "5.0.0." or "openshift-5.0.0.", but it targets "openshift-5.1" instead.

Details

In response to this:

Summary

Passes Licenses from the GCPDisk spec through to compute.AttachedDiskInitializeParams.Licenses when creating GCP instances via the Machine API reconciler.

This enables specifying GCP license self-link URLs (e.g. for on-demand Windows licensing on bare metal nodes) in the Machine spec, which are then applied to the disk during instance provisioning.

Changes

  • reconciler.go: Added Licenses: disk.Licenses to the AttachedDiskInitializeParams struct construction (~line 332)
  • reconciler_test.go: Added 2 test cases:
  • Disk licenses are passed through to the GCP API call — verifies populated licenses flow through
  • Nil disk licenses preserves existing behavior — verifies backward compatibility
  • vendor/.../types_gcpprovider.go: Temporarily added Licenses []string to the vendored GCPDisk struct (pending openshift/api#2980 merge and vendor bump)

Dependencies

Jira

OCPSTRAT-3624

Note

GCP documentation states the AttachedDiskInitializeParams.Licenses field may be reserved for Google's use. CI/E2E testing will determine whether this approach works for on-demand Windows licensing. If not, an alternative approach (creating a standalone disk with licenses via disks.insert, then attaching it) would be needed."


AI-generated. Review for accuracy.

@damdo requested in Slack thread

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 Aug 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@redhat-chai-bot, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 85 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: 0f004fea-e7d1-4f76-b5e6-6d2930c1a5fd

📥 Commits

Reviewing files that changed from the base of the PR and between d0954e8 and 3bbcea1.

⛔ Files ignored due to path filters (38)
  • go.sum is excluded by !**/*.sum
  • vendor/github.com/openshift/api/config/v1/types_authentication.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/types_infrastructure.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/types_ingress.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/types_kmsencryption.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-CustomNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-DevPreviewNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-TechPreviewNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-CustomNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-Default.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-DevPreviewNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-OKD.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-TechPreviewNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_criocredentialproviderconfigs-Hypershift.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_criocredentialproviderconfigs-SelfManagedHA.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-Default.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-Hypershift-CustomNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-Hypershift-DevPreviewNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-Hypershift-TechPreviewNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-OKD.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-SelfManagedHA-CustomNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-SelfManagedHA-DevPreviewNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-TechPreviewNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_ingresses-CustomNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_ingresses-DevPreviewNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_ingresses-TechPreviewNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.featuregated-crd-manifests.yaml is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/config/v1alpha1/types_cluster_monitoring.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1alpha1/zz_generated.deepcopy.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/config/v1alpha1/zz_generated.model_name.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/config/v1alpha1/zz_generated.swagger_doc_generated.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/features/features.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/features/legacyfeaturegates.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/machine/v1beta1/types_gcpprovider.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/machine/v1beta1/zz_generated.deepcopy.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/machine/v1beta1/zz_generated.swagger_doc_generated.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/modules.txt is excluded by !**/vendor/**, !vendor/**
📒 Files selected for processing (1)
  • go.mod

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: Pro Plus

Run ID: 833de6df-1663-433b-b8c4-def141bb32ba

📥 Commits

Reviewing files that changed from the base of the PR and between 91033fc and d0954e8.

⛔ Files ignored due to path filters (1)
  • vendor/github.com/openshift/api/machine/v1beta1/types_gcpprovider.go is excluded by !**/vendor/**, !vendor/**
📒 Files selected for processing (2)
  • pkg/cloud/gcp/actuators/machine/reconciler.go
  • pkg/cloud/gcp/actuators/machine/reconciler_test.go

Walkthrough

The machine reconciler now forwards provider disk licenses to GCP disk initialization requests. Tests verify configured licenses and omitted license lists.

Changes

Disk license propagation

Layer / File(s) Summary
Map disk licenses into initialization requests
pkg/cloud/gcp/actuators/machine/reconciler.go, pkg/cloud/gcp/actuators/machine/reconciler_test.go
Disk initialization copies configured Licenses to the GCP request. TestCreate covers configured licenses and disks without licenses.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Mergeability Score: ⚪ Minimal · up to d0954

This localized change passes configured GCP disk licenses through during instance creation while preserving nil behavior; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding GCP disk license passthrough support.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 added subtest names are static descriptive strings and contain no generated IDs, timestamps, node or namespace names, IPs, or other run-dependent values.
Test Structure And Quality ✅ Passed Added TestCreate cases are isolated t.Run unit tests with fake clients, no cluster waits or resources, and diagnostic assertions for populated and nil licenses.
Microshift Test Compatibility ✅ Passed The PR adds ordinary Go TestCreate table cases, not Ginkgo e2e tests; the added lines contain no unavailable MicroShift APIs or unsupported assumptions.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The PR adds only table-driven Go unit cases in TestCreate; no new Ginkgo e2e tests or multi-node/HA assumptions are present in the diff.
Topology-Aware Scheduling Compatibility ✅ Passed The diff only adds GCP disk license propagation, tests, and a vendored API field; it introduces no replicas, affinity, topology spread, selectors, tolerations, or PDB constraints.
Ote Binary Stdout Contract ✅ Passed The diff adds only a Licenses assignment, test assertions, and a vendored type field; it introduces no process-level stdout writes or logging setup changes.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The PR adds standard Go table-driven cases in TestCreate, not Ginkgo e2e tests; added lines contain no IPv4 assumptions or external connectivity.
No-Weak-Crypto ✅ Passed The PR diff only adds GCP disk license passthrough, tests, and an API field. No MD5, SHA1, DES, RC4, 3DES, Blowfish, ECB, custom crypto, or secret comparisons were introduced.
Container-Privileges ✅ Passed The diff changes only Go source, tests, and a vendored API type; it adds no container/Kubernetes manifests or explicit privilege settings.
No-Sensitive-Data-In-Logs ✅ Passed The diff adds only license data assignment, vendored type metadata, and tests; it introduces no logging or sensitive-data output. Existing logs do not include disk licenses.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@openshift-ci
openshift-ci Bot requested review from nrb and theobarberbany August 13, 2026 07:45
@openshift-ci

openshift-ci Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign racheljpg for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@redhat-chai-bot

Copy link
Copy Markdown
Author

/retest

Updated with go.mod replace directive pointing to the openshift/api fork branch (redhat-chai-bot/api@mapi-gcp-disk-licenses). The temporary manual vendor edit has been replaced with a proper fork-sourced version including full validation markers (Pattern, MinItems, MaxItems). All 4 test suites pass locally.


AI-generated. Review for accuracy.

Add go.mod replace directive pointing to the openshift/api fork
branch (redhat-chai-bot/api@mapi-gcp-disk-licenses) which includes
the GCPDisk.Licenses field with Pattern validation. This replaces
the temporary manual vendor edit with the proper vendored version.

The replace directive should be removed once openshift/api#2980
is merged and the dependency is updated normally.

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

openshift-ci Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

@redhat-chai-bot: The following test 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/regression-clusterinfra-gcp-ipi-mapi 3bbcea1 link false /test regression-clusterinfra-gcp-ipi-mapi

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.

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

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants