Skip to content

Commit

Permalink
** Add the ServiceEndpoint Structure that includes the api name and e…
Browse files Browse the repository at this point in the history
…ndpoint.

** Add the Service Endpoints to the GCP Spec and Status structs.
  • Loading branch information
barbacbd committed Jan 15, 2025
1 parent 708da54 commit a2f03bb
Show file tree
Hide file tree
Showing 42 changed files with 2,447 additions and 5 deletions.
36 changes: 35 additions & 1 deletion config/v1/types_infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -620,9 +620,36 @@ const (
AzureStackCloud AzureCloudEnvironment = "AzureStackCloud"
)

// GCPServiceEndpoint store the configuration of a custom url to
// override existing defaults of GCP Services.
type GCPServiceEndpoint struct {
// name is the name of the GCP service.
// The list of all the service names can be found at https://developers.google.com/apis-explorer
// This must be provided and cannot be empty.
//
// +kubebuilder:validation:Pattern=`^[a-z0-9-]+$`
// +required
Name string `json:"name"`

// url is fully qualified URI with scheme https, that overrides the default generated
// endpoint for a client.
// This must be provided and cannot be empty.
//
// +kubebuilder:validation:Pattern=`^https://`
// +required
URL string `json:"url"`
}

// GCPPlatformSpec holds the desired state of the Google Cloud Platform infrastructure provider.
// This only includes fields that can be modified in the cluster.
type GCPPlatformSpec struct{}
type GCPPlatformSpec struct {
// serviceEndpoints list contains custom endpoints which will override default
// service endpoint of GCP Services.
// There must be only one ServiceEndpoint for a service.
// +listType=atomic
// +optional
ServiceEndpoints []GCPServiceEndpoint `json:"serviceEndpoints,omitempty"`
}

// GCPPlatformStatus holds the current status of the Google Cloud Platform infrastructure provider.
// +openshift:validation:FeatureGateAwareXValidation:featureGate=GCPLabelsTags,rule="!has(oldSelf.resourceLabels) && !has(self.resourceLabels) || has(oldSelf.resourceLabels) && has(self.resourceLabels)",message="resourceLabels may only be configured during installation"
Expand Down Expand Up @@ -675,6 +702,13 @@ type GCPPlatformStatus struct {
// +optional
// +nullable
CloudLoadBalancerConfig *CloudLoadBalancerConfig `json:"cloudLoadBalancerConfig,omitempty"`

// serviceEndpoints list contains custom endpoints which will override default
// service endpoint of GCP Services.
// There must be only one ServiceEndpoint for a service.
// +listType=atomic
// +optional
ServiceEndpoints []GCPServiceEndpoint `json:"serviceEndpoints,omitempty"`
}

