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 c20e632
Show file tree
Hide file tree
Showing 42 changed files with 2,223 additions and 5 deletions.
34 changes: 33 additions & 1 deletion config/v1/types_infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -620,9 +620,34 @@ 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-]+$`
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://`
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 +700,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,34 @@ 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
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 +1836,33 @@ 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
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,34 @@ 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
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 +1612,33 @@ 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
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,34 @@ 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
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 +1836,33 @@ 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
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,34 @@ 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
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 +1836,33 @@ 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
type: object
type: array
x-kubernetes-list-type: atomic
type: object
x-kubernetes-validations:
- message: resourceLabels may only be configured during installation
Expand Down
28 changes: 27 additions & 1 deletion config/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c20e632

Please sign in to comment.