Skip to content

Commit

Permalink
Merge pull request #182 from Deydra71/fix-custom-config
Browse files Browse the repository at this point in the history
Fix CustomServiceConfig barbican configuration
  • Loading branch information
openshift-merge-bot[bot] authored Nov 12, 2024
2 parents eebfdec + 760e9c4 commit b7a77ac
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 38 deletions.
4 changes: 2 additions & 2 deletions api/bases/barbican.openstack.org_barbicanapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ spec:
description: CustomServiceConfig - customize the service config using
this parameter to change service defaults, or overwrite rendered
information using raw OpenStack config format. The content gets
added to to /etc/<service>/<service>.conf.d directory as custom.conf
file.
added to to /etc/<service>/<service>.conf.d directory as a custom
config file.
type: string
customServiceConfigSecrets:
description: CustomServiceConfigSecrets - customize the service config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ spec:
description: CustomServiceConfig - customize the service config using
this parameter to change service defaults, or overwrite rendered
information using raw OpenStack config format. The content gets
added to to /etc/<service>/<service>.conf.d directory as custom.conf
file.
added to to /etc/<service>/<service>.conf.d directory as a custom
config file.
type: string
customServiceConfigSecrets:
description: CustomServiceConfigSecrets - customize the service config
Expand Down
4 changes: 2 additions & 2 deletions api/bases/barbican.openstack.org_barbicanworkers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ spec:
description: CustomServiceConfig - customize the service config using
this parameter to change service defaults, or overwrite rendered
information using raw OpenStack config format. The content gets
added to to /etc/<service>/<service>.conf.d directory as custom.conf
file.
added to to /etc/<service>/<service>.conf.d directory as a custom
config file.
type: string
customServiceConfigSecrets:
description: CustomServiceConfigSecrets - customize the service config
Expand Down
6 changes: 0 additions & 6 deletions api/v1beta1/common_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@ type BarbicanTemplate struct {
// PasswordSelectors - Selectors to identify the ServiceUser password from the Secret
PasswordSelectors PasswordSelector `json:"passwordSelectors"`

// +kubebuilder:validation:Optional
// CustomServiceConfig - customize the service config using this parameter to change service defaults,
// or overwrite rendered information using raw OpenStack config format. The content gets added to
// to /etc/<service>/<service>.conf.d directory as custom.conf file.
CustomServiceConfig string `json:"customServiceConfig,omitempty"`

// +kubebuilder:validation:Required
// ServiceAccount - service account name used internally to provide Barbican services the default SA name
ServiceAccount string `json:"serviceAccount"`
Expand Down
4 changes: 2 additions & 2 deletions config/crd/bases/barbican.openstack.org_barbicanapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ spec:
description: CustomServiceConfig - customize the service config using
this parameter to change service defaults, or overwrite rendered
information using raw OpenStack config format. The content gets
added to to /etc/<service>/<service>.conf.d directory as custom.conf
file.
added to to /etc/<service>/<service>.conf.d directory as a custom
config file.
type: string
customServiceConfigSecrets:
description: CustomServiceConfigSecrets - customize the service config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ spec:
description: CustomServiceConfig - customize the service config using
this parameter to change service defaults, or overwrite rendered
information using raw OpenStack config format. The content gets
added to to /etc/<service>/<service>.conf.d directory as custom.conf
file.
added to to /etc/<service>/<service>.conf.d directory as a custom
config file.
type: string
customServiceConfigSecrets:
description: CustomServiceConfigSecrets - customize the service config
Expand Down
4 changes: 2 additions & 2 deletions config/crd/bases/barbican.openstack.org_barbicanworkers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ spec:
description: CustomServiceConfig - customize the service config using
this parameter to change service defaults, or overwrite rendered
information using raw OpenStack config format. The content gets
added to to /etc/<service>/<service>.conf.d directory as custom.conf
file.
added to to /etc/<service>/<service>.conf.d directory as a custom
config file.
type: string
customServiceConfigSecrets:
description: CustomServiceConfigSecrets - customize the service config
Expand Down
4 changes: 2 additions & 2 deletions controllers/barbicanapi_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ func (r *BarbicanAPIReconciler) generateServiceConfigs(
}
// customData hold any customization for the service.
customData := map[string]string{
common.CustomServiceConfigFileName: instance.Spec.CustomServiceConfig,
"my.cnf": db.GetDatabaseClientConfig(tlsCfg), //(mschuppert) for now just get the default my.cnf
barbican.CustomServiceConfigFileName: instance.Spec.CustomServiceConfig,
"my.cnf": db.GetDatabaseClientConfig(tlsCfg), //(mschuppert) for now just get the default my.cnf
}

for key, data := range instance.Spec.DefaultConfigOverwrite {
Expand Down
4 changes: 2 additions & 2 deletions controllers/barbicankeystonelistener_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ func (r *BarbicanKeystoneListenerReconciler) generateServiceConfigs(
}
// customData hold any customization for the service.
customData := map[string]string{
common.CustomServiceConfigFileName: instance.Spec.CustomServiceConfig,
"my.cnf": db.GetDatabaseClientConfig(tlsCfg), //(mschuppert) for now just get the default my.cnf
barbican.CustomServiceConfigFileName: instance.Spec.CustomServiceConfig,
"my.cnf": db.GetDatabaseClientConfig(tlsCfg), //(mschuppert) for now just get the default my.cnf
}
Log.Info(fmt.Sprintf("[KeystoneListener] instance type %s", instance.GetObjectKind().GroupVersionKind().Kind))

Expand Down
4 changes: 2 additions & 2 deletions controllers/barbicanworker_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ func (r *BarbicanWorkerReconciler) generateServiceConfigs(
}
// customData hold any customization for the service.
customData := map[string]string{
common.CustomServiceConfigFileName: instance.Spec.CustomServiceConfig,
"my.cnf": db.GetDatabaseClientConfig(tlsCfg), //(mschuppert) for now just get the default my.cnf
barbican.CustomServiceConfigFileName: instance.Spec.CustomServiceConfig,
"my.cnf": db.GetDatabaseClientConfig(tlsCfg), //(mschuppert) for now just get the default my.cnf
}

Log.Info(fmt.Sprintf("[Worker] instance type %s", instance.GetObjectKind().GroupVersionKind().Kind))
Expand Down
4 changes: 2 additions & 2 deletions pkg/barbican/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ const (
// CustomConfigFileName -
CustomConfigFileName = "01-custom.conf"
// CustomServiceConfigFileName -
CustomServiceConfigFileName = "02-service.conf"
CustomServiceConfigFileName = "02-service-custom.conf"
// CustomServiceConfigSecretsFileName -
CustomServiceConfigSecretsFileName = "03-secrets.conf"
CustomServiceConfigSecretsFileName = "03-secrets-custom.conf"
// BarbicanAPI defines the barbican-api group
BarbicanAPI storage.PropagationType = "BarbicanAPI"
// BarbicanWorker defines the barbican-worker group
Expand Down
8 changes: 4 additions & 4 deletions templates/barbican/config/barbican-api-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
"perm": "0600"
},
{
"source": "/var/lib/config-data/default/02-service.conf",
"dest": "/etc/barbican/barbican.conf.d/02-service.conf",
"source": "/var/lib/config-data/default/02-service-custom.conf",
"dest": "/etc/barbican/barbican.conf.d/custom.conf",
"owner": "barbican",
"perm": "0600",
"optional": true
},
{
"source": "/var/lib/config-data/default/03-secrets.conf",
"dest": "/etc/barbican/barbican.conf.d/03-secrets.conf",
"source": "/var/lib/config-data/default/03-secrets-custom.conf",
"dest": "/etc/barbican/barbican.conf.d/03-secrets-custom.conf",
"owner": "barbican",
"perm": "0640",
"optional": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
"perm": "0600"
},
{
"source": "/var/lib/config-data/default/02-service.conf",
"dest": "/etc/barbican/barbican.conf.d/02-service.conf",
"source": "/var/lib/config-data/default/02-service-custom.conf",
"dest": "/etc/barbican/barbican.conf.d/custom.conf",
"owner": "barbican",
"perm": "0600",
"optional": true
},
{
"source": "/var/lib/config-data/default/03-secrets.conf",
"dest": "/etc/barbican/barbican.conf.d/03-secrets.conf",
"source": "/var/lib/config-data/default/03-secrets-custom.conf",
"dest": "/etc/barbican/barbican.conf.d/03-secrets-custom.conf",
"owner": "barbican",
"perm": "0640",
"optional": true
Expand Down
8 changes: 4 additions & 4 deletions templates/barbican/config/barbican-worker-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
"perm": "0600"
},
{
"source": "/var/lib/config-data/default/02-service.conf",
"dest": "/etc/barbican/barbican.conf.d/02-service.conf",
"source": "/var/lib/config-data/default/02-service-custom.conf",
"dest": "/etc/barbican/barbican.conf.d/custom.conf",
"owner": "barbican",
"perm": "0600",
"optional": true
},
{
"source": "/var/lib/config-data/default/03-secrets.conf",
"dest": "/etc/barbican/barbican.conf.d/03-secrets.conf",
"source": "/var/lib/config-data/default/03-secrets-custom.conf",
"dest": "/etc/barbican/barbican.conf.d/03-secrets-custom.conf",
"owner": "barbican",
"perm": "0640",
"optional": true
Expand Down

0 comments on commit b7a77ac

Please sign in to comment.