Skip to content

Commit

Permalink
Merge branch 'main' into add_tls
Browse files Browse the repository at this point in the history
  • Loading branch information
d34dh0r53 authored Feb 5, 2024
2 parents 31aceb6 + 655a181 commit 6bbed64
Show file tree
Hide file tree
Showing 17 changed files with 27 additions and 302 deletions.
24 changes: 0 additions & 24 deletions api/bases/barbican.openstack.org_barbicanapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,30 +67,6 @@ spec:
description: DatabaseUser - optional username used for barbican DB,
defaults to barbican
type: string
debug:
description: '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 TODO(dmendiza): Do we need this?'
properties:
dbInitContainer:
default: false
description: dbInitContainer enable debug (waits until /tmp/stop-init-container
disappears)
type: boolean
dbSync:
default: false
description: dbSync enable debug
type: boolean
initContainer:
default: false
description: initContainer enable debug (waits until /tmp/stop-init-container
disappears)
type: boolean
service:
default: false
description: Service enable debug
type: boolean
type: object
defaultConfigOverwrite:
additionalProperties:
type: string
Expand Down
24 changes: 0 additions & 24 deletions api/bases/barbican.openstack.org_barbicankeystonelisteners.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,30 +68,6 @@ spec:
description: DatabaseUser - optional username used for barbican DB,
defaults to barbican
type: string
debug:
description: '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 TODO(dmendiza): Do we need this?'
properties:
dbInitContainer:
default: false
description: dbInitContainer enable debug (waits until /tmp/stop-init-container
disappears)
type: boolean
dbSync:
default: false
description: dbSync enable debug
type: boolean
initContainer:
default: false
description: initContainer enable debug (waits until /tmp/stop-init-container
disappears)
type: boolean
service:
default: false
description: Service enable debug
type: boolean
type: object
defaultConfigOverwrite:
additionalProperties:
type: string
Expand Down
24 changes: 0 additions & 24 deletions api/bases/barbican.openstack.org_barbicans.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -581,30 +581,6 @@ spec:
description: DatabaseUser - optional username used for barbican DB,
defaults to barbican
type: string
debug:
description: '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 TODO(dmendiza): Do we need this?'
properties:
dbInitContainer:
default: false
description: dbInitContainer enable debug (waits until /tmp/stop-init-container
disappears)
type: boolean
dbSync:
default: false
description: dbSync enable debug
type: boolean
initContainer:
default: false
description: initContainer enable debug (waits until /tmp/stop-init-container
disappears)
type: boolean
service:
default: false
description: Service enable debug
type: boolean
type: object
defaultConfigOverwrite:
additionalProperties:
type: string
Expand Down
24 changes: 0 additions & 24 deletions api/bases/barbican.openstack.org_barbicanworkers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,30 +66,6 @@ spec:
description: DatabaseUser - optional username used for barbican DB,
defaults to barbican
type: string
debug:
description: '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 TODO(dmendiza): Do we need this?'
properties:
dbInitContainer:
default: false
description: dbInitContainer enable debug (waits until /tmp/stop-init-container
disappears)
type: boolean
dbSync:
default: false
description: dbSync enable debug
type: boolean
initContainer:
default: false
description: initContainer enable debug (waits until /tmp/stop-init-container
disappears)
type: boolean
service:
default: false
description: Service enable debug
type: boolean
type: object
defaultConfigOverwrite:
additionalProperties:
type: string
Expand Down
29 changes: 0 additions & 29 deletions api/v1beta1/common_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ type BarbicanTemplate struct {
// PasswordSelectors - Selectors to identify the DB and ServiceUser password from the Secret
PasswordSelectors PasswordSelector `json:"passwordSelectors"`

// +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
// TODO(dmendiza): Do we need this?
Debug BarbicanDebug `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 @@ -121,26 +115,3 @@ type PasswordSelector struct {
// Service - Selector to get the barbican service user password from the Secret
Service string `json:"service"`
}

// BarbicanDebug indicates whether certain stages of deployment should be paused
type BarbicanDebug struct {
// +kubebuilder:validation:Optional
// +kubebuilder:default=false
// dbInitContainer enable debug (waits until /tmp/stop-init-container disappears)
DBInitContainer bool `json:"dbInitContainer"`

// +kubebuilder:validation:Optional
// +kubebuilder:default=false
// dbSync enable debug
DBSync bool `json:"dbSync"`

// +kubebuilder:validation:Optional
// +kubebuilder:default=false
// initContainer enable debug (waits until /tmp/stop-init-container disappears)
InitContainer bool `json:"initContainer"`

// +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.

24 changes: 0 additions & 24 deletions config/crd/bases/barbican.openstack.org_barbicanapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,30 +67,6 @@ spec:
description: DatabaseUser - optional username used for barbican DB,
defaults to barbican
type: string
debug:
description: '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 TODO(dmendiza): Do we need this?'
properties:
dbInitContainer:
default: false
description: dbInitContainer enable debug (waits until /tmp/stop-init-container
disappears)
type: boolean
dbSync:
default: false
description: dbSync enable debug
type: boolean
initContainer:
default: false
description: initContainer enable debug (waits until /tmp/stop-init-container
disappears)
type: boolean
service:
default: false
description: Service enable debug
type: boolean
type: object
defaultConfigOverwrite:
additionalProperties:
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,30 +68,6 @@ spec:
description: DatabaseUser - optional username used for barbican DB,
defaults to barbican
type: string
debug:
description: '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 TODO(dmendiza): Do we need this?'
properties:
dbInitContainer:
default: false
description: dbInitContainer enable debug (waits until /tmp/stop-init-container
disappears)
type: boolean
dbSync:
default: false
description: dbSync enable debug
type: boolean
initContainer:
default: false
description: initContainer enable debug (waits until /tmp/stop-init-container
disappears)
type: boolean
service:
default: false
description: Service enable debug
type: boolean
type: object
defaultConfigOverwrite:
additionalProperties:
type: string
Expand Down
24 changes: 0 additions & 24 deletions config/crd/bases/barbican.openstack.org_barbicans.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -581,30 +581,6 @@ spec:
description: DatabaseUser - optional username used for barbican DB,
defaults to barbican
type: string
debug:
description: '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 TODO(dmendiza): Do we need this?'
properties:
dbInitContainer:
default: false
description: dbInitContainer enable debug (waits until /tmp/stop-init-container
disappears)
type: boolean
dbSync:
default: false
description: dbSync enable debug
type: boolean
initContainer:
default: false
description: initContainer enable debug (waits until /tmp/stop-init-container
disappears)
type: boolean
service:
default: false
description: Service enable debug
type: boolean
type: object
defaultConfigOverwrite:
additionalProperties:
type: string
Expand Down
24 changes: 0 additions & 24 deletions config/crd/bases/barbican.openstack.org_barbicanworkers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,30 +66,6 @@ spec:
description: DatabaseUser - optional username used for barbican DB,
defaults to barbican
type: string
debug:
description: '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 TODO(dmendiza): Do we need this?'
properties:
dbInitContainer:
default: false
description: dbInitContainer enable debug (waits until /tmp/stop-init-container
disappears)
type: boolean
dbSync:
default: false
description: dbSync enable debug
type: boolean
initContainer:
default: false
description: initContainer enable debug (waits until /tmp/stop-init-container
disappears)
type: boolean
service:
default: false
description: Service enable debug
type: boolean
type: object
defaultConfigOverwrite:
additionalProperties:
type: string
Expand Down
5 changes: 0 additions & 5 deletions config/samples/barbican_v1beta1_barbican.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ spec:
passwordSelectors:
database: BarbicanDatabasePassword
service: BarbicanPassword
debug:
dbInitContainer: false
dbSync: false
initContainer: false
service: false
preserveJobs: true
nodeSelector:
node: controller
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20240117103205-2bd91a3da216
github.com/openstack-k8s-operators/lib-common/modules/storage v0.3.1-0.20240117103205-2bd91a3da216
github.com/openstack-k8s-operators/lib-common/modules/test v0.3.1-0.20240117103205-2bd91a3da216
github.com/openstack-k8s-operators/mariadb-operator/api v0.3.0
github.com/openstack-k8s-operators/mariadb-operator/api v0.3.1-0.20240124160436-36095347284f
go.uber.org/zap v1.26.0
k8s.io/api v0.26.13
k8s.io/apimachinery v0.27.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ github.com/openstack-k8s-operators/lib-common/modules/storage v0.3.1-0.202401171
github.com/openstack-k8s-operators/lib-common/modules/storage v0.3.1-0.20240117103205-2bd91a3da216/go.mod h1:Z8oPtR/G1ukNwJoD75I8Ew+8Ibt4vqtK+XoaiKK3gXk=
github.com/openstack-k8s-operators/lib-common/modules/test v0.3.1-0.20240117103205-2bd91a3da216 h1:VTlhT+Epr3YY/I9NKKCv4MWITnNgBUXv684FB7YQT+E=
github.com/openstack-k8s-operators/lib-common/modules/test v0.3.1-0.20240117103205-2bd91a3da216/go.mod h1:ni4mvKeubWsTjKmcToJ+hIo7pJipM9hwiUv8qhm1R6Y=
github.com/openstack-k8s-operators/mariadb-operator/api v0.3.0 h1:FB0xB6whYM6W4XIncYo2mPiOJWkFsIOWtCT+UOtvOaQ=
github.com/openstack-k8s-operators/mariadb-operator/api v0.3.0/go.mod h1:xhiz5wFdKWwVM7BF/VYon4TT3NuUPXp/Pyn2hWcp0CE=
github.com/openstack-k8s-operators/mariadb-operator/api v0.3.1-0.20240124160436-36095347284f h1:01HrDX32rjFdvbSOMfz0fBCfxK6Kqthv0BgvimWL7Vc=
github.com/openstack-k8s-operators/mariadb-operator/api v0.3.1-0.20240124160436-36095347284f/go.mod h1:gAIo5SMvTTgUomxGC51T3PHIyremhe8xUvz2xpbuCsI=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
Expand Down
9 changes: 2 additions & 7 deletions pkg/barbican/dbsync.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package barbican
import (
barbicanv1beta1 "github.com/openstack-k8s-operators/barbican-operator/api/v1beta1"

"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 @@ -67,12 +66,8 @@ func DbSyncJob(instance *barbicanv1beta1.Barbican, labels map[string]string, ann
dbSyncVolume = append(dbSyncVolume, instance.Spec.BarbicanAPI.TLS.CreateVolume())
dbSyncMounts = append(dbSyncMounts, instance.Spec.BarbicanAPI.TLS.CreateVolumeMounts(nil)...)
}
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
Loading

0 comments on commit 6bbed64

Please sign in to comment.