Skip to content

OCPSTRAT-3624: Add e2e test for GCP disk license passthrough - #492

Open
redhat-chai-bot wants to merge 1 commit into
openshift:masterfrom
redhat-chai-bot:e2e-gcp-disk-licenses
Open

OCPSTRAT-3624: Add e2e test for GCP disk license passthrough#492
redhat-chai-bot wants to merge 1 commit into
openshift:masterfrom
redhat-chai-bot:e2e-gcp-disk-licenses

Conversation

@redhat-chai-bot

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

Copy link
Copy Markdown

Summary

Adds a GCP-specific e2e test that exercises the Licenses field on GCPDisk by creating a MachineSet with a license URL on the boot disk and verifying the machine provisions successfully.

This test will definitively prove whether GCP's AttachedDiskInitializeParams.Licenses field accepts user-specified license URLs at instance creation time, or whether the "reserved for Google's use" documentation means it will be rejected.

Test Details

File: pkg/infra/gcp_disk_licenses.go

The test:

  1. Skips on non-GCP platforms
  2. Clones an existing worker MachineSet's GCP providerSpec
  3. Adds projects/vm-options/global/licenses/enable-vmx to the boot disk's Licenses field
  4. Creates a 1-replica MachineSet
  5. Waits for the Machine to reach Running phase (or captures the GCP API error)
  6. Cleans up via DeferCleanup

Labels: [sig-cluster-lifecycle], LabelMAPI, LabelDisruptive, LabelPeriodic

Dependencies

Jira

OCPSTRAT-3624

Test Results

  • 169/169 unit tests pass
  • 0 lint issues

AI-generated. Review for accuracy.

@damdo requested in Slack thread

Summary by CodeRabbit

  • Tests

    • Added automated GCP validation for boot-disk license handling.
    • The test confirms that configured licenses are correctly applied to newly created machines.
    • Added safeguards for unsupported platforms, setup failures, and cleanup after test execution.
  • Quality Improvements

    • Improved confidence in machine provisioning and provider-specific disk licensing behavior.

Add a GCP-specific e2e test that exercises the new Licenses field on
GCPDisk. The test creates a MachineSet with the enable-vmx license on
the boot disk and verifies the Machine reaches Running phase, proving
GCP accepts custom licenses via InitializeParams.Licenses.

The vendored openshift/api is replaced with the fork branch that
includes the Licenses field addition to the GCPDisk struct.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@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

@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

Adds a GCP-specific e2e test that exercises the Licenses field on GCPDisk by creating a MachineSet with a license URL on the boot disk and verifying the machine provisions successfully.

This test will definitively prove whether GCP's AttachedDiskInitializeParams.Licenses field accepts user-specified license URLs at instance creation time, or whether the "reserved for Google's use" documentation means it will be rejected.

Test Details

File: pkg/infra/gcp_disk_licenses.go

The test:

  1. Skips on non-GCP platforms
  2. Clones an existing worker MachineSet's GCP providerSpec
  3. Adds projects/vm-options/global/licenses/enable-vmx to the boot disk's Licenses field
  4. Creates a 1-replica MachineSet
  5. Waits for the Machine to reach Running phase (or captures the GCP API error)
  6. Cleans up via DeferCleanup

Labels: [sig-cluster-lifecycle], LabelMAPI, LabelDisruptive, LabelPeriodic

Dependencies

Jira

OCPSTRAT-3624

Test Results

  • 169/169 unit tests pass
  • 0 lint issues

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

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: 732665ef-4107-4cf3-a36d-9128bd56adc1

📥 Commits

Reviewing files that changed from the base of the PR and between 6dddd84 and 6d422ee.

