Skip to content

Commit 891ffcf

Browse files
committed
Fix setting project_name in config files
'project_name=service' was hardcoded in the octavia config file but the name of the project depends on the value of spec.tenantName JIRA: OSPRH-12242
1 parent 3102aab commit 891ffcf

14 files changed

+43
-14
lines changed

api/bases/octavia.openstack.org_octaviaamphoracontrollers.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ spec:
230230
tenantName:
231231
default: service
232232
description: TenantName - the name of the OpenStack tenant that controls
233-
the Octavia resources TODO(gthiemonge) same as ServiceAccount?
233+
the Octavia resources
234234
type: string
235235
tls:
236236
description: TLS - Parameters related to the TLS

api/bases/octavia.openstack.org_octaviaapis.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,11 @@ spec:
366366
default: octavia
367367
description: ServiceUser - service user name
368368
type: string
369+
tenantName:
370+
default: service
371+
description: TenantName - the name of the OpenStack tenant that controls
372+
the Octavia resources
373+
type: string
369374
tls:
370375
description: TLS - Parameters related to the TLS
371376
properties:

api/bases/octavia.openstack.org_octavias.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,11 @@ spec:
480480
default: octavia
481481
description: ServiceUser - service user name
482482
type: string
483+
tenantName:
484+
default: service
485+
description: TenantName - the name of the OpenStack tenant that
486+
controls the Octavia resources
487+
type: string
483488
tls:
484489
description: TLS - Parameters related to the TLS
485490
properties:
@@ -715,7 +720,7 @@ spec:
715720
tenantName:
716721
default: service
717722
description: TenantName - the name of the OpenStack tenant that
718-
controls the Octavia resources TODO(gthiemonge) same as ServiceAccount?
723+
controls the Octavia resources
719724
type: string
720725
tls:
721726
description: TLS - Parameters related to the TLS
@@ -921,7 +926,7 @@ spec:
921926
tenantName:
922927
default: service
923928
description: TenantName - the name of the OpenStack tenant that
924-
controls the Octavia resources TODO(gthiemonge) same as ServiceAccount?
929+
controls the Octavia resources
925930
type: string
926931
tls:
927932
description: TLS - Parameters related to the TLS
@@ -1261,7 +1266,7 @@ spec:
12611266
tenantName:
12621267
default: service
12631268
description: TenantName - the name of the OpenStack tenant that
1264-
controls the Octavia resources TODO(gthiemonge) same as ServiceAccount?
1269+
controls the Octavia resources
12651270
type: string
12661271
tls:
12671272
description: TLS - Parameters related to the TLS

