Skip to content

Commit

Permalink
Always use --debug for db purge
Browse files Browse the repository at this point in the history
  • Loading branch information
gibizer committed Mar 18, 2024
1 parent e40259d commit 5630afb
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 49 deletions.
6 changes: 0 additions & 6 deletions api/bases/cinder.openstack.org_cinders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,6 @@ spec:
default: 1 0 * * *
type: string
type: object
debug:
properties:
dbPurge:
default: false
type: boolean
type: object
extraMounts:
items:
properties:
Expand Down
14 changes: 0 additions & 14 deletions api/v1beta1/cinder_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ type CinderSpecBase struct {
// Memcached instance name.
MemcachedInstance string `json:"memcachedInstance"`

// +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 CinderDebug `json:"debug,omitempty"`

// +kubebuilder:validation:Optional
// +kubebuilder:default=false
// PreserveJobs - do not delete jobs after they finished e.g. to check logs
Expand Down Expand Up @@ -204,15 +199,6 @@ type DBPurge struct {
Schedule string `json:"schedule"`
}

// 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
// DBPurge increases log verbosity by executing the db_purge command with "--debug".
DBPurge bool `json:"dbPurge"`
}

//+kubebuilder:object:root=true

// CinderList contains a list of Cinder
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/cinder.openstack.org_cinders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,6 @@ spec:
default: 1 0 * * *
type: string
type: object
debug:
properties:
dbPurge:
default: false
type: boolean
type: object
extraMounts:
items:
properties:
Expand Down
8 changes: 1 addition & 7 deletions pkg/cinder/cronjob.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,8 @@ func CronJob(
cinderGroup := int64(cinderv1.CinderGroupID)
config0644AccessMode := int32(0644)

debugArg := ""
if instance.Spec.Debug.DBPurge {
debugArg = " --debug"
}

dbPurgeCommand := fmt.Sprintf(
"/usr/bin/cinder-manage%s --config-dir /etc/cinder/cinder.conf.d db purge %d",
debugArg,
"/usr/bin/cinder-manage --debug --config-dir /etc/cinder/cinder.conf.d db purge %d",
instance.Spec.DBPurge.Age)

args := []string{"-c", dbPurgeCommand}
Expand Down

0 comments on commit 5630afb

Please sign in to comment.