Skip to content

Commit 82bc5fe

Browse files
committed
CORS-4184: Add STS IAMCredentials and OAuth Service for GCP Endpoint Overrides
** These services were a bit unconventional. The STS and IAMCredential services are not called directly in CCO but through a WIF template. The OAuth Service is also a bit unconventional, as it is never called directly but will still require a GCP endpoint override to ensure that the traffic does not go to the default google endpoint.
1 parent cc869c8 commit 82bc5fe

20 files changed

+87
-36
lines changed

config/v1/tests/infrastructures.config.openshift.io/GCPCustomAPIEndpoints.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ tests:
213213
dnsType: PlatformDefault
214214
serviceEndpoints:
215215
- {name: "UnknownService", url: "https://compute-myendpoint1.p.googleapis.com"}
216-
expectedStatusError: "[status.platformStatus.gcp.serviceEndpoints[0].name: Unsupported value: \"UnknownService\": supported values: \"Compute\", \"Container\", \"CloudResourceManager\", \"DNS\", \"File\", \"IAM\", \"ServiceUsage\", \"Storage\", <nil>: Invalid value: \"null\": some validation rules were not checked because the object was invalid; correct the existing errors to complete validation"
216+
expectedStatusError: "[status.platformStatus.gcp.serviceEndpoints[0].name: Unsupported value: \"UnknownService\": supported values: \"Compute\", \"Container\", \"CloudResourceManager\", \"DNS\", \"File\", \"IAM\", \"IAMCredentials\", \"OAuth\", \"ServiceUsage\", \"Storage\", \"STS\", <nil>: Invalid value: \"null\": some validation rules were not checked because the object was invalid; correct the existing errors to complete validation]"
217217
- name: Service Endpoint End Slash
218218
initial: |
219219
apiVersion: config.openshift.io/v1

config/v1/tests/infrastructures.config.openshift.io/GCPCustomAPIEndpointsInstall.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ tests:
213213
dnsType: PlatformDefault
214214
serviceEndpoints:
215215
- {name: "UnknownService", url: "https://compute-myendpoint1.p.googleapis.com"}
216-
expectedStatusError: "[status.platformStatus.gcp.serviceEndpoints[0].name: Unsupported value: \"UnknownService\": supported values: \"Compute\", \"Container\", \"CloudResourceManager\", \"DNS\", \"File\", \"IAM\", \"ServiceUsage\", \"Storage\", <nil>: Invalid value: \"null\": some validation rules were not checked because the object was invalid; correct the existing errors to complete validation"
216+
expectedStatusError: "[status.platformStatus.gcp.serviceEndpoints[0].name: Unsupported value: \"UnknownService\": supported values: \"Compute\", \"Container\", \"CloudResourceManager\", \"DNS\", \"File\", \"IAM\", \"IAMCredentials\", \"OAuth\", \"ServiceUsage\", \"Storage\", \"STS\", <nil>: Invalid value: \"null\": some validation rules were not checked because the object was invalid; correct the existing errors to complete validation]"
217217
- name: Service Endpoint End Slash
218218
initial: |
219219
apiVersion: config.openshift.io/v1

config/v1/types_infrastructure.go

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ const (
650650
)
651651

652652
// GCPServiceEndpointName is the name of the GCP Service Endpoint.
653-
// +kubebuilder:validation:Enum=Compute;Container;CloudResourceManager;DNS;File;IAM;ServiceUsage;Storage
653+
// +kubebuilder:validation:Enum=Compute;Container;CloudResourceManager;DNS;File;IAM;IAMCredentials;OAuth;ServiceUsage;Storage;STS
654654
type GCPServiceEndpointName string
655655

