diff --git a/api/bases/cinder.openstack.org_cinderapis.yaml b/api/bases/cinder.openstack.org_cinderapis.yaml index 89e268ad..8f6add7e 100644 --- a/api/bases/cinder.openstack.org_cinderapis.yaml +++ b/api/bases/cinder.openstack.org_cinderapis.yaml @@ -59,10 +59,6 @@ spec: default: false type: boolean type: object - defaultConfigOverwrite: - additionalProperties: - type: string - type: object extraMounts: items: properties: diff --git a/api/bases/cinder.openstack.org_cinderbackups.yaml b/api/bases/cinder.openstack.org_cinderbackups.yaml index 724b6122..68435d02 100644 --- a/api/bases/cinder.openstack.org_cinderbackups.yaml +++ b/api/bases/cinder.openstack.org_cinderbackups.yaml @@ -59,10 +59,6 @@ spec: default: false type: boolean type: object - defaultConfigOverwrite: - additionalProperties: - type: string - type: object extraMounts: items: properties: diff --git a/api/bases/cinder.openstack.org_cinders.yaml b/api/bases/cinder.openstack.org_cinders.yaml index 440f13b1..bbf96c07 100644 --- a/api/bases/cinder.openstack.org_cinders.yaml +++ b/api/bases/cinder.openstack.org_cinders.yaml @@ -52,10 +52,6 @@ spec: default: false type: boolean type: object - defaultConfigOverwrite: - additionalProperties: - type: string - type: object networkAttachments: items: type: string @@ -170,10 +166,6 @@ spec: default: false type: boolean type: object - defaultConfigOverwrite: - additionalProperties: - type: string - type: object networkAttachments: items: type: string @@ -237,10 +229,6 @@ spec: default: false type: boolean type: object - defaultConfigOverwrite: - additionalProperties: - type: string - type: object networkAttachments: items: type: string @@ -305,10 +293,6 @@ spec: default: false type: boolean type: object - defaultConfigOverwrite: - additionalProperties: - type: string - type: object networkAttachments: items: type: string @@ -371,10 +355,6 @@ spec: default: false type: boolean type: object - defaultConfigOverwrite: - additionalProperties: - type: string - type: object extraMounts: items: properties: diff --git a/api/bases/cinder.openstack.org_cinderschedulers.yaml b/api/bases/cinder.openstack.org_cinderschedulers.yaml index b702b997..abb5998d 100644 --- a/api/bases/cinder.openstack.org_cinderschedulers.yaml +++ b/api/bases/cinder.openstack.org_cinderschedulers.yaml @@ -59,10 +59,6 @@ spec: default: false type: boolean type: object - defaultConfigOverwrite: - additionalProperties: - type: string - type: object extraMounts: items: properties: diff --git a/api/bases/cinder.openstack.org_cindervolumes.yaml b/api/bases/cinder.openstack.org_cindervolumes.yaml index 7e6ca6b7..0f0606e7 100644 --- a/api/bases/cinder.openstack.org_cindervolumes.yaml +++ b/api/bases/cinder.openstack.org_cindervolumes.yaml @@ -59,10 +59,6 @@ spec: default: false type: boolean type: object - defaultConfigOverwrite: - additionalProperties: - type: string - type: object extraMounts: items: properties: diff --git a/api/v1beta1/cinder_types.go b/api/v1beta1/cinder_types.go index c6bebd75..63657756 100644 --- a/api/v1beta1/cinder_types.go +++ b/api/v1beta1/cinder_types.go @@ -79,25 +79,6 @@ type CinderSpec struct { // to /etc//.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/ . - // 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"` diff --git a/api/v1beta1/common_types.go b/api/v1beta1/common_types.go index 14d76fe0..8922c387 100644 --- a/api/v1beta1/common_types.go +++ b/api/v1beta1/common_types.go @@ -72,12 +72,6 @@ type CinderServiceTemplate struct { // /etc//.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/ . - // 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/ diff --git a/api/v1beta1/zz_generated.deepcopy.go b/api/v1beta1/zz_generated.deepcopy.go index aeeb981b..a4fb25b5 100644 --- a/api/v1beta1/zz_generated.deepcopy.go +++ b/api/v1beta1/zz_generated.deepcopy.go @@ -661,13 +661,6 @@ func (in *CinderServiceTemplate) DeepCopyInto(out *CinderServiceTemplate) { *out = make([]string, len(*in)) copy(*out, *in) } - if in.DefaultConfigOverwrite != nil { - in, out := &in.DefaultConfigOverwrite, &out.DefaultConfigOverwrite - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } in.Resources.DeepCopyInto(&out.Resources) if in.NetworkAttachments != nil { in, out := &in.NetworkAttachments, &out.NetworkAttachments @@ -691,13 +684,6 @@ func (in *CinderSpec) DeepCopyInto(out *CinderSpec) { *out = *in out.CinderTemplate = in.CinderTemplate out.Debug = in.Debug - if in.DefaultConfigOverwrite != nil { - in, out := &in.DefaultConfigOverwrite, &out.DefaultConfigOverwrite - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } in.CinderAPI.DeepCopyInto(&out.CinderAPI) in.CinderScheduler.DeepCopyInto(&out.CinderScheduler) in.CinderBackup.DeepCopyInto(&out.CinderBackup) diff --git a/config/crd/bases/cinder.openstack.org_cinderapis.yaml b/config/crd/bases/cinder.openstack.org_cinderapis.yaml index 89e268ad..8f6add7e 100644 --- a/config/crd/bases/cinder.openstack.org_cinderapis.yaml +++ b/config/crd/bases/cinder.openstack.org_cinderapis.yaml @@ -59,10 +59,6 @@ spec: default: false type: boolean type: object - defaultConfigOverwrite: - additionalProperties: - type: string - type: object extraMounts: items: properties: diff --git a/config/crd/bases/cinder.openstack.org_cinderbackups.yaml b/config/crd/bases/cinder.openstack.org_cinderbackups.yaml index 724b6122..68435d02 100644 --- a/config/crd/bases/cinder.openstack.org_cinderbackups.yaml +++ b/config/crd/bases/cinder.openstack.org_cinderbackups.yaml @@ -59,10 +59,6 @@ spec: default: false type: boolean type: object - defaultConfigOverwrite: - additionalProperties: - type: string - type: object extraMounts: items: properties: diff --git a/config/crd/bases/cinder.openstack.org_cinders.yaml b/config/crd/bases/cinder.openstack.org_cinders.yaml index 440f13b1..bbf96c07 100644 --- a/config/crd/bases/cinder.openstack.org_cinders.yaml +++ b/config/crd/bases/cinder.openstack.org_cinders.yaml @@ -52,10 +52,6 @@ spec: default: false type: boolean type: object - defaultConfigOverwrite: - additionalProperties: - type: string - type: object networkAttachments: items: type: string @@ -170,10 +166,6 @@ spec: default: false type: boolean type: object - defaultConfigOverwrite: - additionalProperties: - type: string - type: object networkAttachments: items: type: string @@ -237,10 +229,6 @@ spec: default: false type: boolean type: object - defaultConfigOverwrite: - additionalProperties: - type: string - type: object networkAttachments: items: type: string @@ -305,10 +293,6 @@ spec: default: false type: boolean type: object - defaultConfigOverwrite: - additionalProperties: - type: string - type: object networkAttachments: items: type: string @@ -371,10 +355,6 @@ spec: default: false type: boolean type: object - defaultConfigOverwrite: - additionalProperties: - type: string - type: object extraMounts: items: properties: diff --git a/config/crd/bases/cinder.openstack.org_cinderschedulers.yaml b/config/crd/bases/cinder.openstack.org_cinderschedulers.yaml index b702b997..abb5998d 100644 --- a/config/crd/bases/cinder.openstack.org_cinderschedulers.yaml +++ b/config/crd/bases/cinder.openstack.org_cinderschedulers.yaml @@ -59,10 +59,6 @@ spec: default: false type: boolean type: object - defaultConfigOverwrite: - additionalProperties: - type: string - type: object extraMounts: items: properties: diff --git a/config/crd/bases/cinder.openstack.org_cindervolumes.yaml b/config/crd/bases/cinder.openstack.org_cindervolumes.yaml index 7e6ca6b7..0f0606e7 100644 --- a/config/crd/bases/cinder.openstack.org_cindervolumes.yaml +++ b/config/crd/bases/cinder.openstack.org_cindervolumes.yaml @@ -59,10 +59,6 @@ spec: default: false type: boolean type: object - defaultConfigOverwrite: - additionalProperties: - type: string - type: object extraMounts: items: properties: diff --git a/controllers/cinder_controller.go b/controllers/cinder_controller.go index 8e849407..8f78435e 100644 --- a/controllers/cinder_controller.go +++ b/controllers/cinder_controller.go @@ -843,7 +843,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, @@ -863,10 +862,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 diff --git a/controllers/cinderapi_controller.go b/controllers/cinderapi_controller.go index 619200b2..f158264b 100644 --- a/controllers/cinderapi_controller.go +++ b/controllers/cinderapi_controller.go @@ -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, @@ -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. diff --git a/controllers/cinderbackup_controller.go b/controllers/cinderbackup_controller.go index 52e1d275..f7fc95e8 100644 --- a/controllers/cinderbackup_controller.go +++ b/controllers/cinderbackup_controller.go @@ -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, @@ -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. diff --git a/controllers/cinderscheduler_controller.go b/controllers/cinderscheduler_controller.go index 556c7b61..40f256a1 100644 --- a/controllers/cinderscheduler_controller.go +++ b/controllers/cinderscheduler_controller.go @@ -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, @@ -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. diff --git a/controllers/cindervolume_controller.go b/controllers/cindervolume_controller.go index e9b20b22..c5553d76 100644 --- a/controllers/cindervolume_controller.go +++ b/controllers/cindervolume_controller.go @@ -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, @@ -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 @@ -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