api/v1beta1/amphoracontroller_types.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ type OctaviaAmphoraControllerSpecCore struct {
120120
// +kubebuilder:validation:Optional
121121
// +kubebuilder:default=service
122122
// TenantName - the name of the OpenStack tenant that controls the Octavia resources
123-
// TODO(gthiemonge) same as ServiceAccount?
124123
TenantName string `json:"tenantName"`
125124

126125
// +kubebuilder:validation:Optional

api/v1beta1/octaviaapi_types.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,11 @@ type OctaviaAPISpecCore struct {
137137
// NetworkAttachments is a list of NetworkAttachment resource names to expose the services to the given network
138138
NetworkAttachments []string `json:"networkAttachments,omitempty"`
139139

140+
// +kubebuilder:validation:Optional
141+
// +kubebuilder:default=service
142+
// TenantName - the name of the OpenStack tenant that controls the Octavia resources
143+
TenantName string `json:"tenantName"`
144+
140145
// +kubebuilder:validation:Optional
141146
// +operator-sdk:csv:customresourcedefinitions:type=spec
142147
// TLS - Parameters related to the TLS

config/crd/bases/octavia.openstack.org_octaviaamphoracontrollers.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ spec:
230230
tenantName:
231231
default: service
232232
description: TenantName - the name of the OpenStack tenant that controls
233-
the Octavia resources TODO(gthiemonge) same as ServiceAccount?
233+
the Octavia resources
234234
type: string
235235
tls:
236236
description: TLS - Parameters related to the TLS

config/crd/bases/octavia.openstack.org_octaviaapis.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,11 @@ spec:
366366
default: octavia
367367
description: ServiceUser - service user name
368368
type: string
369+
tenantName:
370+
default: service
371+
description: TenantName - the name of the OpenStack tenant that controls
372+
the Octavia resources
373+
type: string
369374
tls:
370375
description: TLS - Parameters related to the TLS
371376
properties:

config/crd/bases/octavia.openstack.org_octavias.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,11 @@ spec:
480480
default: octavia
481481
description: ServiceUser - service user name
482482
type: string
483+
tenantName:
484+
default: service
485+
description: TenantName - the name of the OpenStack tenant that
486+
controls the Octavia resources
487+
type: string
483488
tls:
484489
description: TLS - Parameters related to the TLS
485490
properties:
@@ -715,7 +720,7 @@ spec:
715720
tenantName:
716721
default: service
717722
description: TenantName - the name of the OpenStack tenant that
718-
controls the Octavia resources TODO(gthiemonge) same as ServiceAccount?
723+
controls the Octavia resources
719724
type: string
720725
tls:
721726
description: TLS - Parameters related to the TLS
@@ -921,7 +926,7 @@ spec:
921926
tenantName:
922927
default: service
923928
description: TenantName - the name of the OpenStack tenant that
924-
controls the Octavia resources TODO(gthiemonge) same as ServiceAccount?
929+
controls the Octavia resources
925930
type: string
926931
tls:
927932
description: TLS - Parameters related to the TLS
@@ -1261,7 +1266,7 @@ spec:
12611266
tenantName:
12621267
default: service
12631268
description: TenantName - the name of the OpenStack tenant that
1264-
controls the Octavia resources TODO(gthiemonge) same as ServiceAccount?
1269+
controls the Octavia resources
12651270
type: string
12661271
tls:
12671272
description: TLS - Parameters related to the TLS

controllers/amphoracontroller_controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,7 @@ func (r *OctaviaAmphoraControllerReconciler) generateServiceSecrets(
624624
spec := instance.Spec
625625
templateParameters["TransportURL"] = transportURL
626626
templateParameters["ServiceUser"] = spec.ServiceUser
627+
templateParameters["TenantName"] = spec.TenantName
627628
templateParameters["Password"] = servicePassword
628629
templateParameters["KeystoneInternalURL"] = keystoneInternalURL
629630
templateParameters["KeystonePublicURL"] = keystonePublicURL

controllers/octavia_controller.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,6 +1416,7 @@ func (r *OctaviaReconciler) generateServiceSecrets(
14161416
),
14171417
}
14181418
templateParameters["ServiceUser"] = instance.Spec.ServiceUser
1419+
templateParameters["TenantName"] = instance.Spec.TenantName
14191420

14201421
cms := []util.Template{
14211422
{
@@ -1487,6 +1488,7 @@ func (r *OctaviaReconciler) apiDeploymentCreateOrUpdate(instance *octaviav1.Octa
14871488
deployment.Spec.DatabaseAccount = instance.Spec.DatabaseAccount
14881489
deployment.Spec.PersistenceDatabaseAccount = instance.Spec.PersistenceDatabaseAccount
14891490
deployment.Spec.ServiceUser = instance.Spec.ServiceUser
1491+
deployment.Spec.TenantName = instance.Spec.TenantName
14901492
deployment.Spec.TransportURLSecret = instance.Status.TransportURLSecret
14911493
deployment.Spec.Secret = instance.Spec.Secret
14921494
deployment.Spec.ServiceAccount = instance.RbacResourceName()
@@ -1550,6 +1552,7 @@ func (r *OctaviaReconciler) amphoraControllerDaemonSetCreateOrUpdate(
15501552
daemonset.Spec.DatabaseAccount = instance.Spec.DatabaseAccount
15511553
daemonset.Spec.PersistenceDatabaseAccount = instance.Spec.PersistenceDatabaseAccount
15521554
daemonset.Spec.ServiceUser = instance.Spec.ServiceUser
1555+
daemonset.Spec.TenantName = instance.Spec.TenantName
15531556
daemonset.Spec.Secret = instance.Spec.Secret
15541557
daemonset.Spec.TransportURLSecret = instance.Status.TransportURLSecret
15551558
daemonset.Spec.ServiceAccount = instance.RbacResourceName()

0 commit comments

Comments
 (0)