Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Debug fields #327

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions api/bases/cinder.openstack.org_cinderapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ spec:
databaseUser:
default: cinder
type: string
debug:
properties:
service:
default: false
type: boolean
type: object
extraMounts:
items:
properties:
Expand Down
6 changes: 0 additions & 6 deletions api/bases/cinder.openstack.org_cinderbackups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ spec:
databaseUser:
default: cinder
type: string
debug:
properties:
service:
default: false
type: boolean
type: object
extraMounts:
items:
properties:
Expand Down
27 changes: 0 additions & 27 deletions api/bases/cinder.openstack.org_cinders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@ spec:
items:
type: string
type: array
debug:
properties:
service:
default: false
type: boolean
type: object
networkAttachments:
items:
type: string
Expand Down Expand Up @@ -178,12 +172,6 @@ spec:
items:
type: string
type: array
debug:
properties:
service:
default: false
type: boolean
type: object
networkAttachments:
items:
type: string
Expand Down Expand Up @@ -241,12 +229,6 @@ spec:
items:
type: string
type: array
debug:
properties:
service:
default: false
type: boolean
type: object
networkAttachments:
items:
type: string
Expand Down Expand Up @@ -305,12 +287,6 @@ spec:
items:
type: string
type: array
debug:
properties:
service:
default: false
type: boolean
type: object
networkAttachments:
items:
type: string
Expand Down Expand Up @@ -382,9 +358,6 @@ spec:
dbPurge:
default: false
type: boolean
dbSync:
default: false
type: boolean
type: object
extraMounts:
items:
Expand Down
6 changes: 0 additions & 6 deletions api/bases/cinder.openstack.org_cinderschedulers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ spec:
databaseUser:
default: cinder
type: string
debug:
properties:
service:
default: false
type: boolean
type: object
extraMounts:
items:
properties:
Expand Down
6 changes: 0 additions & 6 deletions api/bases/cinder.openstack.org_cindervolumes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ spec:
databaseUser:
default: cinder
type: string
debug:
properties:
service:
default: false
type: boolean
type: object
extraMounts:
items:
properties:
Expand Down
4 changes: 0 additions & 4 deletions api/v1beta1/cinder_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,6 @@ type DBPurge struct {
// CinderDebug contains flags related to multiple debug activities. See the
// individual comments for what this means for each flag.
type CinderDebug struct {
// +kubebuilder:validation:Optional
// +kubebuilder:default=false
// DBSync pauses the dbSync container instead of executing the db_sync command.
DBSync bool `json:"dbSync"`
// +kubebuilder:validation:Optional
// +kubebuilder:default=false
// DBPurge increases log verbosity by executing the db_purge command with "--debug".
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 @@ -55,11 +55,6 @@ type CinderServiceTemplate struct {
// any global NodeSelector settings within the Cinder 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 CinderServiceDebug `json:"debug,omitempty"`

// +kubebuilder:validation:Optional
// CustomServiceConfig - customize the service config using this parameter to change service defaults,
// or overwrite rendered information using raw OpenStack config format. The content gets added to
Expand Down Expand Up @@ -94,12 +89,3 @@ type PasswordSelector struct {
// Service - Selector to get the cinder service password from the Secret
Service string `json:"service"`
}

// CinderServiceDebug indicates whether certain stages of Cinder service
// deployment should pause in debug mode
type CinderServiceDebug struct {
// +kubebuilder:validation:Optional
// +kubebuilder:default=false
// service enable debug
Service bool `json:"service"`
}
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/cinder.openstack.org_cinderapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ spec:
databaseUser:
default: cinder
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/cinder.openstack.org_cinderbackups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ spec:
databaseUser:
default: cinder
type: string
debug:
properties:
service:
default: false
type: boolean
type: object
extraMounts:
items:
properties:
Expand Down
27 changes: 0 additions & 27 deletions config/crd/bases/cinder.openstack.org_cinders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@ spec:
items:
type: string
type: array
debug:
properties:
service:
default: false
type: boolean
type: object
networkAttachments:
items:
type: string
Expand Down Expand Up @@ -178,12 +172,6 @@ spec:
items:
type: string
type: array
debug:
properties:
service:
default: false
type: boolean
type: object
networkAttachments:
items:
type: string
Expand Down Expand Up @@ -241,12 +229,6 @@ spec:
items:
type: string
type: array
debug:
properties:
service:
default: false
type: boolean
type: object
networkAttachments:
items:
type: string
Expand Down Expand Up @@ -305,12 +287,6 @@ spec:
items:
type: string
type: array
debug:
properties:
service:
default: false
type: boolean
type: object
networkAttachments:
items:
type: string
Expand Down Expand Up @@ -382,9 +358,6 @@ spec:
dbPurge:
default: false
type: boolean
dbSync:
default: false
type: boolean
type: object
extraMounts:
items:
Expand Down
6 changes: 0 additions & 6 deletions config/crd/bases/cinder.openstack.org_cinderschedulers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ spec:
databaseUser:
default: cinder
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/cinder.openstack.org_cindervolumes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ spec:
databaseUser:
default: cinder
type: string
debug:
properties:
service:
default: false
type: boolean
type: object
extraMounts:
items:
properties:
Expand Down
8 changes: 1 addition & 7 deletions pkg/cinder/dbsync.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package cinder

import (
cinderv1beta1 "github.com/openstack-k8s-operators/cinder-operator/api/v1beta1"
common "github.com/openstack-k8s-operators/lib-common/modules/common"
"github.com/openstack-k8s-operators/lib-common/modules/common/env"
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -74,12 +73,7 @@ func DbSyncJob(instance *cinderv1beta1.Cinder, labels map[string]string, annotat

dbSyncExtraMounts := []cinderv1beta1.CinderExtraVolMounts{}

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{}
Expand Down
36 changes: 12 additions & 24 deletions pkg/cinderapi/statefuleset.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package cinderapi
import (
cinderv1beta1 "github.com/openstack-k8s-operators/cinder-operator/api/v1beta1"
cinder "github.com/openstack-k8s-operators/cinder-operator/pkg/cinder"
common "github.com/openstack-k8s-operators/lib-common/modules/common"
"github.com/openstack-k8s-operators/lib-common/modules/common/env"
"github.com/openstack-k8s-operators/lib-common/modules/common/service"
"github.com/openstack-k8s-operators/lib-common/modules/common/tls"
Expand Down Expand Up @@ -56,30 +55,19 @@ 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(cinder.CinderPublicPort)},
}
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(cinder.CinderPublicPort)},
}
readinessProbe.HTTPGet = livenessProbe.HTTPGet

if instance.Spec.TLS.API.Enabled(service.EndpointPublic) {
livenessProbe.HTTPGet.Scheme = corev1.URISchemeHTTPS
readinessProbe.HTTPGet.Scheme = corev1.URISchemeHTTPS
}
if instance.Spec.TLS.API.Enabled(service.EndpointPublic) {
livenessProbe.HTTPGet.Scheme = corev1.URISchemeHTTPS
readinessProbe.HTTPGet.Scheme = corev1.URISchemeHTTPS
}

// create Volume and VolumeMounts
Expand Down
Loading
Loading