OCPBUGS-114669: Enable GCP custom universe domain support for CCO - #1083
OCPBUGS-114669: Enable GCP custom universe domain support for CCO#1083rochacbruno wants to merge 5 commits into
Conversation
Sets the universe domain when initializing GCP clients in order to support running in environments with non-default universe domains such as Google Cloud Dedicated, GCP's sovereign cloud offering. CCO will always use JSON-based creds, either service account with key or WIF. We must utilize the WithAuthCredentialsJSON function because it will use self-signed JWTs rather than oauth token exchange which fails in GCD. The authentication falls back to WithCredentials, as ccoctl can authenticate via the metadata server (obtaining credentials from the service account attached to a VM). (cherry picked from commit 8155da6)
In some cases, such as Google Dedicated Cloud, service accounts take on a different format. When the project has the format eu0:PROJECT_ID, the service account has the format: serviceAccount:SERVICE_ACCOUNT_NAME@PROJECT_ID.eu0.iam.gserviceaccount.com This commit adds some simnple handling for this case. (cherry picked from commit c284a20)
Updates from CredentialsFromJSON -> CredentialsFromJSONWithType to avoid using the deprecated function. This change is a no-op, only intended to avoid deprecation warnings. The new function takes a credential type parameter, which can be used to limit accepted credentials types, which is useful for validating credentials provided by external third parties. For OpenShift, cluster credentials are coming from first party users running clusters in their project, so we do not need to limit which credentials are accepted; therefore we just pass the type through from the credential to the function. (cherry picked from commit aeb83ab)
Needed for new GCP packages. Makes local consistent with Dockerfile. (cherry picked from commit a6a3575)
The GCP client and service account changes cherry-picked from openshift#1068 use option.WithAuthCredentialsJSON and option.CredentialsType, which were added in google.golang.org/api v0.258.0. The release-4.22 baseline was v0.252.0. This is the minimal bump that provides those symbols; k8s.io/api stays at v0.35.2 and github.com/openshift/api is unchanged.
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
|
/jira cherrypick OCPBUGS-112145 |
|
@rochacbruno: Jira Issue OCPBUGS-112145 has been cloned as Jira Issue OCPBUGS-114669. Will retitle bug to link to clone. DetailsIn response to this:
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. |
|
@rochacbruno: This pull request references Jira Issue OCPBUGS-114669, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
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. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: rochacbruno The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/jira refresh |
|
@rochacbruno: This pull request references Jira Issue OCPBUGS-114669, which is valid. The bug has been moved to the POST state. 7 validation(s) were run on this bug
DetailsIn response to this:
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. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release-4.22 #1083 +/- ##
================================================
- Coverage 46.88% 46.80% -0.09%
================================================
Files 98 98
Lines 12558 12594 +36
================================================
+ Hits 5888 5894 +6
- Misses 6015 6045 +30
Partials 655 655
🚀 New features to boost your workflow:
|
|
/test security verify-deps |
|
@rochacbruno: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
| @@ -1,4 +1,4 @@ | |||
| FROM golang:1.21 AS builder | |||
| FROM golang:1.26 AS builder | |||
There was a problem hiding this comment.
| FROM golang:1.26 AS builder | |
| FROM golang:1.25 AS builder |
I wonder if we can use go v1.25 instead here since 4.22 release is built with go v1.25? My guess is "yes" based on: https://github.com/googleapis/google-api-go-client/blob/182ae992632d7ba19b5d3c60c71bda28fbfabca1/go.mod#L3
Backport of #1068 to release-4.22.
Cherry-picks the GCP client and service-account changes that add support for custom (alternate) universe domains:
CredentialsFromJSONusageIt also bumps
google.golang.org/apiv0.252.0 -> v0.258.0, the minimal version providingoption.WithAuthCredentialsJSONandoption.CredentialsTypeused by the cherry-picked code.k8s.io/apistays at v0.35.2 andgithub.com/openshift/apiis unchanged.Note: the companion ccoctl change (#1073) is intentionally NOT included here. It depends on the
GCPPlatformStatus.UniverseDomainfield from openshift/api #2963 (CORS-4417), which has not yet been backported to openshift/api release-4.22.