diff --git a/api/bases/manila.openstack.org_manilaapis.yaml b/api/bases/manila.openstack.org_manilaapis.yaml index facebc88..4eb0bded 100644 --- a/api/bases/manila.openstack.org_manilaapis.yaml +++ b/api/bases/manila.openstack.org_manilaapis.yaml @@ -54,12 +54,6 @@ spec: databaseUser: default: manila type: string - debug: - properties: - service: - default: false - type: boolean - type: object extraMounts: items: properties: diff --git a/api/bases/manila.openstack.org_manilas.yaml b/api/bases/manila.openstack.org_manilas.yaml index 230287f0..7f2d7045 100644 --- a/api/bases/manila.openstack.org_manilas.yaml +++ b/api/bases/manila.openstack.org_manilas.yaml @@ -58,9 +58,6 @@ spec: dbPurge: default: false type: boolean - dbSync: - default: false - type: boolean type: object extraMounts: items: @@ -829,12 +826,6 @@ spec: items: type: string type: array - debug: - properties: - service: - default: false - type: boolean - type: object networkAttachments: items: type: string @@ -945,12 +936,6 @@ spec: items: type: string type: array - debug: - properties: - service: - default: false - type: boolean - type: object networkAttachments: items: type: string @@ -1011,12 +996,6 @@ spec: items: type: string type: array - debug: - properties: - service: - default: false - type: boolean - 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 dacaf67d..217330a9 100644 --- a/api/bases/manila.openstack.org_manilaschedulers.yaml +++ b/api/bases/manila.openstack.org_manilaschedulers.yaml @@ -54,12 +54,6 @@ spec: databaseUser: default: manila type: string - debug: - properties: - service: - default: false - type: boolean - type: object extraMounts: items: properties: diff --git a/api/bases/manila.openstack.org_manilashares.yaml b/api/bases/manila.openstack.org_manilashares.yaml index 697247db..887a4a28 100644 --- a/api/bases/manila.openstack.org_manilashares.yaml +++ b/api/bases/manila.openstack.org_manilashares.yaml @@ -54,12 +54,6 @@ spec: databaseUser: default: manila type: string - debug: - properties: - service: - default: false - type: boolean - type: object extraMounts: items: properties: diff --git a/api/v1beta1/common_types.go b/api/v1beta1/common_types.go index 09e92bf7..bb235a56 100644 --- a/api/v1beta1/common_types.go +++ b/api/v1beta1/common_types.go @@ -72,11 +72,6 @@ type ManilaServiceTemplate struct { // any global NodeSelector settings within the Manila CR. NodeSelector map[string]string `json:"nodeSelector,omitempty"` - // +kubebuilder:validation:Optional - // Debug - enable debug for different deploy stages. If an init container is used, it runs and the - // actual action pod gets started with sleep infinity - Debug ManilaServiceDebug `json:"debug,omitempty"` - // +kubebuilder:validation:Optional // +kubebuilder:default="# add your customization here" // CustomServiceConfig - customize the service config using this parameter to change service defaults, @@ -111,12 +106,3 @@ type PasswordSelector struct { // Service - Selector to get the manila service password from the Secret Service string `json:"service,omitempty"` } - -// ManilaServiceDebug indicates whether certain stages of Manila service -// deployment should pause in debug mode -type ManilaServiceDebug struct { - // +kubebuilder:validation:Optional - // +kubebuilder:default=false - // service enable debug - Service bool `json:"service,omitempty"` -} diff --git a/api/v1beta1/manila_types.go b/api/v1beta1/manila_types.go index 11fe50b9..30f2e71e 100644 --- a/api/v1beta1/manila_types.go +++ b/api/v1beta1/manila_types.go @@ -161,10 +161,6 @@ type DBPurge struct { // ManilaDebug contains flags related to multiple debug activities. See the // individual comments for what this means for each flag. type ManilaDebug struct { - // +kubebuilder:validation:Optional - // +kubebuilder:default=false - // DBSync pauses the dbSync container instead of executing the db_sync command. - DBSync bool `json:"dbSync,omitempty"` // +kubebuilder:validation:Optional // +kubebuilder:default=false // DBPurge increases log verbosity by executing the db_purge command with "--debug". diff --git a/api/v1beta1/zz_generated.deepcopy.go b/api/v1beta1/zz_generated.deepcopy.go index 1ea2a8a8..b25479e4 100644 --- a/api/v1beta1/zz_generated.deepcopy.go +++ b/api/v1beta1/zz_generated.deepcopy.go @@ -473,21 +473,6 @@ func (in *ManilaSchedulerTemplate) DeepCopy() *ManilaSchedulerTemplate { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ManilaServiceDebug) DeepCopyInto(out *ManilaServiceDebug) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManilaServiceDebug. -func (in *ManilaServiceDebug) DeepCopy() *ManilaServiceDebug { - if in == nil { - return nil - } - out := new(ManilaServiceDebug) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ManilaServiceTemplate) DeepCopyInto(out *ManilaServiceTemplate) { *out = *in @@ -498,7 +483,6 @@ func (in *ManilaServiceTemplate) DeepCopyInto(out *ManilaServiceTemplate) { (*out)[key] = val } } - out.Debug = in.Debug if in.CustomServiceConfigSecrets != nil { in, out := &in.CustomServiceConfigSecrets, &out.CustomServiceConfigSecrets *out = make([]string, len(*in)) diff --git a/config/crd/bases/manila.openstack.org_manilaapis.yaml b/config/crd/bases/manila.openstack.org_manilaapis.yaml index facebc88..4eb0bded 100644 --- a/config/crd/bases/manila.openstack.org_manilaapis.yaml +++ b/config/crd/bases/manila.openstack.org_manilaapis.yaml @@ -54,12 +54,6 @@ spec: databaseUser: default: manila type: string - debug: - properties: - service: - default: false - type: boolean - 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 230287f0..7f2d7045 100644 --- a/config/crd/bases/manila.openstack.org_manilas.yaml +++ b/config/crd/bases/manila.openstack.org_manilas.yaml @@ -58,9 +58,6 @@ spec: dbPurge: default: false type: boolean - dbSync: - default: false - type: boolean type: object extraMounts: items: @@ -829,12 +826,6 @@ spec: items: type: string type: array - debug: - properties: - service: - default: false - type: boolean - type: object networkAttachments: items: type: string @@ -945,12 +936,6 @@ spec: items: type: string type: array - debug: - properties: - service: - default: false - type: boolean - type: object networkAttachments: items: type: string @@ -1011,12 +996,6 @@ spec: items: type: string type: array - debug: - properties: - service: - default: false - type: boolean - 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 dacaf67d..217330a9 100644 --- a/config/crd/bases/manila.openstack.org_manilaschedulers.yaml +++ b/config/crd/bases/manila.openstack.org_manilaschedulers.yaml @@ -54,12 +54,6 @@ spec: databaseUser: default: manila type: string - debug: - properties: - service: - default: false - type: boolean - 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 697247db..887a4a28 100644 --- a/config/crd/bases/manila.openstack.org_manilashares.yaml +++ b/config/crd/bases/manila.openstack.org_manilashares.yaml @@ -54,12 +54,6 @@ spec: databaseUser: default: manila type: string - debug: - properties: - service: - default: false - type: boolean - type: object extraMounts: items: properties: diff --git a/pkg/manila/dbsync.go b/pkg/manila/dbsync.go index fa644148..f8292245 100644 --- a/pkg/manila/dbsync.go +++ b/pkg/manila/dbsync.go @@ -1,7 +1,6 @@ package manila import ( - common "github.com/openstack-k8s-operators/lib-common/modules/common" "github.com/openstack-k8s-operators/lib-common/modules/common/env" manilav1 "github.com/openstack-k8s-operators/manila-operator/api/v1beta1" batchv1 "k8s.io/api/batch/v1" @@ -64,13 +63,7 @@ func DbSyncJob(instance *manilav1.Manila, labels map[string]string, annotations }, } - args := []string{"-c"} - if instance.Spec.Debug.DBSync { - args = append(args, common.DebugCommand) - } else { - args = append(args, DBSyncCommand) - } - + args := []string{"-c", DBSyncCommand} runAsUser := int64(0) envVars := map[string]env.Setter{} envVars["KOLLA_CONFIG_STRATEGY"] = env.SetValue("COPY_ALWAYS") diff --git a/pkg/manilaapi/statefulset.go b/pkg/manilaapi/statefulset.go index e3756792..fde2bff1 100644 --- a/pkg/manilaapi/statefulset.go +++ b/pkg/manilaapi/statefulset.go @@ -50,27 +50,15 @@ func StatefulSet( InitialDelaySeconds: 5, } - args := []string{"-c"} - if instance.Spec.Debug.Service { - args = append(args, common.DebugCommand) - livenessProbe.Exec = &corev1.ExecAction{ - Command: []string{ - "/bin/true", - }, - } - readinessProbe.Exec = livenessProbe.Exec - } else { - args = append(args, ServiceCommand) - // - // https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ - // - - livenessProbe.HTTPGet = &corev1.HTTPGetAction{ - Path: "/healthcheck", - Port: intstr.IntOrString{Type: intstr.Int, IntVal: int32(manila.ManilaPublicPort)}, - } - readinessProbe.HTTPGet = livenessProbe.HTTPGet + args := []string{"-c", ServiceCommand} + // + // https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ + // + livenessProbe.HTTPGet = &corev1.HTTPGetAction{ + Path: "/healthcheck", + Port: intstr.IntOrString{Type: intstr.Int, IntVal: int32(manila.ManilaPublicPort)}, } + readinessProbe.HTTPGet = livenessProbe.HTTPGet envVars := map[string]env.Setter{} envVars["KOLLA_CONFIG_STRATEGY"] = env.SetValue("COPY_ALWAYS") diff --git a/pkg/manilascheduler/statefulset.go b/pkg/manilascheduler/statefulset.go index 21d7d198..2818018a 100644 --- a/pkg/manilascheduler/statefulset.go +++ b/pkg/manilascheduler/statefulset.go @@ -57,32 +57,16 @@ func StatefulSet( InitialDelaySeconds: 5, } - args := []string{"-c"} + args := []string{"-c", ServiceCommand} var probeCommand []string - // When debugging the service container will run kolla_set_configs and - // sleep forever and the probe container will just sleep forever. - if instance.Spec.Debug.Service { - args = append(args, common.DebugCommand) - livenessProbe.Exec = &corev1.ExecAction{ - Command: []string{ - "/bin/true", - }, - } - startupProbe.Exec = livenessProbe.Exec - probeCommand = []string{ - "/bin/sleep", "infinity", - } - } else { - args = append(args, ServiceCommand) - livenessProbe.HTTPGet = &corev1.HTTPGetAction{ - Port: intstr.FromInt(8080), - } - startupProbe.HTTPGet = livenessProbe.HTTPGet - probeCommand = []string{ - "/usr/local/bin/container-scripts/healthcheck.py", - "scheduler", - "/etc/manila/manila.conf.d", - } + livenessProbe.HTTPGet = &corev1.HTTPGetAction{ + Port: intstr.FromInt(8080), + } + startupProbe.HTTPGet = livenessProbe.HTTPGet + probeCommand = []string{ + "/usr/local/bin/container-scripts/healthcheck.py", + "scheduler", + "/etc/manila/manila.conf.d", } envVars := map[string]env.Setter{} diff --git a/pkg/manilashare/statefulset.go b/pkg/manilashare/statefulset.go index d06d9e9d..0f455157 100644 --- a/pkg/manilashare/statefulset.go +++ b/pkg/manilashare/statefulset.go @@ -59,32 +59,16 @@ func StatefulSet( InitialDelaySeconds: 5, } - args := []string{"-c"} + args := []string{"-c", ServiceCommand} var probeCommand []string - // When debugging the service container will run kolla_set_configs and - // sleep forever and the probe container will just sleep forever. - if instance.Spec.Debug.Service { - args = append(args, common.DebugCommand) - livenessProbe.Exec = &corev1.ExecAction{ - Command: []string{ - "/bin/true", - }, - } - startupProbe.Exec = livenessProbe.Exec - probeCommand = []string{ - "/bin/sleep", "infinity", - } - } else { - args = append(args, ServiceCommand) - livenessProbe.HTTPGet = &corev1.HTTPGetAction{ - Port: intstr.FromInt(8080), - } - startupProbe.HTTPGet = livenessProbe.HTTPGet - probeCommand = []string{ - "/usr/local/bin/container-scripts/healthcheck.py", - "share", - "/etc/manila/manila.conf.d", - } + livenessProbe.HTTPGet = &corev1.HTTPGetAction{ + Port: intstr.FromInt(8080), + } + startupProbe.HTTPGet = livenessProbe.HTTPGet + probeCommand = []string{ + "/usr/local/bin/container-scripts/healthcheck.py", + "share", + "/etc/manila/manila.conf.d", } envVars := map[string]env.Setter{} diff --git a/test/kuttl/tests/manila-basic/01-assert.yaml b/test/kuttl/tests/manila-basic/01-assert.yaml index ca5e78cb..b406881c 100644 --- a/test/kuttl/tests/manila-basic/01-assert.yaml +++ b/test/kuttl/tests/manila-basic/01-assert.yaml @@ -16,20 +16,14 @@ spec: debug = true databaseInstance: openstack databaseUser: manila - debug: - dbSync: false manilaAPI: customServiceConfig: | [DEFAULT] enabled_share_protocols = cephfs - debug: - service: false replicas: 1 resources: {} manilaScheduler: customServiceConfig: '# add your customization here' - debug: - service: false replicas: 1 resources: {} manilaShares: @@ -47,8 +41,6 @@ spec: cephfs_auth_id=openstack cephfs_cluster_name=ceph cephfs_protocol_helper_type=CEPHFS - debug: - service: false passwordSelectors: database: ManilaDatabasePassword service: ManilaPassword diff --git a/test/kuttl/tests/manila-basic/02-assert.yaml b/test/kuttl/tests/manila-basic/02-assert.yaml index c50f395d..01064acf 100644 --- a/test/kuttl/tests/manila-basic/02-assert.yaml +++ b/test/kuttl/tests/manila-basic/02-assert.yaml @@ -16,14 +16,10 @@ spec: debug = true databaseInstance: openstack databaseUser: manila - debug: - dbSync: false manilaAPI: customServiceConfig: | [DEFAULT] enabled_share_protocols = cephfs - debug: - service: false replicas: 3 resources: {} manilaScheduler: diff --git a/test/kuttl/tests/manila-basic/03-assert.yaml b/test/kuttl/tests/manila-basic/03-assert.yaml index ca5e78cb..b406881c 100644 --- a/test/kuttl/tests/manila-basic/03-assert.yaml +++ b/test/kuttl/tests/manila-basic/03-assert.yaml @@ -16,20 +16,14 @@ spec: debug = true databaseInstance: openstack databaseUser: manila - debug: - dbSync: false manilaAPI: customServiceConfig: | [DEFAULT] enabled_share_protocols = cephfs - debug: - service: false replicas: 1 resources: {} manilaScheduler: customServiceConfig: '# add your customization here' - debug: - service: false replicas: 1 resources: {} manilaShares: @@ -47,8 +41,6 @@ spec: cephfs_auth_id=openstack cephfs_cluster_name=ceph cephfs_protocol_helper_type=CEPHFS - debug: - service: false passwordSelectors: database: ManilaDatabasePassword service: ManilaPassword diff --git a/test/kuttl/tests/manila-multibackend/01-assert.yaml b/test/kuttl/tests/manila-multibackend/01-assert.yaml index 002449a7..1bc33507 100644 --- a/test/kuttl/tests/manila-multibackend/01-assert.yaml +++ b/test/kuttl/tests/manila-multibackend/01-assert.yaml @@ -1,6 +1,4 @@ # -# Check for: -# # - 1 manilaAPI # - 2 manilaScheduler # - 3 manilaShares @@ -16,20 +14,14 @@ spec: debug = true databaseInstance: openstack databaseUser: manila - debug: - dbSync: false manilaAPI: customServiceConfig: | [DEFAULT] enabled_share_protocols=nfs,cephfs,cifs - debug: - service: false replicas: 1 resources: {} manilaScheduler: customServiceConfig: '# add your customization here' - debug: - service: false replicas: 1 resources: {} manilaShares: @@ -182,8 +174,6 @@ metadata: spec: databaseHostname: openstack databaseUser: manila - debug: - service: false passwordSelectors: database: ManilaDatabasePassword service: ManilaPassword diff --git a/test/kuttl/tests/manila-multibackend/03-assert.yaml b/test/kuttl/tests/manila-multibackend/03-assert.yaml index 9aab1eea..15007aac 100644 --- a/test/kuttl/tests/manila-multibackend/03-assert.yaml +++ b/test/kuttl/tests/manila-multibackend/03-assert.yaml @@ -16,20 +16,14 @@ spec: debug = true databaseInstance: openstack databaseUser: manila - debug: - dbSync: false manilaAPI: customServiceConfig: | [DEFAULT] enabled_share_protocols=nfs,cephfs,cifs - debug: - service: false replicas: 1 resources: {} manilaScheduler: customServiceConfig: '# add your customization here' - debug: - service: false replicas: 1 resources: {} manilaShares: