Skip to content

Commit e674727

Browse files
gibizeropenshift-merge-bot[bot]
authored andcommitted
Drop Debug fields
These fields were redundant. Crashing pods can be debugged via oc debug. Implements: OSPRH-4290
1 parent d7eed75 commit e674727

File tree

10 files changed

+14
-109
lines changed

10 files changed

+14
-109
lines changed

api/bases/placement.openstack.org_placementapis.yaml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,6 @@ spec:
7070
DB, defaults to placement TODO: -> implement needs work in mariadb-operator,
7171
right now only placement'
7272
type: string
73-
debug:
74-
description: Debug - enable debug for different deploy stages. If
75-
an init container is used, it runs and the actual action pod gets
76-
started with sleep infinity
77-
properties:
78-
dbSync:
79-
default: false
80-
description: DBSync enable debug
81-
type: boolean
82-
service:
83-
default: false
84-
description: Service enable debug
85-
type: boolean
86-
type: object
8773
defaultConfigOverwrite:
8874
additionalProperties:
8975
type: string

api/v1beta1/placementapi_types.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,6 @@ type PlacementAPISpec struct {
8282
// NodeSelector to target subset of worker nodes running this service
8383
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
8484

85-
// +kubebuilder:validation:Optional
86-
// Debug - enable debug for different deploy stages. If an init container is used, it runs and the
87-
// actual action pod gets started with sleep infinity
88-
Debug PlacementAPIDebug `json:"debug,omitempty"`
89-
9085
// +kubebuilder:validation:Optional
9186
// +kubebuilder:default=false
9287
// PreserveJobs - do not delete jobs after they finished e.g. to check logs
@@ -143,18 +138,6 @@ type PasswordSelector struct {
143138
Service string `json:"service"`
144139
}
145140

146-
// PlacementAPIDebug defines the observed state of PlacementAPIDebug
147-
type PlacementAPIDebug struct {
148-
// +kubebuilder:validation:Optional
149-
// +kubebuilder:default=false
150-
// DBSync enable debug
151-
DBSync bool `json:"dbSync"`
152-
// +kubebuilder:validation:Optional
153-
// +kubebuilder:default=false
154-
// Service enable debug
155-
Service bool `json:"service"`
156-
}
157-
158141
// PlacementAPIStatus defines the observed state of PlacementAPI
159142
type PlacementAPIStatus struct {
160143
// ReadyCount of placement API instances

api/v1beta1/zz_generated.deepcopy.go

Lines changed: 0 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/placement.openstack.org_placementapis.yaml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,6 @@ spec:
7070
DB, defaults to placement TODO: -> implement needs work in mariadb-operator,
7171
right now only placement'
7272
type: string
73-
debug:
74-
description: Debug - enable debug for different deploy stages. If
75-
an init container is used, it runs and the actual action pod gets
76-
started with sleep infinity
77-
properties:
78-
dbSync:
79-
default: false
80-
description: DBSync enable debug
81-
type: boolean
82-
service:
83-
default: false
84-
description: Service enable debug
85-
type: boolean
86-
type: object
8773
defaultConfigOverwrite:
8874
additionalProperties:
8975
type: string

config/samples/placement_v1beta1_placementapi.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ spec:
99
debug = true
1010
databaseInstance: openstack
1111
databaseUser: placement
12-
debug:
13-
dbSync: false
14-
service: false
1512
preserveJobs: false
1613
replicas: 1
1714
secret: placement-secret

config/samples/placement_v1beta1_placementtls.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ spec:
99
debug = true
1010
databaseInstance: openstack
1111
databaseUser: placement
12-
debug:
13-
dbSync: false
14-
service: false
1512
preserveJobs: false
1613
replicas: 1
1714
secret: placement-secret

pkg/placement/dbsync.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ package placement
1818
import (
1919
placementv1 "github.com/openstack-k8s-operators/placement-operator/api/v1beta1"
2020

21-
common "github.com/openstack-k8s-operators/lib-common/modules/common"
2221
env "github.com/openstack-k8s-operators/lib-common/modules/common/env"
2322

2423
batchv1 "k8s.io/api/batch/v1"
@@ -33,12 +32,7 @@ func DbSyncJob(
3332
labels map[string]string,
3433
annotations map[string]string,
3534
) *batchv1.Job {
36-
args := []string{"-c"}
37-
if instance.Spec.Debug.DBSync {
38-
args = append(args, common.DebugCommand)
39-
} else {
40-
args = append(args, KollaServiceCommand)
41-
}
35+
args := []string{"-c", KollaServiceCommand}
4236

4337
envVars := map[string]env.Setter{}
4438
envVars["KOLLA_CONFIG_STRATEGY"] = env.SetValue("COPY_ALWAYS")

pkg/placement/deployment.go

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -56,36 +56,20 @@ func Deployment(
5656
InitialDelaySeconds: 5,
5757
}
5858

59-
args := []string{"-c"}
60-
if instance.Spec.Debug.Service {
61-
args = append(args, common.DebugCommand)
62-
livenessProbe.Exec = &corev1.ExecAction{
63-
Command: []string{
64-
"/bin/true",
65-
},
66-
}
67-
68-
readinessProbe.Exec = &corev1.ExecAction{
69-
Command: []string{
70-
"/bin/true",
71-
},
72-
}
73-
} else {
74-
args = append(args, KollaServiceCommand)
75-
//
76-
// https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
77-
//
78-
livenessProbe.HTTPGet = &corev1.HTTPGetAction{
79-
Port: intstr.IntOrString{Type: intstr.Int, IntVal: int32(PlacementPublicPort)},
80-
}
81-
readinessProbe.HTTPGet = &corev1.HTTPGetAction{
82-
Port: intstr.IntOrString{Type: intstr.Int, IntVal: int32(PlacementPublicPort)},
83-
}
59+
args := []string{"-c", KollaServiceCommand}
60+
//
61+
// https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
62+
//
63+
livenessProbe.HTTPGet = &corev1.HTTPGetAction{
64+
Port: intstr.IntOrString{Type: intstr.Int, IntVal: int32(PlacementPublicPort)},
65+
}
66+
readinessProbe.HTTPGet = &corev1.HTTPGetAction{
67+
Port: intstr.IntOrString{Type: intstr.Int, IntVal: int32(PlacementPublicPort)},
68+
}
8469

85-
if instance.Spec.TLS.API.Enabled(service.EndpointPublic) {
86-
livenessProbe.HTTPGet.Scheme = corev1.URISchemeHTTPS
87-
readinessProbe.HTTPGet.Scheme = corev1.URISchemeHTTPS
88-
}
70+
if instance.Spec.TLS.API.Enabled(service.EndpointPublic) {
71+
livenessProbe.HTTPGet.Scheme = corev1.URISchemeHTTPS
72+
readinessProbe.HTTPGet.Scheme = corev1.URISchemeHTTPS
8973
}
9074

9175
envVars := map[string]env.Setter{}

tests/kuttl/common/assert_sample_deployment.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ spec:
1010
debug = true
1111
databaseInstance: openstack
1212
databaseUser: placement
13-
debug:
14-
dbSync: false
15-
service: false
1613
passwordSelectors:
1714
database: PlacementDatabasePassword
1815
service: PlacementPassword

tests/kuttl/tests/placement_deploy_tls/03-assert.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ spec:
1010
debug = true
1111
databaseInstance: openstack
1212
databaseUser: placement
13-
debug:
14-
dbSync: false
15-
service: false
1613
passwordSelectors:
1714
database: PlacementDatabasePassword
1815
service: PlacementPassword

0 commit comments

Comments
 (0)