Skip to content

CORS-4544: WIF Support on GCD - #1073

Open
patrickdillon wants to merge 4 commits into
openshift:masterfrom
patrickdillon:ccoctl-universe-domain-v2
Open

CORS-4544: WIF Support on GCD#1073
patrickdillon wants to merge 4 commits into
openshift:masterfrom
patrickdillon:ccoctl-universe-domain-v2

Conversation

@patrickdillon

@patrickdillon patrickdillon commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Add support for using WIF on GCD, Google's Sovereign Cloud offering. The main concern is plumbing support for universe domain through the generated credentials.

Summary by CodeRabbit

  • New Features

    • Added support for custom GCP universe domains during provisioning.
    • Generated credentials now use domain-specific Security Token Service and IAM Credentials endpoints.
    • Workload identity provider issuer URLs adapt to the configured GCP domain.
    • Credential configurations include the appropriate universe domain for non-default environments.
  • Bug Fixes

    • Defaults to googleapis.com when no custom domain is configured.
    • Reports infrastructure lookup failures instead of continuing with incomplete domain information.

Bring in GCP universe domain fields.
go mod tidy && go mod vendor
Adds support for including a universe domain in ccoctl generated
GCP WIF credentials, which enables authentication in Google Cloud
Dedicated, GCP's sovereign cloud offerings. The universe domain is
determined by the credentials provided to ccoctl.
@openshift-ci-robot

openshift-ci-robot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@patrickdillon: This pull request references CORS-4544 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:

Add support for using WIF on GCD, Google's Sovereign Cloud offering. The main concern is plumbing support for universe domain through the generated credentials.

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-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 6, 2026
@openshift-ci
openshift-ci Bot requested review from dlom and jstuever August 6, 2026 20:41
@openshift-ci

openshift-ci Bot commented Aug 6, 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 Aug 6, 2026
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Walkthrough

GCP provisioning now retrieves and propagates the universe domain. Workload identity, service-account, and STS configurations use domain-specific endpoints. Custom domains add universe_domain. STS synchronization reads the domain from cluster Infrastructure status and defaults missing values to googleapis.com.

Changes

GCP universe domain support

