From 2b39d3ac78ddfa236c936a0404384f98473e6624 Mon Sep 17 00:00:00 2001 From: avtarOPS Date: Tue, 26 Dec 2023 13:18:20 +0530 Subject: [PATCH] fix: made the startup probe consistent for nodespec and druidspec --- apis/druid/v1alpha1/druid_types.go | 4 ++-- apis/druid/v1alpha1/zz_generated.deepcopy.go | 4 ++-- chart/templates/crds/druid.apache.org_druids.yaml | 4 ++-- config/crd/bases/druid.apache.org_druids.yaml | 4 ++-- config/druid.apache.org_druids.yaml | 2 +- controllers/druid/handler.go | 2 +- docs/api_specifications/druid.md | 4 ++-- e2e/configs/druid-mmless.yaml | 4 ++-- examples/tiny-cluster-mmless.yaml | 4 ++-- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/apis/druid/v1alpha1/druid_types.go b/apis/druid/v1alpha1/druid_types.go index b17fe031..fed134f1 100644 --- a/apis/druid/v1alpha1/druid_types.go +++ b/apis/druid/v1alpha1/druid_types.go @@ -425,9 +425,9 @@ type DruidNodeSpec struct { // +optional ReadinessProbe *v1.Probe `json:"readinessProbe,omitempty"` - // StartUpProbes + // StartUpProbe // +optional - StartUpProbes *v1.Probe `json:"startUpProbes,omitempty"` + StartUpProbe *v1.Probe `json:"startUpProbe,omitempty"` // IngressAnnotations `Ingress` annotations to be populated in ingress spec. // +optional diff --git a/apis/druid/v1alpha1/zz_generated.deepcopy.go b/apis/druid/v1alpha1/zz_generated.deepcopy.go index 4d413372..29a32e03 100644 --- a/apis/druid/v1alpha1/zz_generated.deepcopy.go +++ b/apis/druid/v1alpha1/zz_generated.deepcopy.go @@ -336,8 +336,8 @@ func (in *DruidNodeSpec) DeepCopyInto(out *DruidNodeSpec) { *out = new(v1.Probe) (*in).DeepCopyInto(*out) } - if in.StartUpProbes != nil { - in, out := &in.StartUpProbes, &out.StartUpProbes + if in.StartUpProbe != nil { + in, out := &in.StartUpProbe, &out.StartUpProbe *out = new(v1.Probe) (*in).DeepCopyInto(*out) } diff --git a/chart/templates/crds/druid.apache.org_druids.yaml b/chart/templates/crds/druid.apache.org_druids.yaml index 8b67954f..d3c73c7d 100644 --- a/chart/templates/crds/druid.apache.org_druids.yaml +++ b/chart/templates/crds/druid.apache.org_druids.yaml @@ -6512,8 +6512,8 @@ spec: type: object type: object type: array - startUpProbes: - description: StartUpProbes + startUpProbe: + description: StartUpProbe properties: exec: description: Exec specifies the action to take. diff --git a/config/crd/bases/druid.apache.org_druids.yaml b/config/crd/bases/druid.apache.org_druids.yaml index 8b67954f..d3c73c7d 100644 --- a/config/crd/bases/druid.apache.org_druids.yaml +++ b/config/crd/bases/druid.apache.org_druids.yaml @@ -6512,8 +6512,8 @@ spec: type: object type: object type: array - startUpProbes: - description: StartUpProbes + startUpProbe: + description: StartUpProbe properties: exec: description: Exec specifies the action to take. diff --git a/config/druid.apache.org_druids.yaml b/config/druid.apache.org_druids.yaml index ac7dfdc7..70754c52 100644 --- a/config/druid.apache.org_druids.yaml +++ b/config/druid.apache.org_druids.yaml @@ -5926,7 +5926,7 @@ spec: type: object type: object type: array - startUpProbes: + startUpProbe: description: StartupProbe for nodeSpec properties: exec: diff --git a/controllers/druid/handler.go b/controllers/druid/handler.go index c19099f3..dd7891b9 100644 --- a/controllers/druid/handler.go +++ b/controllers/druid/handler.go @@ -1043,7 +1043,7 @@ func setReadinessProbe(nodeSpec *v1alpha1.DruidNodeSpec, m *v1alpha1.Druid) *v1. func setStartUpProbe(nodeSpec *v1alpha1.DruidNodeSpec, m *v1alpha1.Druid) *v1.Probe { probeType := "startup" startUpProbe := updateDefaultPortInProbe( - firstNonNilValue(nodeSpec.StartUpProbes, m.Spec.StartUpProbe).(*v1.Probe), + firstNonNilValue(nodeSpec.StartUpProbe, m.Spec.StartUpProbe).(*v1.Probe), nodeSpec.DruidPort) if startUpProbe == nil && m.Spec.DefaultProbes { startUpProbe = setDefaultProbe(nodeSpec.DruidPort, nodeSpec.NodeType, probeType) diff --git a/docs/api_specifications/druid.md b/docs/api_specifications/druid.md index 986633ad..0e173eab 100644 --- a/docs/api_specifications/druid.md +++ b/docs/api_specifications/druid.md @@ -1446,7 +1446,7 @@ Port is set to druid.port if not specified with httpGet handler.

-startUpProbes
+startUpProbe
Kubernetes core/v1.Probe @@ -1455,7 +1455,7 @@ Kubernetes core/v1.Probe (Optional) -

StartUpProbes

+

StartUpProbe

diff --git a/e2e/configs/druid-mmless.yaml b/e2e/configs/druid-mmless.yaml index e5fd2820..892dd5f5 100644 --- a/e2e/configs/druid-mmless.yaml +++ b/e2e/configs/druid-mmless.yaml @@ -206,7 +206,7 @@ spec: periodSeconds: 10 successThreshold: 1 timeoutSeconds: 5 - startUpProbes: + startUpProbe: failureThreshold: 20 httpGet: path: /druid/historical/v1/loadstatus @@ -272,7 +272,7 @@ spec: periodSeconds: 10 successThreshold: 1 timeoutSeconds: 5 - startUpProbes: + startUpProbe: failureThreshold: 20 httpGet: path: /druid/historical/v1/loadstatus diff --git a/examples/tiny-cluster-mmless.yaml b/examples/tiny-cluster-mmless.yaml index b9db8924..371710d4 100644 --- a/examples/tiny-cluster-mmless.yaml +++ b/examples/tiny-cluster-mmless.yaml @@ -208,7 +208,7 @@ spec: periodSeconds: 10 successThreshold: 1 timeoutSeconds: 5 - startUpProbes: + startUpProbe: failureThreshold: 20 httpGet: path: /druid/historical/v1/loadstatus @@ -274,7 +274,7 @@ spec: periodSeconds: 10 successThreshold: 1 timeoutSeconds: 5 - startUpProbes: + startUpProbe: failureThreshold: 20 httpGet: path: /druid/historical/v1/loadstatus