From ae69772e96ac1d921a77f6c1e59c58e19d2d281c Mon Sep 17 00:00:00 2001 From: Francesco Pantano Date: Tue, 14 Nov 2023 13:42:24 +0100 Subject: [PATCH] Remove DefaultConfigOverwrite from CRD The feature was never fully implemented, and it's superseded by the ExtraMounts feature. Signed-off-by: Francesco Pantano --- api/bases/manila.openstack.org_manilaapis.yaml | 4 ---- api/bases/manila.openstack.org_manilas.yaml | 16 ---------------- .../manila.openstack.org_manilaschedulers.yaml | 4 ---- api/bases/manila.openstack.org_manilashares.yaml | 4 ---- api/v1beta1/common_types.go | 5 ----- api/v1beta1/manila_types.go | 6 ------ api/v1beta1/zz_generated.deepcopy.go | 14 -------------- .../bases/manila.openstack.org_manilaapis.yaml | 4 ---- .../crd/bases/manila.openstack.org_manilas.yaml | 16 ---------------- .../manila.openstack.org_manilaschedulers.yaml | 4 ---- .../bases/manila.openstack.org_manilashares.yaml | 4 ---- controllers/manila_controller.go | 4 ---- controllers/manilaapi_controller.go | 4 ---- controllers/manilascheduler_controller.go | 5 ----- controllers/manilashare_controller.go | 5 ----- 15 files changed, 99 deletions(-) diff --git a/api/bases/manila.openstack.org_manilaapis.yaml b/api/bases/manila.openstack.org_manilaapis.yaml index 2f6a5f31..facebc88 100644 --- a/api/bases/manila.openstack.org_manilaapis.yaml +++ b/api/bases/manila.openstack.org_manilaapis.yaml @@ -60,10 +60,6 @@ spec: default: false type: boolean type: object - defaultConfigOverwrite: - additionalProperties: - type: string - type: object extraMounts: items: properties: diff --git a/api/bases/manila.openstack.org_manilas.yaml b/api/bases/manila.openstack.org_manilas.yaml index e686f573..98f217b9 100644 --- a/api/bases/manila.openstack.org_manilas.yaml +++ b/api/bases/manila.openstack.org_manilas.yaml @@ -53,10 +53,6 @@ spec: default: false type: boolean type: object - defaultConfigOverwrite: - additionalProperties: - type: string - type: object extraMounts: items: properties: @@ -830,10 +826,6 @@ spec: default: false type: boolean type: object - defaultConfigOverwrite: - additionalProperties: - type: string - type: object networkAttachments: items: type: string @@ -950,10 +942,6 @@ spec: default: false type: boolean type: object - defaultConfigOverwrite: - additionalProperties: - type: string - type: object networkAttachments: items: type: string @@ -1020,10 +1008,6 @@ spec: default: false type: boolean type: object - defaultConfigOverwrite: - additionalProperties: - type: string - type: object networkAttachments: items: type: string diff --git a/api/bases/manila.openstack.org_manilaschedulers.yaml b/api/bases/manila.openstack.org_manilaschedulers.yaml index 61910048..dacaf67d 100644 --- a/api/bases/manila.openstack.org_manilaschedulers.yaml +++ b/api/bases/manila.openstack.org_manilaschedulers.yaml @@ -60,10 +60,6 @@ spec: default: false type: boolean type: object - defaultConfigOverwrite: - additionalProperties: - type: string - type: object extraMounts: items: properties: diff --git a/api/bases/manila.openstack.org_manilashares.yaml b/api/bases/manila.openstack.org_manilashares.yaml index 809d1ee2..697247db 100644 --- a/api/bases/manila.openstack.org_manilashares.yaml +++ b/api/bases/manila.openstack.org_manilashares.yaml @@ -60,10 +60,6 @@ spec: default: false type: boolean type: object - defaultConfigOverwrite: - additionalProperties: - type: string - type: object extraMounts: items: properties: diff --git a/api/v1beta1/common_types.go b/api/v1beta1/common_types.go index 63b0873a..003bbf48 100644 --- a/api/v1beta1/common_types.go +++ b/api/v1beta1/common_types.go @@ -81,11 +81,6 @@ type ManilaServiceTemplate struct { // to /etc//.conf.d directory 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/ . - DefaultConfigOverwrite map[string]string `json:"defaultConfigOverwrite,omitempty"` - // +kubebuilder:validation:Optional // CustomServiceConfigSecrets - customize the service config using this parameter to specify Secrets // that contain sensitive service config data. The content of each Secret gets added to the diff --git a/api/v1beta1/manila_types.go b/api/v1beta1/manila_types.go index 9f734dfb..03deac52 100644 --- a/api/v1beta1/manila_types.go +++ b/api/v1beta1/manila_types.go @@ -63,12 +63,6 @@ type ManilaSpec struct { // to /etc//.conf.d directory 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"` - // +kubebuilder:validation:Required // ManilaAPI - Spec definition for the API service of this Manila deployment ManilaAPI ManilaAPITemplate `json:"manilaAPI"` diff --git a/api/v1beta1/zz_generated.deepcopy.go b/api/v1beta1/zz_generated.deepcopy.go index d89e750d..c1fb0d96 100644 --- a/api/v1beta1/zz_generated.deepcopy.go +++ b/api/v1beta1/zz_generated.deepcopy.go @@ -484,13 +484,6 @@ func (in *ManilaServiceTemplate) DeepCopyInto(out *ManilaServiceTemplate) { } } 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 - } - } if in.CustomServiceConfigSecrets != nil { in, out := &in.CustomServiceConfigSecrets, &out.CustomServiceConfigSecrets *out = make([]string, len(*in)) @@ -667,13 +660,6 @@ func (in *ManilaSpec) DeepCopyInto(out *ManilaSpec) { *out = *in out.ManilaTemplate = in.ManilaTemplate 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.ManilaAPI.DeepCopyInto(&out.ManilaAPI) in.ManilaScheduler.DeepCopyInto(&out.ManilaScheduler) if in.ManilaShares != nil { diff --git a/config/crd/bases/manila.openstack.org_manilaapis.yaml b/config/crd/bases/manila.openstack.org_manilaapis.yaml index 2f6a5f31..facebc88 100644 --- a/config/crd/bases/manila.openstack.org_manilaapis.yaml +++ b/config/crd/bases/manila.openstack.org_manilaapis.yaml @@ -60,10 +60,6 @@ spec: default: false type: boolean type: object - defaultConfigOverwrite: - additionalProperties: - type: string - type: object extraMounts: items: properties: diff --git a/config/crd/bases/manila.openstack.org_manilas.yaml b/config/crd/bases/manila.openstack.org_manilas.yaml index e686f573..98f217b9 100644 --- a/config/crd/bases/manila.openstack.org_manilas.yaml +++ b/config/crd/bases/manila.openstack.org_manilas.yaml @@ -53,10 +53,6 @@ spec: default: false type: boolean type: object - defaultConfigOverwrite: - additionalProperties: - type: string - type: object extraMounts: items: properties: @@ -830,10 +826,6 @@ spec: default: false type: boolean type: object - defaultConfigOverwrite: - additionalProperties: - type: string - type: object networkAttachments: items: type: string @@ -950,10 +942,6 @@ spec: default: false type: boolean type: object - defaultConfigOverwrite: - additionalProperties: - type: string - type: object networkAttachments: items: type: string @@ -1020,10 +1008,6 @@ spec: default: false type: boolean type: object - defaultConfigOverwrite: - additionalProperties: - type: string - type: object networkAttachments: items: type: string diff --git a/config/crd/bases/manila.openstack.org_manilaschedulers.yaml b/config/crd/bases/manila.openstack.org_manilaschedulers.yaml index 61910048..dacaf67d 100644 --- a/config/crd/bases/manila.openstack.org_manilaschedulers.yaml +++ b/config/crd/bases/manila.openstack.org_manilaschedulers.yaml @@ -60,10 +60,6 @@ spec: default: false type: boolean type: object - defaultConfigOverwrite: - additionalProperties: - type: string - type: object extraMounts: items: properties: diff --git a/config/crd/bases/manila.openstack.org_manilashares.yaml b/config/crd/bases/manila.openstack.org_manilashares.yaml index 809d1ee2..697247db 100644 --- a/config/crd/bases/manila.openstack.org_manilashares.yaml +++ b/config/crd/bases/manila.openstack.org_manilashares.yaml @@ -60,10 +60,6 @@ spec: default: false type: boolean type: object - defaultConfigOverwrite: - additionalProperties: - type: string - type: object extraMounts: items: properties: diff --git a/controllers/manila_controller.go b/controllers/manila_controller.go index 207c07fe..0fc0d5db 100644 --- a/controllers/manila_controller.go +++ b/controllers/manila_controller.go @@ -762,10 +762,6 @@ func (r *ManilaReconciler) generateServiceConfig( // all other files get placed into /etc/ to allow overwrite of e.g. policy.json customData := map[string]string{manila.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/manilaapi_controller.go b/controllers/manilaapi_controller.go index 52e5c643..d308da96 100644 --- a/controllers/manilaapi_controller.go +++ b/controllers/manilaapi_controller.go @@ -802,10 +802,6 @@ func (r *ManilaAPIReconciler) generateServiceConfig( // customData hold any customization for the service. customData := map[string]string{manila.CustomServiceConfigFileName: instance.Spec.CustomServiceConfig} - for key, data := range instance.Spec.DefaultConfigOverwrite { - customData[key] = data - } - customData[manila.CustomServiceConfigFileName] = instance.Spec.CustomServiceConfig // Fetch the two service config snippets (DefaultsConfigFileName and diff --git a/controllers/manilascheduler_controller.go b/controllers/manilascheduler_controller.go index 581ef177..18108536 100644 --- a/controllers/manilascheduler_controller.go +++ b/controllers/manilascheduler_controller.go @@ -534,7 +534,6 @@ func (r *ManilaSchedulerReconciler) getSecret( } // generateServiceConfig - create Secret to hold service-specific config -// TODO add DefaultConfigOverwrite func (r *ManilaSchedulerReconciler) generateServiceConfig( ctx context.Context, h *helper.Helper, @@ -551,10 +550,6 @@ func (r *ManilaSchedulerReconciler) generateServiceConfig( customData := map[string]string{manila.CustomServiceConfigFileName: instance.Spec.CustomServiceConfig} - for key, data := range instance.Spec.DefaultConfigOverwrite { - customData[key] = data - } - customData[manila.CustomServiceConfigFileName] = instance.Spec.CustomServiceConfig // Fetch the two service config snippets (DefaultsConfigFileName and diff --git a/controllers/manilashare_controller.go b/controllers/manilashare_controller.go index 20c842af..734b7f8f 100644 --- a/controllers/manilashare_controller.go +++ b/controllers/manilashare_controller.go @@ -531,7 +531,6 @@ func (r *ManilaShareReconciler) getSecret( } // generateServiceConfig - create custom Secret to hold service-specific config -// TODO add DefaultConfigOverwrite func (r *ManilaShareReconciler) generateServiceConfig( ctx context.Context, h *helper.Helper, @@ -548,10 +547,6 @@ func (r *ManilaShareReconciler) generateServiceConfig( customData := map[string]string{manila.CustomServiceConfigFileName: instance.Spec.CustomServiceConfig} - for key, data := range instance.Spec.DefaultConfigOverwrite { - customData[key] = data - } - customData[manila.CustomServiceConfigFileName] = instance.Spec.CustomServiceConfig // Fetch the two service config snippets (DefaultsConfigFileName and