// GCPResourceLabel is a label to apply to GCP resources created for the cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,37 @@ spec:
gcp:
description: gcp contains settings specific to the Google Cloud
Platform infrastructure provider.
properties:
serviceEndpoints:
description: |-
serviceEndpoints list contains custom endpoints which will override default
service endpoint of GCP Services.
There must be only one ServiceEndpoint for a service.
items:
description: |-
GCPServiceEndpoint store the configuration of a custom url to
override existing defaults of GCP Services.
properties:
name:
description: |-
name is the name of the GCP service.
The list of all the service names can be found at https://developers.google.com/apis-explorer
This must be provided and cannot be empty.
pattern: ^[a-z0-9-]+$
type: string
url:
description: |-
url is fully qualified URI with scheme https, that overrides the default generated
endpoint for a client.
This must be provided and cannot be empty.
pattern: ^https://
type: string
required:
- name
- url
type: object
type: array
x-kubernetes-list-type: atomic
type: object
ibmcloud:
description: ibmcloud contains settings specific to the IBMCloud
Expand Down Expand Up @@ -1808,6 +1839,36 @@ spec:
- message: resourceTags are immutable and may only be configured
during installation
rule: self.all(x, x in oldSelf) && oldSelf.all(x, x in self)
serviceEndpoints:
description: |-
serviceEndpoints list contains custom endpoints which will override default
service endpoint of GCP Services.
There must be only one ServiceEndpoint for a service.
items:
description: |-
GCPServiceEndpoint store the configuration of a custom url to
override existing defaults of GCP Services.
properties:
name:
description: |-
name is the name of the GCP service.
The list of all the service names can be found at https://developers.google.com/apis-explorer
This must be provided and cannot be empty.
pattern: ^[a-z0-9-]+$
type: string
url:
description: |-
url is fully qualified URI with scheme https, that overrides the default generated
endpoint for a client.
This must be provided and cannot be empty.
pattern: ^https://
type: string
required:
- name
- url
type: object
type: array
x-kubernetes-list-type: atomic
type: object
x-kubernetes-validations:
- message: resourceLabels may only be configured during installation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,37 @@ spec:
gcp:
description: gcp contains settings specific to the Google Cloud
Platform infrastructure provider.
properties:
serviceEndpoints:
description: |-
serviceEndpoints list contains custom endpoints which will override default
service endpoint of GCP Services.
There must be only one ServiceEndpoint for a service.
items:
description: |-
GCPServiceEndpoint store the configuration of a custom url to
override existing defaults of GCP Services.
properties:
name:
description: |-
name is the name of the GCP service.
The list of all the service names can be found at https://developers.google.com/apis-explorer
This must be provided and cannot be empty.
pattern: ^[a-z0-9-]+$
type: string
url:
description: |-
url is fully qualified URI with scheme https, that overrides the default generated
endpoint for a client.
This must be provided and cannot be empty.
pattern: ^https://
type: string
required:
- name
- url
type: object
type: array
x-kubernetes-list-type: atomic
type: object
ibmcloud:
description: ibmcloud contains settings specific to the IBMCloud
Expand Down Expand Up @@ -1584,6 +1615,36 @@ spec:
- message: resourceTags are immutable and may only be configured
during installation
rule: self.all(x, x in oldSelf) && oldSelf.all(x, x in self)
serviceEndpoints:
description: |-
serviceEndpoints list contains custom endpoints which will override default
service endpoint of GCP Services.
There must be only one ServiceEndpoint for a service.
items:
description: |-
GCPServiceEndpoint store the configuration of a custom url to
override existing defaults of GCP Services.
properties:
name:
description: |-
name is the name of the GCP service.
The list of all the service names can be found at https://developers.google.com/apis-explorer
This must be provided and cannot be empty.
pattern: ^[a-z0-9-]+$
type: string
url:
description: |-
url is fully qualified URI with scheme https, that overrides the default generated
endpoint for a client.
This must be provided and cannot be empty.
pattern: ^https://
type: string
required:
- name
- url
type: object
type: array
x-kubernetes-list-type: atomic
type: object
x-kubernetes-validations:
- message: resourceLabels may only be configured during installation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,37 @@ spec:
gcp:
description: gcp contains settings specific to the Google Cloud
Platform infrastructure provider.
properties:
serviceEndpoints:
description: |-
serviceEndpoints list contains custom endpoints which will override default
service endpoint of GCP Services.
There must be only one ServiceEndpoint for a service.
items:
description: |-
GCPServiceEndpoint store the configuration of a custom url to
override existing defaults of GCP Services.
properties:
name:
description: |-
name is the name of the GCP service.
The list of all the service names can be found at https://developers.google.com/apis-explorer
This must be provided and cannot be empty.
pattern: ^[a-z0-9-]+$
type: string
url:
description: |-
url is fully qualified URI with scheme https, that overrides the default generated
endpoint for a client.
This must be provided and cannot be empty.
pattern: ^https://
type: string
required:
- name
- url
type: object
type: array
x-kubernetes-list-type: atomic
type: object
ibmcloud:
description: ibmcloud contains settings specific to the IBMCloud
Expand Down Expand Up @@ -1808,6 +1839,36 @@ spec:
- message: resourceTags are immutable and may only be configured
during installation
rule: self.all(x, x in oldSelf) && oldSelf.all(x, x in self)
serviceEndpoints:
description: |-
serviceEndpoints list contains custom endpoints which will override default
service endpoint of GCP Services.
There must be only one ServiceEndpoint for a service.
items:
description: |-
GCPServiceEndpoint store the configuration of a custom url to
override existing defaults of GCP Services.
properties:
name:
description: |-
name is the name of the GCP service.
The list of all the service names can be found at https://developers.google.com/apis-explorer
This must be provided and cannot be empty.
pattern: ^[a-z0-9-]+$
type: string
url:
description: |-
url is fully qualified URI with scheme https, that overrides the default generated
endpoint for a client.
This must be provided and cannot be empty.
pattern: ^https://
type: string
required:
- name
- url
type: object
type: array
x-kubernetes-list-type: atomic
type: object
x-kubernetes-validations:
- message: resourceLabels may only be configured during installation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,37 @@ spec:
gcp:
description: gcp contains settings specific to the Google Cloud
Platform infrastructure provider.
properties:
serviceEndpoints:
description: |-
serviceEndpoints list contains custom endpoints which will override default
service endpoint of GCP Services.
There must be only one ServiceEndpoint for a service.
items:
description: |-
GCPServiceEndpoint store the configuration of a custom url to
override existing defaults of GCP Services.
properties:
name:
description: |-
name is the name of the GCP service.
The list of all the service names can be found at https://developers.google.com/apis-explorer
This must be provided and cannot be empty.
pattern: ^[a-z0-9-]+$
type: string
url:
description: |-
url is fully qualified URI with scheme https, that overrides the default generated
endpoint for a client.
This must be provided and cannot be empty.
pattern: ^https://
type: string
required:
- name
- url
type: object
type: array
x-kubernetes-list-type: atomic
type: object
ibmcloud:
description: ibmcloud contains settings specific to the IBMCloud
Expand Down Expand Up @@ -1808,6 +1839,36 @@ spec:
- message: resourceTags are immutable and may only be configured
during installation
rule: self.all(x, x in oldSelf) && oldSelf.all(x, x in self)
serviceEndpoints:
description: |-
serviceEndpoints list contains custom endpoints which will override default
service endpoint of GCP Services.
There must be only one ServiceEndpoint for a service.
items:
description: |-
GCPServiceEndpoint store the configuration of a custom url to
override existing defaults of GCP Services.
properties:
name:
description: |-
name is the name of the GCP service.
The list of all the service names can be found at https://developers.google.com/apis-explorer
This must be provided and cannot be empty.
pattern: ^[a-z0-9-]+$
type: string
url:
description: |-
url is fully qualified URI with scheme https, that overrides the default generated
endpoint for a client.
This must be provided and cannot be empty.
pattern: ^https://
type: string
required:
- name
- url
type: object
type: array
x-kubernetes-list-type: atomic
type: object
x-kubernetes-validations:
- message: resourceLabels may only be configured during installation
Expand Down
Loading

0 comments on commit a2f03bb

Please sign in to comment.