Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions api/bases/nova.openstack.org_novaapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,10 @@ spec:
The key must be the endpoint type (public, internal)
type: object
type: object
region:
description: Region - the region name to use for service endpoint
discovery
type: string
registeredCells:
additionalProperties:
type: string
Expand Down
4 changes: 4 additions & 0 deletions api/bases/nova.openstack.org_novacells.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,10 @@ spec:
description: PreserveJobs - do not delete jobs after they finished
e.g. to check logs
type: boolean
region:
description: Region - the region name to use for service endpoint
discovery
type: string
secret:
description: |-
Secret is the name of the Secret instance containing password
Expand Down
4 changes: 4 additions & 0 deletions api/bases/nova.openstack.org_novacomputes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ spec:
description: NodeSelector to target subset of worker nodes running
this service
type: object
region:
description: Region - the region name to use for service endpoint
discovery
type: string
replicas:
default: 1
description: Replicas of the service to run
Expand Down
4 changes: 4 additions & 0 deletions api/bases/nova.openstack.org_novaconductors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ spec:
description: PreserveJobs - do not delete jobs after they finished
e.g. to check logs
type: boolean
region:
description: Region - the region name to use for service endpoint
discovery
type: string
replicas:
default: 1
description: Replicas of the service to run
Expand Down
4 changes: 4 additions & 0 deletions api/bases/nova.openstack.org_novametadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,10 @@ spec:
type: object
type: object
type: object
region:
description: Region - the region name to use for service endpoint
discovery
type: string
registeredCells:
additionalProperties:
type: string
Expand Down
4 changes: 4 additions & 0 deletions api/bases/nova.openstack.org_novanovncproxies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,10 @@ spec:
type: object
type: object
type: object
region:
description: Region - the region name to use for service endpoint
discovery
type: string
replicas:
default: 1
description: Replicas of the service to run
Expand Down
4 changes: 4 additions & 0 deletions api/bases/nova.openstack.org_novaschedulers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ spec:
description: NodeSelector to target subset of worker nodes running
this service
type: object
region:
description: Region - the region name to use for service endpoint
discovery
type: string
registeredCells:
additionalProperties:
type: string
Expand Down
4 changes: 4 additions & 0 deletions api/v1beta1/novaapi_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ type NovaAPISpec struct {
// to redirect unauthenticated users.
KeystonePublicAuthURL string `json:"keystonePublicAuthURL"`

// +kubebuilder:validation:Optional
// Region - the region name to use for service endpoint discovery
Region string `json:"region,omitempty"`

// +kubebuilder:validation:Optional
// +kubebuilder:default="nova-api"
// APIDatabaseAccount - MariaDBAccount to use when accessing the API DB
Expand Down
4 changes: 4 additions & 0 deletions api/v1beta1/novacell_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ type NovaCellSpec struct {
// to keystone
KeystoneAuthURL string `json:"keystoneAuthURL"`

// +kubebuilder:validation:Optional
// Region - the region name to use for service endpoint discovery
Region string `json:"region,omitempty"`

// +kubebuilder:validation:Optional
// +kubebuilder:default=nova
// APIDatabaseAccount - MariaDBAccount to use when accessing the API DB
Expand Down
4 changes: 4 additions & 0 deletions api/v1beta1/novacompute_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ type NovaComputeSpec struct {
// +kubebuilder:validation:Required
KeystoneAuthURL string `json:"keystoneAuthURL"`

// +kubebuilder:validation:Optional
// Region - the region name to use for service endpoint discovery
Region string `json:"region,omitempty"`

// NovaServiceBase specifies the generic fields of the service
NovaServiceBase `json:",inline"`

Expand Down
9 changes: 9 additions & 0 deletions api/v1beta1/novaconductor_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ type NovaConductorSpec struct {
// talk to keystone
KeystoneAuthURL string `json:"keystoneAuthURL"`

// +kubebuilder:validation:Optional
// Region - the region name to use for service endpoint discovery
Region string `json:"region,omitempty"`

// +kubebuilder:validation:Optional
// +kubebuilder:default=nova
// APIDatabaseAccount - MariaDBAccount to use when accessing the API DB
Expand Down Expand Up @@ -258,6 +262,11 @@ func (n NovaConductor) GetCABundleSecretName() string {
return n.Spec.TLS.CaBundleSecretName
}

// GetRegion returns the Region from the Spec
func (n NovaConductor) GetRegion() string {
return n.Spec.Region
}

// GetSpecTopologyRef - Returns the LastAppliedTopology Set in the Status
func (n *NovaConductor) GetSpecTopologyRef() *topologyv1.TopoRef {
return n.Spec.TopologyRef
Expand Down
4 changes: 4 additions & 0 deletions api/v1beta1/novametadata_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ type NovaMetadataSpec struct {
// TODO(ksambor) Add checking if dynamic vendor data is configured
KeystoneAuthURL string `json:"keystoneAuthURL"`

// +kubebuilder:validation:Optional
// Region - the region name to use for service endpoint discovery
Region string `json:"region,omitempty"`

// +kubebuilder:validation:Optional
// +kubebuilder:default="nova-api"
// APIDatabaseAccount - MariaDBAccount to use when accessing the API DB
Expand Down
4 changes: 4 additions & 0 deletions api/v1beta1/novanovncproxy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ type NovaNoVNCProxySpec struct {
// talk to keystone
KeystoneAuthURL string `json:"keystoneAuthURL"`

// +kubebuilder:validation:Optional
// Region - the region name to use for service endpoint discovery
Region string `json:"region,omitempty"`

// +kubebuilder:validation:Optional
// +kubebuilder:default=nova
// CellDatabaseAccount - MariaDBAccount to use when accessing the cell DB
Expand Down
9 changes: 9 additions & 0 deletions api/v1beta1/novascheduler_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ type NovaSchedulerSpec struct {
// talk to keystone
KeystoneAuthURL string `json:"keystoneAuthURL"`

// +kubebuilder:validation:Optional
// Region - the region name to use for service endpoint discovery
Region string `json:"region,omitempty"`

// +kubebuilder:validation:Optional
// +kubebuilder:default=nova-api
// APIDatabaseAccount - MariaDBAccount to use when accessing the API DB
Expand Down Expand Up @@ -208,6 +212,11 @@ func (n NovaScheduler) GetCABundleSecretName() string {
return n.Spec.TLS.CaBundleSecretName
}

// GetRegion returns the Region from the Spec
func (n NovaScheduler) GetRegion() string {
return n.Spec.Region
}

// GetSpecTopologyRef - Returns the LastAppliedTopology Set in the Status
func (n *NovaScheduler) GetSpecTopologyRef() *topologyv1.TopoRef {
return n.Spec.TopologyRef
Expand Down
4 changes: 4 additions & 0 deletions config/crd/bases/nova.openstack.org_novaapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,10 @@ spec:
The key must be the endpoint type (public, internal)
type: object
type: object
region:
description: Region - the region name to use for service endpoint
discovery
type: string
registeredCells:
additionalProperties:
type: string
Expand Down
4 changes: 4 additions & 0 deletions config/crd/bases/nova.openstack.org_novacells.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,10 @@ spec:
description: PreserveJobs - do not delete jobs after they finished
e.g. to check logs
type: boolean
region:
description: Region - the region name to use for service endpoint
discovery
type: string
secret:
description: |-
Secret is the name of the Secret instance containing password
Expand Down
4 changes: 4 additions & 0 deletions config/crd/bases/nova.openstack.org_novacomputes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ spec:
description: NodeSelector to target subset of worker nodes running
this service
type: object
region:
description: Region - the region name to use for service endpoint
discovery
type: string
replicas:
default: 1
description: Replicas of the service to run
Expand Down
4 changes: 4 additions & 0 deletions config/crd/bases/nova.openstack.org_novaconductors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ spec:
description: PreserveJobs - do not delete jobs after they finished
e.g. to check logs
type: boolean
region:
description: Region - the region name to use for service endpoint
discovery
type: string
replicas:
default: 1
description: Replicas of the service to run
Expand Down
4 changes: 4 additions & 0 deletions config/crd/bases/nova.openstack.org_novametadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,10 @@ spec:
type: object
type: object
type: object
region:
description: Region - the region name to use for service endpoint
discovery
type: string
registeredCells:
additionalProperties:
type: string
Expand Down
4 changes: 4 additions & 0 deletions config/crd/bases/nova.openstack.org_novanovncproxies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,10 @@ spec:
type: object
type: object
type: object
region:
description: Region - the region name to use for service endpoint
discovery
type: string
replicas:
default: 1
description: Replicas of the service to run
Expand Down
4 changes: 4 additions & 0 deletions config/crd/bases/nova.openstack.org_novaschedulers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ spec:
description: NodeSelector to target subset of worker nodes running
this service
type: object
region:
description: Region - the region name to use for service endpoint
discovery
type: string
registeredCells:
additionalProperties:
type: string
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ require (
github.com/openstack-k8s-operators/nova-operator/api v0.0.0-20221209164002-f9e6b9363961
go.uber.org/zap v1.27.0
golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67
gopkg.in/ini.v1 v1.67.0
gopkg.in/yaml.v3 v3.0.1
k8s.io/api v0.31.13
k8s.io/apimachinery v0.31.13
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSP
gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
Expand Down
7 changes: 4 additions & 3 deletions internal/controller/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,7 @@ type clientAuth interface {
GetKeystoneAuthURL() string
GetKeystoneUser() string
GetCABundleSecretName() string
GetRegion() string
}

func getNovaClient(
Expand Down Expand Up @@ -686,9 +687,9 @@ func getNovaClient(
AuthURL: authURL,
Username: auth.GetKeystoneUser(),
Password: password,
DomainName: "Default", // fixme",
Region: "regionOne", // fixme",
TenantName: "service", // fixme",
DomainName: "Default", // fixme",
Region: auth.GetRegion(),
TenantName: "service", // fixme",
TLS: tlsConfig,
}
endpointOpts := gophercloud.EndpointOpts{
Expand Down
Loading