Skip to content

Commit

Permalink
Remove DefaultConfigOverwrite from CRD
Browse files Browse the repository at this point in the history
The feature was never fully implemented, and it's superseded by
the ExtraMounts feature.
  • Loading branch information
ASBishop committed Nov 13, 2023
1 parent 7ff5f68 commit 70a3d74
Show file tree
Hide file tree
Showing 18 changed files with 2 additions and 146 deletions.
4 changes: 0 additions & 4 deletions api/bases/cinder.openstack.org_cinderapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ spec:
default: false
type: boolean
type: object
defaultConfigOverwrite:
additionalProperties:
type: string
type: object
extraMounts:
items:
properties:
Expand Down
4 changes: 0 additions & 4 deletions api/bases/cinder.openstack.org_cinderbackups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ spec:
default: false
type: boolean
type: object
defaultConfigOverwrite:
additionalProperties:
type: string
type: object
extraMounts:
items:
properties:
Expand Down
20 changes: 0 additions & 20 deletions api/bases/cinder.openstack.org_cinders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ spec:
default: false
type: boolean
type: object
defaultConfigOverwrite:
additionalProperties:
type: string
type: object
networkAttachments:
items:
type: string
Expand Down Expand Up @@ -170,10 +166,6 @@ spec:
default: false
type: boolean
type: object
defaultConfigOverwrite:
additionalProperties:
type: string
type: object
networkAttachments:
items:
type: string
Expand Down Expand Up @@ -237,10 +229,6 @@ spec:
default: false
type: boolean
type: object
defaultConfigOverwrite:
additionalProperties:
type: string
type: object
networkAttachments:
items:
type: string
Expand Down Expand Up @@ -305,10 +293,6 @@ spec:
default: false
type: boolean
type: object
defaultConfigOverwrite:
additionalProperties:
type: string
type: object
networkAttachments:
items:
type: string
Expand Down Expand Up @@ -371,10 +355,6 @@ spec:
default: false
type: boolean
type: object
defaultConfigOverwrite:
additionalProperties:
type: string
type: object
extraMounts:
items:
properties:
Expand Down
4 changes: 0 additions & 4 deletions api/bases/cinder.openstack.org_cinderschedulers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ spec:
default: false
type: boolean
type: object
defaultConfigOverwrite:
additionalProperties:
type: string
type: object
extraMounts:
items:
properties:
Expand Down
4 changes: 0 additions & 4 deletions api/bases/cinder.openstack.org_cindervolumes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ spec:
default: false
type: boolean
type: object
defaultConfigOverwrite:
additionalProperties:
type: string
type: object
extraMounts:
items:
properties:
Expand Down
19 changes: 0 additions & 19 deletions api/v1beta1/cinder_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,25 +79,6 @@ type CinderSpec struct {
// to /etc/<service>/<service>.conf.d directory as a custom config file.
CustomServiceConfig string `json:"customServiceConfig,omitempty"`

// +kubebuilder:validation:Optional
// ConfigOverwrite - interface to overwrite default config files like e.g. policy.json.
// But can also be used to add additional files. Those get added to the service config dir in /etc/<service> .
// TODO: -> implement
DefaultConfigOverwrite map[string]string `json:"defaultConfigOverwrite,omitempty"`

// TODO: We will need to decide which fields within the specs below we want to
// be required or optional. We probably also want to use webhooks and/or kubebuilder
// defaults to set the fields when they are not provided by the user
// TODO: As we flesh out functionality in the operator, we will need
// to address these fields' optional/required/default considerations given
// that CinderAPI, CinderBackup, CinderScheduler and CinderVolume are
// intended to have their Specs embedded within this parent Cinder CRD.
// Becuse we are embedding their specs, all admission field verification will
// fire (as if an actual CR of one of the types had been applied/created).
// We have to find the right balance between what we would expect users
// to provide in the Cinder CR for the childrens' Specs versus what we
// provide via inheriting from the Cinder CR or through webhooks, defaults, etc

// +kubebuilder:validation:Required
// CinderAPI - Spec definition for the API service of this Cinder deployment
CinderAPI CinderAPITemplate `json:"cinderAPI"`
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 @@ -72,12 +72,6 @@ type CinderServiceTemplate struct {
// /etc/<service>/<service>.conf.d directory as a custom config file.
CustomServiceConfigSecrets []string `json:"customServiceConfigSecrets,omitempty"`

// +kubebuilder:validation:Optional
// ConfigOverwrite - interface to overwrite default config files like e.g. policy.json.
// But can also be used to add additional files. Those get added to the service config dir in /etc/<service> .
// TODO: -> implement
DefaultConfigOverwrite map[string]string `json:"defaultConfigOverwrite,omitempty"`

// +kubebuilder:validation:Optional
// Resources - Compute Resources required by this service (Limits/Requests).
// https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
Expand Down
14 changes: 0 additions & 14 deletions api/v1beta1/zz_generated.deepcopy.go

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

4 changes: 0 additions & 4 deletions config/crd/bases/cinder.openstack.org_cinderapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ spec:
default: false
type: boolean
type: object
defaultConfigOverwrite:
additionalProperties:
type: string
type: object
extraMounts:
items:
properties:
Expand Down
4 changes: 0 additions & 4 deletions config/crd/bases/cinder.openstack.org_cinderbackups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ spec:
default: false
type: boolean
type: object
defaultConfigOverwrite:
additionalProperties:
type: string
type: object
extraMounts:
items:
properties:
Expand Down
20 changes: 0 additions & 20 deletions config/crd/bases/cinder.openstack.org_cinders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ spec:
default: false
type: boolean
type: object
defaultConfigOverwrite:
additionalProperties:
type: string
type: object
networkAttachments:
items:
type: string
Expand Down Expand Up @@ -170,10 +166,6 @@ spec:
default: false
type: boolean
type: object
defaultConfigOverwrite:
additionalProperties:
type: string
type: object
networkAttachments:
items:
type: string
Expand Down Expand Up @@ -237,10 +229,6 @@ spec:
default: false
type: boolean
type: object
defaultConfigOverwrite:
additionalProperties:
type: string
type: object
networkAttachments:
items:
type: string
Expand Down Expand Up @@ -305,10 +293,6 @@ spec:
default: false
type: boolean
type: object
defaultConfigOverwrite:
additionalProperties:
type: string
type: object
networkAttachments:
items:
type: string
Expand Down Expand Up @@ -371,10 +355,6 @@ spec:
default: false
type: boolean
type: object
defaultConfigOverwrite:
additionalProperties:
type: string
type: object
extraMounts:
items:
properties:
Expand Down
4 changes: 0 additions & 4 deletions config/crd/bases/cinder.openstack.org_cinderschedulers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ spec:
default: false
type: boolean
type: object
defaultConfigOverwrite:
additionalProperties:
type: string
type: object
extraMounts:
items:
properties:
Expand Down
4 changes: 0 additions & 4 deletions config/crd/bases/cinder.openstack.org_cindervolumes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ spec:
default: false
type: boolean
type: object
defaultConfigOverwrite:
additionalProperties:
type: string
type: object
extraMounts:
items:
properties:
Expand Down
5 changes: 0 additions & 5 deletions controllers/cinder_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,6 @@ func (r *CinderReconciler) reconcileUpgrade(ctx context.Context, instance *cinde
}

// generateServiceConfigs - create Secret which hold scripts and service configuration
// TODO add DefaultConfigOverwrite
func (r *CinderReconciler) generateServiceConfigs(
ctx context.Context,
h *helper.Helper,
Expand All @@ -864,10 +863,6 @@ func (r *CinderReconciler) generateServiceConfigs(
// customData hold any customization for all cinder services.
customData := map[string]string{cinder.CustomConfigFileName: instance.Spec.CustomServiceConfig}

for key, data := range instance.Spec.DefaultConfigOverwrite {
customData[key] = data
}

keystoneAPI, err := keystonev1.GetKeystoneAPI(ctx, h, instance.Namespace, map[string]string{})
if err != nil {
return err
Expand Down
7 changes: 0 additions & 7 deletions controllers/cinderapi_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,6 @@ func (r *CinderAPIReconciler) getSecret(
}

// generateServiceConfigs - create Secret which holds the service configuration
// TODO add DefaultConfigOverwrite
func (r *CinderAPIReconciler) generateServiceConfigs(
ctx context.Context,
h *helper.Helper,
Expand All @@ -799,12 +798,6 @@ func (r *CinderAPIReconciler) generateServiceConfigs(
// customData hold any customization for the service.
customData := map[string]string{cinder.CustomServiceConfigFileName: instance.Spec.CustomServiceConfig}

for key, data := range instance.Spec.DefaultConfigOverwrite {
customData[key] = data
}

customData[cinder.CustomServiceConfigFileName] = instance.Spec.CustomServiceConfig

// Fetch the two service config snippets (DefaultsConfigFileName and
// CustomConfigFileName) from the Secret generated by the top level
// cinder controller, and add them to this service specific Secret.
Expand Down
7 changes: 0 additions & 7 deletions controllers/cinderbackup_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,6 @@ func (r *CinderBackupReconciler) getSecret(
}

// generateServiceConfigs - create Secret which holds the service configuration
// TODO add DefaultConfigOverwrite
func (r *CinderBackupReconciler) generateServiceConfigs(
ctx context.Context,
h *helper.Helper,
Expand All @@ -547,12 +546,6 @@ func (r *CinderBackupReconciler) generateServiceConfigs(
// customData hold any customization for the service.
customData := map[string]string{cinder.CustomServiceConfigFileName: instance.Spec.CustomServiceConfig}

for key, data := range instance.Spec.DefaultConfigOverwrite {
customData[key] = data
}

customData[cinder.CustomServiceConfigFileName] = instance.Spec.CustomServiceConfig

// Fetch the two service config snippets (DefaultsConfigFileName and
// CustomConfigFileName) from the Secret generated by the top level
// cinder controller, and add them to this service specific Secret.
Expand Down
7 changes: 0 additions & 7 deletions controllers/cinderscheduler_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,6 @@ func (r *CinderSchedulerReconciler) getSecret(
}

// generateServiceConfigs - create Secret which holds the service configuration
// TODO add DefaultConfigOverwrite
func (r *CinderSchedulerReconciler) generateServiceConfigs(
ctx context.Context,
h *helper.Helper,
Expand All @@ -546,12 +545,6 @@ func (r *CinderSchedulerReconciler) generateServiceConfigs(
// customData hold any customization for the service.
customData := map[string]string{cinder.CustomServiceConfigFileName: instance.Spec.CustomServiceConfig}

for key, data := range instance.Spec.DefaultConfigOverwrite {
customData[key] = data
}

customData[cinder.CustomServiceConfigFileName] = instance.Spec.CustomServiceConfig

// Fetch the two service config snippets (DefaultsConfigFileName and
// CustomConfigFileName) from the Secret generated by the top level
// cinder controller, and add them to this service specific Secret.
Expand Down
11 changes: 2 additions & 9 deletions controllers/cindervolume_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,6 @@ func (r *CinderVolumeReconciler) getSecret(
}

// generateServiceConfigs - create Secret which holds the service configuration
// TODO add DefaultConfigOverwrite
func (r *CinderVolumeReconciler) generateServiceConfigs(
ctx context.Context,
h *helper.Helper,
Expand All @@ -547,11 +546,8 @@ func (r *CinderVolumeReconciler) generateServiceConfigs(
labels := labels.GetLabels(instance, labels.GetGroupLabel(cinder.ServiceName), serviceLabels)

// customData hold any customization for the service.
customData := map[string]string{}

for key, data := range instance.Spec.DefaultConfigOverwrite {
customData[key] = data
}
usesLVM, customServiceConfig := processCustomServiceConfig(instance.Spec.CustomServiceConfig)
customData := map[string]string{cinder.CustomServiceConfigFileName: customServiceConfig}

// Fetch the two service config snippets (DefaultsConfigFileName and
// CustomConfigFileName) from the Secret generated by the top level
Expand All @@ -576,9 +572,6 @@ func (r *CinderVolumeReconciler) generateServiceConfigs(
}
customData[cinder.CustomServiceConfigSecretsFileName] = customSecrets

usesLVM, customServiceConfig := processCustomServiceConfig(instance.Spec.CustomServiceConfig)
customData[cinder.CustomServiceConfigFileName] = customServiceConfig

templateParameters := make(map[string]interface{})
if usesLVM {
// Configure 'target_secondary_ip_addresses' using addresses in the
Expand Down

0 comments on commit 70a3d74

Please sign in to comment.