Skip to content

Commit

Permalink
Merge pull request #221 from fmount/no_debug
Browse files Browse the repository at this point in the history
Do not expose debug section anymore
  • Loading branch information
openshift-merge-bot[bot] authored Feb 2, 2024
2 parents f80cdbc + 005e9f4 commit 183ec1c
Show file tree
Hide file tree
Showing 20 changed files with 27 additions and 226 deletions.
6 changes: 0 additions & 6 deletions api/bases/manila.openstack.org_manilaapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@ spec:
databaseUser:
default: manila
type: string
debug:
properties:
service:
default: false
type: boolean
type: object
extraMounts:
items:
properties:
Expand Down
21 changes: 0 additions & 21 deletions api/bases/manila.openstack.org_manilas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ spec:
dbPurge:
default: false
type: boolean
dbSync:
default: false
type: boolean
type: object
extraMounts:
items:
Expand Down Expand Up @@ -829,12 +826,6 @@ spec:
items:
type: string
type: array
debug:
properties:
service:
default: false
type: boolean
type: object
networkAttachments:
items:
type: string
Expand Down Expand Up @@ -945,12 +936,6 @@ spec:
items:
type: string
type: array
debug:
properties:
service:
default: false
type: boolean
type: object
networkAttachments:
items:
type: string
Expand Down Expand Up @@ -1011,12 +996,6 @@ spec:
items:
type: string
type: array
debug:
properties:
service:
default: false
type: boolean
type: object
networkAttachments:
items:
type: string
Expand Down
6 changes: 0 additions & 6 deletions api/bases/manila.openstack.org_manilaschedulers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@ spec:
databaseUser:
default: manila
type: string
debug:
properties:
service:
default: false
type: boolean
type: object
extraMounts:
items:
properties:
Expand Down
6 changes: 0 additions & 6 deletions api/bases/manila.openstack.org_manilashares.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@ spec:
databaseUser:
default: manila
type: string
debug:
properties:
service:
default: false
type: boolean
type: object
extraMounts:
items:
properties:
Expand Down
14 changes: 0 additions & 14 deletions api/v1beta1/common_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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"`
}
4 changes: 0 additions & 4 deletions api/v1beta1/manila_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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".
Expand Down
16 changes: 0 additions & 16 deletions api/v1beta1/zz_generated.deepcopy.go

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

6 changes: 0 additions & 6 deletions config/crd/bases/manila.openstack.org_manilaapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@ spec:
databaseUser:
default: manila
type: string
debug:
properties:
service:
default: false
type: boolean
type: object
extraMounts:
items:
properties:
Expand Down
21 changes: 0 additions & 21 deletions config/crd/bases/manila.openstack.org_manilas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ spec:
dbPurge:
default: false
type: boolean
dbSync:
default: false
type: boolean
type: object
extraMounts:
items:
Expand Down Expand Up @@ -829,12 +826,6 @@ spec:
items:
type: string
type: array
debug:
properties:
service:
default: false
type: boolean
type: object
networkAttachments:
items:
type: string
Expand Down Expand Up @@ -945,12 +936,6 @@ spec:
items:
type: string
type: array
debug:
properties:
service:
default: false
type: boolean
type: object
networkAttachments:
items:
type: string
Expand Down Expand Up @@ -1011,12 +996,6 @@ spec:
items:
type: string
type: array
debug:
properties:
service:
default: false
type: boolean
type: object
networkAttachments:
items:
type: string
Expand Down
6 changes: 0 additions & 6 deletions config/crd/bases/manila.openstack.org_manilaschedulers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@ spec:
databaseUser:
default: manila
type: string
debug:
properties:
service:
default: false
type: boolean
type: object
extraMounts:
items:
properties:
Expand Down
6 changes: 0 additions & 6 deletions config/crd/bases/manila.openstack.org_manilashares.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@ spec:
databaseUser:
default: manila
type: string
debug:
properties:
service:
default: false
type: boolean
type: object
extraMounts:
items:
properties:
Expand Down
9 changes: 1 addition & 8 deletions pkg/manila/dbsync.go
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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")
Expand Down
28 changes: 8 additions & 20 deletions pkg/manilaapi/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
34 changes: 9 additions & 25 deletions pkg/manilascheduler/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down
34 changes: 9 additions & 25 deletions pkg/manilashare/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down
Loading

0 comments on commit 183ec1c

Please sign in to comment.