Layer / File(s) Summary
Provisioning domain propagation and credential generation
pkg/cmd/provisioning/gcp/create_all.go, pkg/cmd/provisioning/gcp/create_service_accounts.go, pkg/cmd/provisioning/gcp/create_workload_identity_provider.go, pkg/cmd/provisioning/gcp/*_test.go
Provisioning passes the GCP universe domain to service-account and workload identity generation. Generated STS, IAM, and storage issuer URLs use the selected domain. Custom domains add universe_domain. Tests cover the default domain behavior.
STS synchronization
pkg/gcp/actuator/actuator.go
STS synchronization reads the universe domain from Infrastructure status, defaults missing values to googleapis.com, and renders domain-specific external-account credentials.
API dependency update
go.mod
The github.com/openshift/api dependency uses a newer pseudo-version.

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

Sequence Diagram(s)

sequenceDiagram
  participant createAllCmd
  participant GCPClient
  participant createServiceAccounts
  participant createWorkloadIdentityProvider
  createAllCmd->>GCPClient: Get universe domain
  createAllCmd->>createServiceAccounts: Pass universe domain
  createServiceAccounts-->>createServiceAccounts: Render domain-specific credentials
  createAllCmd->>createWorkloadIdentityProvider: Pass universe domain
  createWorkloadIdentityProvider-->>createWorkloadIdentityProvider: Render storage issuer URL
Loading
sequenceDiagram
  participant STSSynchronization
  participant InfrastructureStatus
  participant syncSTSSecret
  participant CredentialTemplate
  STSSynchronization->>InfrastructureStatus: Read universe domain
  InfrastructureStatus-->>STSSynchronization: Return domain or default
  STSSynchronization->>syncSTSSecret: Pass universe domain
  syncSTSSecret->>CredentialTemplate: Render STS and IAM endpoints
  CredentialTemplate-->>syncSTSSecret: Return credential JSON
Loading

Suggested reviewers: dlom, jstuever, barbacbd

🚥 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 identifies the main change: adding WIF support on Google Cloud Dedicated.
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 Affected tests use literal table names, including the new static universe-domain title; t.Run receives no runtime values, and no Ginkgo title declarations occur in the affected package.
Test Structure And Quality ✅ Passed The added test is focused, cleans temp directories and mocks with defer, uses no cluster waits or resources, and gives diagnostic messages for all new assertions.
Microshift Test Compatibility ✅ Passed The commit adds no Ginkgo tests. Its changed test uses standard testing.Test and has no MicroShift-incompatible OpenShift API or feature references.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The commit adds only standard Go testing cases; it adds no Ginkgo It/Describe/Context/When e2e test and makes no SNO-relevant assumptions.
Topology-Aware Scheduling Compatibility ✅ Passed The PR changes GCP credential and WIF endpoint handling only; scans of all PR additions found no deployments, replicas, affinity, topology spread, node selectors, tolerations, or PDB constraints.
Ote Binary Stdout Contract ✅ Passed The OTE main writes errors to os.Stderr; component-base logs route through klog to stderr, and the OTE framework sets GinkgoWriter to stderr. PR changes add no process-level stdout writes.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The only added test uses standard testing.T with gomock and local temp files; it is not a Ginkgo e2e test and does not connect to storage.googleapis.com or other external services.
No-Weak-Crypto ✅ Passed The PR adds only GCP universe-domain and credential endpoint plumbing. Added-line analysis found no MD5, SHA1, DES, RC4, Blowfish, ECB, custom crypto, or secret comparisons; JWKS IDs use SHA-256.
Container-Privileges ✅ Passed The PR diff adds no privilege-related fields. Changed YAML files are CRD data, and existing deployments use runAsNonRoot:true and allowPrivilegeEscalation:false.
No-Sensitive-Data-In-Logs ✅ Passed The PR adds no logging calls. Sensitive credential values are written to Secret.StringData, while logs contain only existing resource identifiers and operation messages.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
pkg/cmd/provisioning/gcp/create_service_accounts.go (1)

213-215: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Propagate the universe domain in generate-only mode.

The generate-only path invokes create-cred-config without universeDomain. That command defaults to googleapis.com, so custom-universe installations receive invalid credentials. Generate the JSON with the same domain-aware template or use another supported domain-aware path. Add a custom-domain dry-run test.

🤖 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/cmd/provisioning/gcp/create_service_accounts.go` around lines 213 - 215,
Update the generate-only flow around generateCredentialsConfigScript and
create-cred-config to pass the configured universe domain through the same
domain-aware command template used by normal provisioning, rather than relying
on the googleapis.com default. Ensure custom-universe installations generate
valid credentials, and add a dry-run test covering a custom universe domain.
🧹 Nitpick comments (1)
pkg/cmd/provisioning/gcp/create_service_accounts_test.go (1)

207-207: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add observable custom-domain coverage. The changed tests only pass googleapis.com, so they do not validate the new feature.

  • pkg/cmd/provisioning/gcp/create_service_accounts_test.go#L207-L207: decode the generated secret for a custom domain and assert domain-specific STS and IAM Credentials URLs plus universe_domain.
  • pkg/cmd/provisioning/gcp/create_workload_identity_provider_test.go#L209-L209: assert the public-bucket discovery document uses a custom-domain issuer.
  • pkg/cmd/provisioning/gcp/create_workload_identity_provider_test.go#L419-L419: assert the pool-JWK provider uses a custom-domain issuer and defaults correctly for an empty domain.
🤖 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/cmd/provisioning/gcp/create_service_accounts_test.go` at line 207, Expand
the custom-domain test coverage across all listed sites: in
pkg/cmd/provisioning/gcp/create_service_accounts_test.go:207-207, decode the
generated secret from createServiceAccounts and assert domain-specific STS and
IAM Credentials URLs plus universe_domain; in
pkg/cmd/provisioning/gcp/create_workload_identity_provider_test.go:209-209,
assert the public-bucket discovery document uses a custom-domain issuer; and at
:419-419, assert the pool-JWK provider uses a custom-domain issuer while an
empty domain falls back to the default.
🤖 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/cmd/provisioning/gcp/create_service_accounts.go`:
- Around line 337-341: Update universeDomainArgs in
pkg/cmd/provisioning/gcp/create_service_accounts.go:337-341 to validate the
domain against an explicit allow-list, canonicalize it, and JSON-encode it
before interpolating credential content. Apply the same validation and
canonicalization in pkg/gcp/actuator/actuator.go:338-342 before rendering
credential secrets; both sites require direct changes, and preserve
googleapis.com as the default.

In `@pkg/cmd/provisioning/gcp/create_workload_identity_provider.go`:
- Around line 104-106: Normalize an empty universeDomain to the existing
googleapis.com default before constructing issuerURL in
createWorkloadIdentityProvider, matching the service-account path. Add or update
a test covering an empty universe domain and verify the issuer URL uses
https://storage.googleapis.com/<bucket>.

In `@pkg/gcp/actuator/actuator.go`:
- Around line 349-353: The getUniverseDomain method must propagate the error
from utils.GetInfrastructure instead of returning googleapis.com, allowing
reconciliation to retry and preserve sovereign configuration. Update its
signature and callers to return or handle the error, while retaining the
googleapis.com fallback only when Infrastructure loads successfully without a
universe-domain value.

---

Outside diff comments:
In `@pkg/cmd/provisioning/gcp/create_service_accounts.go`:
- Around line 213-215: Update the generate-only flow around
generateCredentialsConfigScript and create-cred-config to pass the configured
universe domain through the same domain-aware command template used by normal
provisioning, rather than relying on the googleapis.com default. Ensure
custom-universe installations generate valid credentials, and add a dry-run test
covering a custom universe domain.

---

Nitpick comments:
In `@pkg/cmd/provisioning/gcp/create_service_accounts_test.go`:
- Line 207: Expand the custom-domain test coverage across all listed sites: in
pkg/cmd/provisioning/gcp/create_service_accounts_test.go:207-207, decode the
generated secret from createServiceAccounts and assert domain-specific STS and
IAM Credentials URLs plus universe_domain; in
pkg/cmd/provisioning/gcp/create_workload_identity_provider_test.go:209-209,
assert the public-bucket discovery document uses a custom-domain issuer; and at
:419-419, assert the pool-JWK provider uses a custom-domain issuer while an
empty domain falls back to the default.
🪄 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: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 28cbb504-02f1-4eb2-ae39-05b79d82adb5

📥 Commits

Reviewing files that changed from the base of the PR and between f323f9e and 58c230c.

⛔ Files ignored due to path filters (37)
  • go.sum is excluded by !**/*.sum
  • vendor/github.com/openshift/api/config/v1/types_infrastructure.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/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.crd-manifests/0000_12_etcd_01_etcds-CustomNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-Default.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-DevPreviewNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-OKD.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-TechPreviewNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_20_kube-apiserver_01_kubeapiservers-CustomNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_20_kube-apiserver_01_kubeapiservers-Default.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_20_kube-apiserver_01_kubeapiservers-DevPreviewNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_20_kube-apiserver_01_kubeapiservers-OKD.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_20_kube-apiserver_01_kubeapiservers-TechPreviewNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_25_kube-controller-manager_01_kubecontrollermanagers.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_25_kube-scheduler_01_kubeschedulers.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_30_openshift-apiserver_01_openshiftapiservers-CustomNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_30_openshift-apiserver_01_openshiftapiservers-DevPreviewNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_30_openshift-apiserver_01_openshiftapiservers-TechPreviewNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_authentication_01_authentications-CustomNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_authentication_01_authentications-DevPreviewNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_authentication_01_authentications-TechPreviewNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-Default.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-OKD.crd.yaml 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/modules.txt is excluded by !**/vendor/**, !vendor/**
📒 Files selected for processing (7)
  • go.mod
  • pkg/cmd/provisioning/gcp/create_all.go
  • pkg/cmd/provisioning/gcp/create_service_accounts.go
  • pkg/cmd/provisioning/gcp/create_service_accounts_test.go
  • pkg/cmd/provisioning/gcp/create_workload_identity_provider.go
  • pkg/cmd/provisioning/gcp/create_workload_identity_provider_test.go
  • pkg/gcp/actuator/actuator.go

Comment thread pkg/cmd/provisioning/gcp/create_service_accounts.go
Comment thread pkg/cmd/provisioning/gcp/create_workload_identity_provider.go
Comment thread pkg/gcp/actuator/actuator.go Outdated
@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 32.50000% with 27 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.16%. Comparing base (5a92092) to head (fa48238).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
pkg/gcp/actuator/actuator.go 0.00% 20 Missing ⚠️
pkg/cmd/provisioning/gcp/create_all.go 0.00% 3 Missing ⚠️
...kg/cmd/provisioning/gcp/create_service_accounts.go 75.00% 2 Missing and 1 partial ⚠️
...visioning/gcp/create_workload_identity_provider.go 80.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1073      +/-   ##
==========================================
- Coverage   47.21%   47.16%   -0.06%     
==========================================
  Files          97       97              
  Lines       12650    12675      +25     
==========================================
+ Hits         5973     5978       +5     
- Misses       6017     6036      +19     
- Partials      660      661       +1     
Files with missing lines Coverage Δ
...visioning/gcp/create_workload_identity_provider.go 58.67% <80.00%> (+0.34%) ⬆️
pkg/cmd/provisioning/gcp/create_all.go 0.00% <0.00%> (ø)
...kg/cmd/provisioning/gcp/create_service_accounts.go 51.86% <75.00%> (+0.15%) ⬆️
pkg/gcp/actuator/actuator.go 49.02% <0.00%> (-1.53%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tthvo

tthvo commented Aug 6, 2026

Copy link
Copy Markdown
Member

/cc @barbacbd @rochacbruno

@openshift-ci
openshift-ci Bot requested review from barbacbd and rochacbruno August 6, 2026 21:36
@tthvo

tthvo commented Aug 7, 2026

Copy link
Copy Markdown
Member

/retest-required

@tthvo

tthvo commented Aug 7, 2026

Copy link
Copy Markdown
Member

/payload-job periodic-ci-openshift-release-main-ci-5.0-upgrade-from-stable-4.22-e2e-gcp-ovn-upgrade

@openshift-ci

openshift-ci Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

@tthvo: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-main-ci-5.0-upgrade-from-stable-4.22-e2e-gcp-ovn-upgrade

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/b937e100-91f8-11f1-8241-321e69913d89-0

The cloud-credential operator, when running in WIF mode, syncs or
recreates the credentials secrets on each sync. This commit ensures
that the secret contains the correct universe domain when running
in a non-default universe domain.
@patrickdillon
patrickdillon force-pushed the ccoctl-universe-domain-v2 branch from 58c230c to fa48238 Compare August 7, 2026 15:30

@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

🧹 Nitpick comments (1)
pkg/cmd/provisioning/gcp/create_workload_identity_provider_test.go (1)

123-153: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add coverage for a non-default universe domain.

The new test checks only the empty-domain fallback to googleapis.com. The pool-JWK-file test also passes "googleapis.com". These cases do not verify that a configured GCD domain reaches the issuer URL.

Add a test case with a non-default universeDomain and assert https://storage.<domain>/<bucket>.

As per the PR objective, this cohort adds configurable GCP universe-domain support.

Also applies to: 451-451

🤖 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/cmd/provisioning/gcp/create_workload_identity_provider_test.go` around
lines 123 - 153, Add a table-driven test case alongside “Empty universe domain
defaults to googleapis.com” that supplies a non-default universeDomain, such as
an alternate GCD domain, and verifies the generated discovery document issuer
uses https://storage.<domain>/<bucket>. Ensure the case exercises the existing
setup and generateOnly flow while preserving the default-domain assertion.
🤖 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/cmd/provisioning/gcp/create_workload_identity_provider_test.go`:
- Line 241: In the successful-case branch of the test around
createWorkloadIdentityProvider, add require.NoError(t, err) before invoking
test.verify. Ensure every case where test.expectError is false validates the
returned error before verification.

---

Nitpick comments:
In `@pkg/cmd/provisioning/gcp/create_workload_identity_provider_test.go`:
- Around line 123-153: Add a table-driven test case alongside “Empty universe
domain defaults to googleapis.com” that supplies a non-default universeDomain,
such as an alternate GCD domain, and verifies the generated discovery document
issuer uses https://storage.<domain>/<bucket>. Ensure the case exercises the
existing setup and generateOnly flow while preserving the default-domain
assertion.
🪄 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: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 71b298fd-6584-449b-abbc-2efae4dde1b2

📥 Commits

Reviewing files that changed from the base of the PR and between 58c230c and fa48238.

📒 Files selected for processing (3)
  • pkg/cmd/provisioning/gcp/create_workload_identity_provider.go
  • pkg/cmd/provisioning/gcp/create_workload_identity_provider_test.go
  • pkg/gcp/actuator/actuator.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • pkg/cmd/provisioning/gcp/create_workload_identity_provider.go
  • pkg/gcp/actuator/actuator.go

}
testPublicKeyPath := filepath.Join(tempDirName, testPublicKeyFile)
err := createWorkloadIdentityProvider(context.TODO(), mockGCPClient, testInfraName, testRegionName, testProject, testName, testPublicKeyPath, tempDirName, keyStorageMethod, test.generateOnly)
err := createWorkloadIdentityProvider(context.TODO(), mockGCPClient, testInfraName, testRegionName, testProject, testName, testPublicKeyPath, tempDirName, keyStorageMethod, test.generateOnly, test.universeDomain)

@coderabbitai coderabbitai Bot Aug 7, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Check the returned error for successful cases.

When test.expectError is false, the test calls test.verify without require.NoError(t, err). Add that assertion before verification.

As per path instructions: “Never ignore error returns” for Go code.

🤖 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/cmd/provisioning/gcp/create_workload_identity_provider_test.go` at line
241, In the successful-case branch of the test around
createWorkloadIdentityProvider, add require.NoError(t, err) before invoking
test.verify. Ensure every case where test.expectError is false validates the
returned error before verification.

Source: Path instructions

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.

Yea, it would be nice to add require.NoError(t, err) before proceeding to verifying. Though, it's an existing test-only issue, and shouldn't block the PR from merging.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tthvo, acknowledged. The missing require.NoError(t, err) is a valid test improvement, but it is pre-existing and non-blocking for #1073.

Would you like me to create a GitHub follow-up issue for this test cleanup?

You are interacting with an AI system.

@openshift-ci

openshift-ci Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

@patrickdillon: 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/security fa48238 link true /test security

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.

@tthvo

tthvo commented Aug 7, 2026

Copy link
Copy Markdown
Member

/test e2e-gcp
/test e2e-gcp-manual-oidc-pool-jwk-file

@tthvo

tthvo commented Aug 7, 2026

Copy link
Copy Markdown
Member

/payload-job periodic-ci-openshift-release-main-ci-5.0-upgrade-from-stable-4.22-e2e-gcp-ovn-upgrade

@openshift-ci

openshift-ci Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

@tthvo: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-main-ci-5.0-upgrade-from-stable-4.22-e2e-gcp-ovn-upgrade

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/a397aaf0-929e-11f1-8a41-5e6abeffbbf0-0

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