⛔ Files ignored due to path filters (33)
  • 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.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/envtest-releases.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/features.md is excluded by !**/vendor/**, !vendor/**
  • 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/github.com/openshift/api/operator/v1/types.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/types_kmsencryption.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/zz_generated.deepcopy.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/operator/v1/zz_generated.model_name.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/operator/v1alpha1/register.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1alpha1/types_ingress.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1alpha1/zz_generated.deepcopy.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/operator/v1alpha1/zz_generated.featuregated-crd-manifests.yaml is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/operator/v1alpha1/zz_generated.model_name.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/operator/v1alpha1/zz_generated.swagger_doc_generated.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/route/v1/generated.proto is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/route/v1/types.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/route/v1/zz_generated.featuregated-crd-manifests.yaml is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/modules.txt is excluded by !**/vendor/**, !vendor/**
📒 Files selected for processing (2)
  • go.mod
  • pkg/infra/gcp_disk_licenses.go

Walkthrough

The change adds a GCP disruptive test for boot-disk licenses, a helper that updates GCP provider specifications, and a Go module replacement for the OpenShift API dependency.

Changes

GCP disk license validation

Layer / File(s) Summary
Provider specification license update
pkg/infra/gcp_disk_licenses.go
Adds setLicensesOnGCPProviderSpec to set licenses on the boot disk and return errors for invalid provider data, missing boot disks, or serialization failures.
GCP MachineSet license test
go.mod, pkg/infra/gcp_disk_licenses.go
Adds the API module replacement and a GCP-gated disruptive test that creates a single-Machine MachineSet, waits for the Machine to run, and verifies the enable-vmx license. Cleans up the MachineSet and gathers failure state.

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

Mergeability Score: 🔵 Low · up to 6d422

The PR adds a GCP-specific end-to-end test and temporarily depends on an API fork; it is mergeable with explicit owner awareness that release-branch approval for that dependency must be confirmed.

Sequence Diagram(s)

sequenceDiagram
  participant GinkgoTest
  participant MachineSet
  participant Machine
  participant ProviderSpec
  GinkgoTest->>MachineSet: create single-Machine MachineSet
  MachineSet->>Machine: create Machine
  GinkgoTest->>Machine: wait for running state
  Machine-->>GinkgoTest: running Machine
  GinkgoTest->>ProviderSpec: read provider specification
  GinkgoTest->>ProviderSpec: verify enable-vmx boot-disk license
Loading

Suggested reviewers: mdbooth


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Microshift Test Compatibility ⚠️ Warning The new Ginkgo test uses machine.openshift.io MachineSet and Machine resources, but its name has no [apigroup:machine.openshift.io] or [Skipped:MicroShift] tag and has no MicroShift guard. Add [apigroup:machine.openshift.io] or [Skipped:MicroShift], or call exutil.IsMicroShiftCluster() and g.Skip(); if needed, run the prescribed MicroShift e2e job.
Ipv6 And Disconnected Network Test Compatibility ⚠️ Warning The new GCP test creates a VM and waits for it to run; the GCP actuator must contact the external GCP Compute API, which matches the explicit external-service failure condition. Run the additional IPv6 CI job. If disconnected GCP environments cannot access the Compute API, add [Skipped:Disconnected] to the test name.
No-Sensitive-Data-In-Logs ❓ Inconclusive The changed test has no direct sensitive log, but its failure-state gatherer may emit resource data; gatherer output behavior requires inspection. Inspect StateGatherer and related framework logging to confirm whether failure handling logs secrets, tokens, PII, hostnames, or customer data.
✅ Passed checks (12 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 an end-to-end test for GCP disk license passthrough.
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 changed Ginkgo titles are literal, static strings. They contain no generated names, timestamps, UUIDs, node or namespace names, IPs, or runtime values.
Test Structure And Quality ✅ Passed The added It block covers one related license-provisioning behavior, registers DeferCleanup in BeforeEach, uses timed framework waits, and gives all direct assertions diagnostic messages.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The new Ginkgo test creates exactly one Machine and checks its Running state and providerSpec. It has no multi-node, HA, affinity, failover, drain, or topology-scaling assumption.
Topology-Aware Scheduling Compatibility ✅ Passed The PR adds a GCP e2e test and dependency/vendor updates only; it introduces no deployment, operator, controller, or topology scheduling constraints.
Ote Binary Stdout Contract ✅ Passed The diff adds no process-level stdout writes; its top-level Describe only registers hooks, and suite klog output is already directed to GinkgoWriter.
No-Weak-Crypto ✅ Passed The PR adds JSON handling, GCP license data, and a module replacement only; changed lines introduce no MD5, SHA1, DES, RC4, Blowfish, ECB, custom crypto, or secret comparisons.
Container-Privileges ✅ Passed The PR adds a Go e2e test, dependency metadata, and generated API files; added lines contain no privileged, hostPID, hostNetwork, hostIPC, SYS_ADMIN, or allowPrivilegeEscalation settings.
✨ 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 damdo and mdbooth August 13, 2026 08:56
@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 radekmanak 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

/testwith openshift/api#2980 openshift/machine-api-provider-gcp#184


AI-generated. Review for accuracy.

@theobarberbany

Copy link
Copy Markdown
Contributor

/test ?

@openshift-ci

openshift-ci Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

@theobarberbany: The following commands are available to trigger required jobs:

/test e2e-aws-operator
/test e2e-azure-operator
/test e2e-vsphere-operator
/test images
/test images-images
/test lint
/test unit

The following commands are available to trigger optional jobs:

/test e2e-aws-autoscaler
/test e2e-aws-autoscaler-periodic-pre
/test e2e-aws-capi-techpreview
/test e2e-aws-periodic-pre
/test e2e-azure-capi-techpreview
/test e2e-azure-operator-periodic-pre
/test e2e-gcp-capi-techpreview
/test e2e-gcp-operator
/test e2e-gcp-periodic-pre
/test e2e-openstack-operator
/test e2e-openstack-operator-periodic-pre
/test e2e-vsphere-operator-periodic-pre

Use /test all to run the following jobs that were automatically triggered:

pull-ci-openshift-cluster-api-actuator-pkg-master-e2e-aws-operator
pull-ci-openshift-cluster-api-actuator-pkg-master-e2e-azure-operator
pull-ci-openshift-cluster-api-actuator-pkg-master-e2e-vsphere-operator
pull-ci-openshift-cluster-api-actuator-pkg-master-images
pull-ci-openshift-cluster-api-actuator-pkg-master-images-images
pull-ci-openshift-cluster-api-actuator-pkg-master-lint
pull-ci-openshift-cluster-api-actuator-pkg-master-unit
Details

In response to this:

/test ?

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.

@redhat-chai-bot

Copy link
Copy Markdown
Author

/testwith openshift/machine-api-provider-gcp/main/e2e-gcp-operator openshift/api#2980 openshift/machine-api-provider-gcp#184


AI-generated. Review for accuracy.

@redhat-chai-bot

Copy link
Copy Markdown
Author

/testwith openshift/cluster-api-actuator-pkg/master/e2e-gcp-operator openshift/api#2980 openshift/machine-api-provider-gcp#184


AI-generated. Review for accuracy.

@openshift-ci

openshift-ci Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

@redhat-chai-bot: all tests passed!

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.

3 participants