656656
const (
@@ -672,11 +672,20 @@ const (
672672
// GCPServiceEndpointNameIAM is the name used for the GCP IAM Service endpoint.
673673
GCPServiceEndpointNameIAM GCPServiceEndpointName = "IAM"
674674

675+
// GCPServiceEndpointNameIAMCredentials is the name used for the GCP IAM Credentials Service endpoint.
676+
GCPServiceEndpointNameIAMCredentials GCPServiceEndpointName = "IAMCredentials"
677+
678+
// GCPServiceEndpointNameOAuth is the name used for the GCP OAuth2 Service endpoint.
679+
GCPServiceEndpointNameOAuth GCPServiceEndpointName = "OAuth"
680+
675681
// GCPServiceEndpointNameServiceUsage is the name used for the GCP Service Usage Service endpoint.
676682
GCPServiceEndpointNameServiceUsage GCPServiceEndpointName = "ServiceUsage"
677683

678684
// GCPServiceEndpointNameStorage is the name used for the GCP Storage Service endpoint.
679685
GCPServiceEndpointNameStorage GCPServiceEndpointName = "Storage"
686+
687+
// GCPServiceEndpointNameSTS is the name used for the GCP STS Service endpoint.
688+
GCPServiceEndpointNameSTS GCPServiceEndpointName = "STS"
680689
)
681690

682691
// GCPServiceEndpoint store the configuration of a custom url to
@@ -767,10 +776,10 @@ type GCPPlatformStatus struct {
767776
// used when creating clients to interact with GCP services.
768777
// When not specified, the default endpoint for the GCP region will be used.
769778
// Only 1 endpoint override is permitted for each GCP service.
770-
// The maximum number of endpoint overrides allowed is 9.
779+
// The maximum number of endpoint overrides allowed is 11.
771780
// +listType=map
772781
// +listMapKey=name
773-
// +kubebuilder:validation:MaxItems=8
782+
// +kubebuilder:validation:MaxItems=11
774783
// +kubebuilder:validation:XValidation:rule="self.all(x, self.exists_one(y, x.name == y.name))",message="only 1 endpoint override is permitted per GCP service name"
775784
// +optional
776785
// +openshift:enable:FeatureGate=GCPCustomAPIEndpointsInstall

config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-CustomNoUpgrade.crd.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1995,7 +1995,7 @@ spec:
19951995
used when creating clients to interact with GCP services.
19961996
When not specified, the default endpoint for the GCP region will be used.
19971997
Only 1 endpoint override is permitted for each GCP service.
1998-
The maximum number of endpoint overrides allowed is 9.
1998+
The maximum number of endpoint overrides allowed is 11.
19991999
items:
20002000
description: |-
20012001
GCPServiceEndpoint store the configuration of a custom url to
@@ -2018,8 +2018,11 @@ spec:
20182018
- DNS
20192019
- File
20202020
- IAM
2021+
- IAMCredentials
2022+
- OAuth
20212023
- ServiceUsage
20222024
- Storage
2025+
- STS
20232026
type: string
20242027
url:
20252028
description: |-
@@ -2045,7 +2048,7 @@ spec:
20452048
- name
20462049
- url
20472050
type: object
2048-
maxItems: 8
2051+
maxItems: 11
20492052
type: array
20502053
x-kubernetes-list-map-keys:
20512054
- name

config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-DevPreviewNoUpgrade.crd.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1995,7 +1995,7 @@ spec:
19951995
used when creating clients to interact with GCP services.
19961996
When not specified, the default endpoint for the GCP region will be used.
19971997
Only 1 endpoint override is permitted for each GCP service.
1998-
The maximum number of endpoint overrides allowed is 9.
1998+
The maximum number of endpoint overrides allowed is 11.
19991999
items:
20002000
description: |-
20012001
GCPServiceEndpoint store the configuration of a custom url to
@@ -2018,8 +2018,11 @@ spec:
20182018
- DNS
20192019
- File
20202020
- IAM
2021+
- IAMCredentials
2022+
- OAuth
20212023
- ServiceUsage
20222024
- Storage
2025+
- STS
20232026
type: string
20242027
url:
20252028
description: |-
@@ -2045,7 +2048,7 @@ spec:
20452048
- name
20462049
- url
20472050
type: object
2048-
maxItems: 8
2051+
maxItems: 11
20492052
type: array
20502053
x-kubernetes-list-map-keys:
20512054
- name

config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-TechPreviewNoUpgrade.crd.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1995,7 +1995,7 @@ spec:
19951995
used when creating clients to interact with GCP services.
19961996
When not specified, the default endpoint for the GCP region will be used.
19971997
Only 1 endpoint override is permitted for each GCP service.
1998-
The maximum number of endpoint overrides allowed is 9.
1998+
The maximum number of endpoint overrides allowed is 11.
19991999
items:
20002000
description: |-
20012001
GCPServiceEndpoint store the configuration of a custom url to
@@ -2018,8 +2018,11 @@ spec:
20182018
- DNS
20192019
- File
20202020
- IAM
2021+
- IAMCredentials
2022+
- OAuth
20212023
- ServiceUsage
20222024
- Storage
2025+
- STS
20232026
type: string
20242027
url:
20252028
description: |-
@@ -2045,7 +2048,7 @@ spec:
20452048
- name
20462049
- url
20472050
type: object
2048-
maxItems: 8
2051+
maxItems: 11
20492052
type: array
20502053
x-kubernetes-list-map-keys:
20512054
- name

config/v1/zz_generated.featuregated-crd-manifests/infrastructures.config.openshift.io/GCPCustomAPIEndpointsInstall.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1587,7 +1587,7 @@ spec:
15871587
used when creating clients to interact with GCP services.
15881588
When not specified, the default endpoint for the GCP region will be used.
15891589
Only 1 endpoint override is permitted for each GCP service.
1590-
The maximum number of endpoint overrides allowed is 9.
1590+
The maximum number of endpoint overrides allowed is 11.
15911591
items:
15921592
description: |-
15931593
GCPServiceEndpoint store the configuration of a custom url to
@@ -1610,8 +1610,11 @@ spec:
16101610
- DNS
16111611
- File
16121612
- IAM
1613+
- IAMCredentials
1614+
- OAuth
16131615
- ServiceUsage
16141616
- Storage
1617+
- STS
16151618
type: string
16161619
url:
16171620
description: |-
@@ -1637,7 +1640,7 @@ spec:
16371640
- name
16381641
- url
16391642
type: object
1640-
maxItems: 8
1643+
maxItems: 11
16411644
type: array
16421645
x-kubernetes-list-map-keys:
16431646
- name

config/v1/zz_generated.swagger_doc_generated.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_controllerconfigs-CustomNoUpgrade.crd.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2275,7 +2275,7 @@ spec:
22752275
used when creating clients to interact with GCP services.
22762276
When not specified, the default endpoint for the GCP region will be used.
22772277
Only 1 endpoint override is permitted for each GCP service.
2278-
The maximum number of endpoint overrides allowed is 9.
2278+
The maximum number of endpoint overrides allowed is 11.
22792279
items:
22802280
description: |-
22812281
GCPServiceEndpoint store the configuration of a custom url to
@@ -2298,8 +2298,11 @@ spec:
22982298
- DNS
22992299
- File
23002300
- IAM
2301+
- IAMCredentials
2302+
- OAuth
23012303
- ServiceUsage
23022304
- Storage
2305+
- STS
23032306
type: string
23042307
url:
23052308
description: |-
@@ -2325,7 +2328,7 @@ spec:
23252328
- name
23262329
- url
23272330
type: object
2328-
maxItems: 8
2331+
maxItems: 11
23292332
type: array
23302333
x-kubernetes-list-map-keys:
23312334
- name

machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_controllerconfigs-DevPreviewNoUpgrade.crd.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2275,7 +2275,7 @@ spec:
22752275
used when creating clients to interact with GCP services.
22762276
When not specified, the default endpoint for the GCP region will be used.
22772277
Only 1 endpoint override is permitted for each GCP service.
2278-
The maximum number of endpoint overrides allowed is 9.
2278+
The maximum number of endpoint overrides allowed is 11.
22792279
items:
22802280
description: |-
22812281
GCPServiceEndpoint store the configuration of a custom url to
@@ -2298,8 +2298,11 @@ spec:
22982298
- DNS
22992299
- File
23002300
- IAM
2301+
- IAMCredentials
2302+
- OAuth
23012303
- ServiceUsage
23022304
- Storage
2305+
- STS
23032306
type: string
23042307
url:
23052308
description: |-
@@ -2325,7 +2328,7 @@ spec:
23252328
- name
23262329
- url
23272330
type: object
2328-
maxItems: 8
2331+
maxItems: 11
23292332
type: array
23302333
x-kubernetes-list-map-keys:
23312334
- name

0 commit comments

Comments
 (0)