Skip to content

Commit

Permalink
Merge pull request #424 from gthiemonge/fix_tenant_name
Browse files Browse the repository at this point in the history
Fix setting project_name in config files
  • Loading branch information
openshift-merge-bot[bot] authored Dec 6, 2024
2 parents e0f70e3 + 891ffcf commit 62f16e4
Show file tree
Hide file tree
Showing 14 changed files with 43 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ spec:
tenantName:
default: service
description: TenantName - the name of the OpenStack tenant that controls
the Octavia resources TODO(gthiemonge) same as ServiceAccount?
the Octavia resources
type: string
tls:
description: TLS - Parameters related to the TLS
Expand Down
5 changes: 5 additions & 0 deletions api/bases/octavia.openstack.org_octaviaapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,11 @@ spec:
default: octavia
description: ServiceUser - service user name
type: string
tenantName:
default: service
description: TenantName - the name of the OpenStack tenant that controls
the Octavia resources
type: string
tls:
description: TLS - Parameters related to the TLS
properties:
Expand Down
11 changes: 8 additions & 3 deletions api/bases/octavia.openstack.org_octavias.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,11 @@ spec:
default: octavia
description: ServiceUser - service user name
type: string
tenantName:
default: service
description: TenantName - the name of the OpenStack tenant that
controls the Octavia resources
type: string
tls:
description: TLS - Parameters related to the TLS
properties:
Expand Down Expand Up @@ -715,7 +720,7 @@ spec:
tenantName:
default: service
description: TenantName - the name of the OpenStack tenant that
controls the Octavia resources TODO(gthiemonge) same as ServiceAccount?
controls the Octavia resources
type: string
tls:
description: TLS - Parameters related to the TLS
Expand Down Expand Up @@ -921,7 +926,7 @@ spec:
tenantName:
default: service
description: TenantName - the name of the OpenStack tenant that
controls the Octavia resources TODO(gthiemonge) same as ServiceAccount?
controls the Octavia resources
type: string
tls:
description: TLS - Parameters related to the TLS
Expand Down Expand Up @@ -1261,7 +1266,7 @@ spec:
tenantName:
default: service
description: TenantName - the name of the OpenStack tenant that
controls the Octavia resources TODO(gthiemonge) same as ServiceAccount?
controls the Octavia resources
type: string
tls:
description: TLS - Parameters related to the TLS
Expand Down
1 change: 0 additions & 1 deletion api/v1beta1/amphoracontroller_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ type OctaviaAmphoraControllerSpecCore struct {
// +kubebuilder:validation:Optional
// +kubebuilder:default=service
// TenantName - the name of the OpenStack tenant that controls the Octavia resources
// TODO(gthiemonge) same as ServiceAccount?
TenantName string `json:"tenantName"`

// +kubebuilder:validation:Optional
Expand Down
5 changes: 5 additions & 0 deletions api/v1beta1/octaviaapi_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ type OctaviaAPISpecCore struct {
// NetworkAttachments is a list of NetworkAttachment resource names to expose the services to the given network
NetworkAttachments []string `json:"networkAttachments,omitempty"`

// +kubebuilder:validation:Optional
// +kubebuilder:default=service
// TenantName - the name of the OpenStack tenant that controls the Octavia resources
TenantName string `json:"tenantName"`

// +kubebuilder:validation:Optional
// +operator-sdk:csv:customresourcedefinitions:type=spec
// TLS - Parameters related to the TLS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ spec:
tenantName:
default: service
description: TenantName - the name of the OpenStack tenant that controls
the Octavia resources TODO(gthiemonge) same as ServiceAccount?
the Octavia resources
type: string
tls:
description: TLS - Parameters related to the TLS
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/octavia.openstack.org_octaviaapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,11 @@ spec:
default: octavia
description: ServiceUser - service user name
type: string
tenantName:
default: service
description: TenantName - the name of the OpenStack tenant that controls
the Octavia resources
type: string
tls:
description: TLS - Parameters related to the TLS
properties:
Expand Down
11 changes: 8 additions & 3 deletions config/crd/bases/octavia.openstack.org_octavias.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,11 @@ spec:
default: octavia
description: ServiceUser - service user name
type: string
tenantName:
default: service
description: TenantName - the name of the OpenStack tenant that
controls the Octavia resources
type: string
tls:
description: TLS - Parameters related to the TLS
properties:
Expand Down Expand Up @@ -715,7 +720,7 @@ spec:
tenantName:
default: service
description: TenantName - the name of the OpenStack tenant that
controls the Octavia resources TODO(gthiemonge) same as ServiceAccount?
controls the Octavia resources
type: string
tls:
description: TLS - Parameters related to the TLS
Expand Down Expand Up @@ -921,7 +926,7 @@ spec:
tenantName:
default: service
description: TenantName - the name of the OpenStack tenant that
controls the Octavia resources TODO(gthiemonge) same as ServiceAccount?
controls the Octavia resources
type: string
tls:
description: TLS - Parameters related to the TLS
Expand Down Expand Up @@ -1261,7 +1266,7 @@ spec:
tenantName:
default: service
description: TenantName - the name of the OpenStack tenant that
controls the Octavia resources TODO(gthiemonge) same as ServiceAccount?
controls the Octavia resources
type: string
tls:
description: TLS - Parameters related to the TLS
Expand Down
1 change: 1 addition & 0 deletions controllers/amphoracontroller_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,7 @@ func (r *OctaviaAmphoraControllerReconciler) generateServiceSecrets(
spec := instance.Spec
templateParameters["TransportURL"] = transportURL
templateParameters["ServiceUser"] = spec.ServiceUser
templateParameters["TenantName"] = spec.TenantName
templateParameters["Password"] = servicePassword
templateParameters["KeystoneInternalURL"] = keystoneInternalURL
templateParameters["KeystonePublicURL"] = keystonePublicURL
Expand Down
3 changes: 3 additions & 0 deletions controllers/octavia_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1421,6 +1421,7 @@ func (r *OctaviaReconciler) generateServiceSecrets(
),
}
templateParameters["ServiceUser"] = instance.Spec.ServiceUser
templateParameters["TenantName"] = instance.Spec.TenantName

cms := []util.Template{
{
Expand Down Expand Up @@ -1492,6 +1493,7 @@ func (r *OctaviaReconciler) apiDeploymentCreateOrUpdate(instance *octaviav1.Octa
deployment.Spec.DatabaseAccount = instance.Spec.DatabaseAccount
deployment.Spec.PersistenceDatabaseAccount = instance.Spec.PersistenceDatabaseAccount
deployment.Spec.ServiceUser = instance.Spec.ServiceUser
deployment.Spec.TenantName = instance.Spec.TenantName
deployment.Spec.TransportURLSecret = instance.Status.TransportURLSecret
deployment.Spec.Secret = instance.Spec.Secret
deployment.Spec.ServiceAccount = instance.RbacResourceName()
Expand Down Expand Up @@ -1555,6 +1557,7 @@ func (r *OctaviaReconciler) amphoraControllerDaemonSetCreateOrUpdate(
daemonset.Spec.DatabaseAccount = instance.Spec.DatabaseAccount
daemonset.Spec.PersistenceDatabaseAccount = instance.Spec.PersistenceDatabaseAccount
daemonset.Spec.ServiceUser = instance.Spec.ServiceUser
daemonset.Spec.TenantName = instance.Spec.TenantName
daemonset.Spec.Secret = instance.Spec.Secret
daemonset.Spec.TransportURLSecret = instance.Status.TransportURLSecret
daemonset.Spec.ServiceAccount = instance.RbacResourceName()
Expand Down
1 change: 1 addition & 0 deletions controllers/octaviaapi_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,7 @@ func (r *OctaviaAPIReconciler) generateServiceSecrets(
templateParameters["TransportURL"] = transportURL

templateParameters["ServiceUser"] = instance.Spec.ServiceUser
templateParameters["TenantName"] = instance.Spec.TenantName
templateParameters["KeystoneInternalURL"] = keystoneInternalURL
templateParameters["KeystonePublicURL"] = keystonePublicURL
templateParameters["NBConnection"], err = nbCluster.GetInternalEndpoint()
Expand Down
2 changes: 1 addition & 1 deletion templates/octavia/config/octavia.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ stats_update_threads=4
[keystone_authtoken]
username={{ .ServiceUser }}
# password=FIXMEpw3
project_name=service
project_name={{ .TenantName }}
project_domain_name=Default
user_domain_name=Default
auth_type=password
Expand Down
4 changes: 2 additions & 2 deletions templates/octaviaamphoracontroller/config/octavia.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ www_authenticate_uri={{ .KeystonePublicURL }}
auth_url={{ .KeystoneInternalURL }}
username={{ .ServiceUser }}
password={{ .Password }}
project_name=service
project_name={{ .TenantName }}
project_domain_name=Default
user_domain_name=Default
auth_type=password
Expand Down Expand Up @@ -67,7 +67,7 @@ disable_local_log_storage=False

[service_auth]
project_domain_name=Default
project_name=service
project_name={{ .TenantName }}
user_domain_name=Default
password={{ .Password }}
username=octavia
Expand Down
4 changes: 2 additions & 2 deletions templates/octaviaapi/config/octavia.conf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ www_authenticate_uri={{ .KeystonePublicURL }}
auth_url={{ .KeystoneInternalURL }}
username={{ .ServiceUser }}
password={{ .Password }}
project_name=service
project_name={{ .TenantName }}
project_domain_name=Default
user_domain_name=Default
auth_type=password
Expand Down Expand Up @@ -74,7 +74,7 @@ disable_local_log_storage=False

[service_auth]
project_domain_name=Default
project_name=service
project_name={{ .TenantName }}
user_domain_name=Default
password={{ .Password }}
username=octavia
Expand Down

0 comments on commit 62f16e4

Please sign in to comment.