From b28931cc001ba4b50ed3294e92e9934a2fdd75d5 Mon Sep 17 00:00:00 2001 From: Hank W Ibell Date: Wed, 6 Apr 2022 17:22:25 -0400 Subject: [PATCH] Set default values for probes --- api/v1beta2/openlibertyapplication_types.go | 17 ++++- api/v1beta2/zz_generated.deepcopy.go | 1 + .../scorecard/kuttl/probe/03-assert.yaml | 49 ++++++++++++ .../probe/03-liberty-probe-defaults.yaml | 14 ++++ .../scorecard/kuttl/probe/04-assert.yaml | 29 ++++++++ .../scorecard/kuttl/probe/04-errors.yaml | 20 +++++ .../kuttl/probe/04-liberty-probe-undef.yaml | 13 ++++ .../scorecard/kuttl/probe/05-assert.yaml | 30 ++++++++ .../scorecard/kuttl/probe/05-errors.yaml | 20 +++++ .../probe/05-liberty-probe-override.yaml | 15 ++++ go.mod | 2 +- go.sum | 2 + .../api/v1beta2/runtimecomponent_types.go | 17 ++++- .../api/v1beta2/zz_generated.deepcopy.go | 1 + .../common/common.go | 53 +++++++++++++ .../common/types.go | 4 + .../runtime-component-operator/utils/utils.go | 74 ++++++++++++++----- vendor/modules.txt | 2 +- 18 files changed, 340 insertions(+), 23 deletions(-) create mode 100644 bundle/tests/scorecard/kuttl/probe/03-assert.yaml create mode 100644 bundle/tests/scorecard/kuttl/probe/03-liberty-probe-defaults.yaml create mode 100644 bundle/tests/scorecard/kuttl/probe/04-assert.yaml create mode 100644 bundle/tests/scorecard/kuttl/probe/04-errors.yaml create mode 100644 bundle/tests/scorecard/kuttl/probe/04-liberty-probe-undef.yaml create mode 100644 bundle/tests/scorecard/kuttl/probe/05-assert.yaml create mode 100644 bundle/tests/scorecard/kuttl/probe/05-errors.yaml create mode 100644 bundle/tests/scorecard/kuttl/probe/05-liberty-probe-override.yaml create mode 100644 vendor/github.com/application-stacks/runtime-component-operator/common/common.go diff --git a/api/v1beta2/openlibertyapplication_types.go b/api/v1beta2/openlibertyapplication_types.go index 545e09d5c..d197de773 100644 --- a/api/v1beta2/openlibertyapplication_types.go +++ b/api/v1beta2/openlibertyapplication_types.go @@ -359,7 +359,7 @@ const ( // +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Reconciled')].reason",priority=1,description="Reason for the failure of reconcile condition" // +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Reconciled')].message",priority=1,description="Failure message from reconcile condition" // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",priority=0,description="Age of the resource" -//+operator-sdk:csv:customresourcedefinitions:displayName="OpenLibertyApplication",resources={{Deployment,v1},{Service,v1},{StatefulSet,v1},{Route,v1},{HorizontalPodAutoscaler,v1},{ServiceAccount,v1},{Secret,v1}} +// +operator-sdk:csv:customresourcedefinitions:displayName="OpenLibertyApplication",resources={{Deployment,v1},{Service,v1},{StatefulSet,v1},{Route,v1},{HorizontalPodAutoscaler,v1},{ServiceAccount,v1},{Secret,v1}} // Represents the deployment of an Open Liberty application type OpenLibertyApplication struct { @@ -536,6 +536,21 @@ func (p *OpenLibertyApplicationProbes) GetStartupProbe() *corev1.Probe { return p.Startup } +// GetDefaultLivenessProbe returns default values for liveness probe +func (p *OpenLibertyApplicationProbes) GetDefaultLivenessProbe(ba common.BaseComponent) *corev1.Probe { + return common.GetDefaultMicroProfileLivenessProbe(ba) +} + +// GetDefaultReadinessProbe returns default values for readiness probe +func (p *OpenLibertyApplicationProbes) GetDefaultReadinessProbe(ba common.BaseComponent) *corev1.Probe { + return common.GetDefaultMicroProfileReadinessProbe(ba) +} + +// GetDefaultStartupProbe returns default values for startup probe +func (p *OpenLibertyApplicationProbes) GetDefaultStartupProbe(ba common.BaseComponent) *corev1.Probe { + return common.GetDefaultMicroProfileStartupProbe(ba) +} + // GetVolumes returns volumes slice func (cr *OpenLibertyApplication) GetVolumes() []corev1.Volume { return cr.Spec.Volumes diff --git a/api/v1beta2/zz_generated.deepcopy.go b/api/v1beta2/zz_generated.deepcopy.go index 7ddfbf284..f25ae0e77 100644 --- a/api/v1beta2/zz_generated.deepcopy.go +++ b/api/v1beta2/zz_generated.deepcopy.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated /* diff --git a/bundle/tests/scorecard/kuttl/probe/03-assert.yaml b/bundle/tests/scorecard/kuttl/probe/03-assert.yaml new file mode 100644 index 000000000..01bc83845 --- /dev/null +++ b/bundle/tests/scorecard/kuttl/probe/03-assert.yaml @@ -0,0 +1,49 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestAssert +timeout: 120 +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: probes-liberty +spec: + selector: + matchLabels: + app.kubernetes.io/instance: probes-liberty + template: + spec: + containers: + - livenessProbe: + failureThreshold: 3 + httpGet: + path: /health/live + port: 9443 + scheme: HTTPS + initialDelaySeconds: 60 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 3 + readinessProbe: + failureThreshold: 3 + httpGet: + path: /health/ready + port: 9443 + scheme: HTTPS + initialDelaySeconds: 30 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 3 + startupProbe: + failureThreshold: 3 + httpGet: + path: /health/started + port: 9443 + scheme: HTTPS + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 1 +status: + observedGeneration: 4 + readyReplicas: 1 + replicas: 1 + updatedReplicas: 1 diff --git a/bundle/tests/scorecard/kuttl/probe/03-liberty-probe-defaults.yaml b/bundle/tests/scorecard/kuttl/probe/03-liberty-probe-defaults.yaml new file mode 100644 index 000000000..e39b622b2 --- /dev/null +++ b/bundle/tests/scorecard/kuttl/probe/03-liberty-probe-defaults.yaml @@ -0,0 +1,14 @@ +apiVersion: apps.openliberty.io/v1beta2 +kind: OpenLibertyApplication +metadata: + name: probes-liberty +spec: + # Add fields here + applicationImage: icr.io/appcafe/open-liberty/samples/getting-started + service: + port: 9443 + replicas: 1 + probes: + startup: {} + liveness: {} + readiness: {} diff --git a/bundle/tests/scorecard/kuttl/probe/04-assert.yaml b/bundle/tests/scorecard/kuttl/probe/04-assert.yaml new file mode 100644 index 000000000..8fe3ea133 --- /dev/null +++ b/bundle/tests/scorecard/kuttl/probe/04-assert.yaml @@ -0,0 +1,29 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestAssert +timeout: 120 +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: probes-liberty +spec: + selector: + matchLabels: + app.kubernetes.io/instance: probes-liberty + template: + spec: + containers: + - startupProbe: + failureThreshold: 3 + httpGet: + path: /health/started + port: 9443 + scheme: HTTPS + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 1 +status: + observedGeneration: 5 + readyReplicas: 1 + replicas: 1 + updatedReplicas: 1 diff --git a/bundle/tests/scorecard/kuttl/probe/04-errors.yaml b/bundle/tests/scorecard/kuttl/probe/04-errors.yaml new file mode 100644 index 000000000..e633f2daf --- /dev/null +++ b/bundle/tests/scorecard/kuttl/probe/04-errors.yaml @@ -0,0 +1,20 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: probes-liberty +spec: + selector: + matchLabels: + app.kubernetes.io/instance: probes-liberty + template: + spec: + containers: + - livenessProbe: + failureThreshold: 3 + readinessProbe: + failureThreshold: 3 +status: + observedGeneration: 5 + replicas: 1 + readyReplicas: 1 + updatedReplicas: 1 diff --git a/bundle/tests/scorecard/kuttl/probe/04-liberty-probe-undef.yaml b/bundle/tests/scorecard/kuttl/probe/04-liberty-probe-undef.yaml new file mode 100644 index 000000000..9e4281966 --- /dev/null +++ b/bundle/tests/scorecard/kuttl/probe/04-liberty-probe-undef.yaml @@ -0,0 +1,13 @@ +apiVersion: apps.openliberty.io/v1beta2 +kind: OpenLibertyApplication +metadata: + name: probes-liberty +spec: + # Add fields here + applicationImage: icr.io/appcafe/open-liberty/samples/getting-started + service: + port: 9443 + probes: + startup: {} + liveness: + readiness: diff --git a/bundle/tests/scorecard/kuttl/probe/05-assert.yaml b/bundle/tests/scorecard/kuttl/probe/05-assert.yaml new file mode 100644 index 000000000..da83ed14d --- /dev/null +++ b/bundle/tests/scorecard/kuttl/probe/05-assert.yaml @@ -0,0 +1,30 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestAssert +timeout: 120 +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: probes-liberty +spec: + selector: + matchLabels: + app.kubernetes.io/instance: probes-liberty + template: + spec: + containers: + - startupProbe: + failureThreshold: 3 + httpGet: + path: /health/started + port: 9443 + scheme: HTTPS + initialDelaySeconds: 3 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 1 +status: + observedGeneration: 6 + readyReplicas: 1 + replicas: 1 + updatedReplicas: 1 diff --git a/bundle/tests/scorecard/kuttl/probe/05-errors.yaml b/bundle/tests/scorecard/kuttl/probe/05-errors.yaml new file mode 100644 index 000000000..f19146221 --- /dev/null +++ b/bundle/tests/scorecard/kuttl/probe/05-errors.yaml @@ -0,0 +1,20 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: probes-liberty +spec: + selector: + matchLabels: + app.kubernetes.io/instance: probes-liberty + template: + spec: + containers: + - livenessProbe: + failureThreshold: 3 + readinessProbe: + failureThreshold: 3 +status: + observedGeneration: 6 + replicas: 1 + readyReplicas: 1 + updatedReplicas: 1 diff --git a/bundle/tests/scorecard/kuttl/probe/05-liberty-probe-override.yaml b/bundle/tests/scorecard/kuttl/probe/05-liberty-probe-override.yaml new file mode 100644 index 000000000..a41924661 --- /dev/null +++ b/bundle/tests/scorecard/kuttl/probe/05-liberty-probe-override.yaml @@ -0,0 +1,15 @@ +apiVersion: apps.openliberty.io/v1beta2 +kind: OpenLibertyApplication +metadata: + name: probes-liberty +spec: + # Add fields here + applicationImage: icr.io/appcafe/open-liberty/samples/getting-started + service: + port: 9443 + replicas: 1 + probes: + startup: + initialDelaySeconds: 3 + readiness: + liveness: diff --git a/go.mod b/go.mod index ad74f7cc1..95a8768c6 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/OpenLiberty/open-liberty-operator go 1.16 require ( - github.com/application-stacks/runtime-component-operator v0.8.1-0.20220405182540-00ecc1f1f51d + github.com/application-stacks/runtime-component-operator v0.8.1-0.20220406013638-131565c1b2b8 github.com/coreos/prometheus-operator v0.41.1 github.com/go-logr/logr v0.3.0 github.com/openshift/api v0.0.0-20201019163320-c6a5ec25f267 diff --git a/go.sum b/go.sum index f97ccd3ab..5d7ddc3e8 100644 --- a/go.sum +++ b/go.sum @@ -213,6 +213,8 @@ github.com/aphistic/golf v0.0.0-20180712155816-02c07f170c5a/go.mod h1:3NqKYiepwy github.com/aphistic/sweet v0.2.0/go.mod h1:fWDlIh/isSE9n6EPsRmC0det+whmX6dJid3stzu0Xys= github.com/application-stacks/runtime-component-operator v0.8.1-0.20220405182540-00ecc1f1f51d h1:wqeot/blEksWnzophJTZ9ANxiizdK7Z1kGIhjOinu2s= github.com/application-stacks/runtime-component-operator v0.8.1-0.20220405182540-00ecc1f1f51d/go.mod h1:h365eRTO2WuA+IYMxW/DrOZCqePnX7NyxN5MzqsV20k= +github.com/application-stacks/runtime-component-operator v0.8.1-0.20220406013638-131565c1b2b8 h1:Y5UssB0JvjHogKaIu7D2Z79wH1QOtwjGjQgU9jJ5pp4= +github.com/application-stacks/runtime-component-operator v0.8.1-0.20220406013638-131565c1b2b8/go.mod h1:h365eRTO2WuA+IYMxW/DrOZCqePnX7NyxN5MzqsV20k= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= diff --git a/vendor/github.com/application-stacks/runtime-component-operator/api/v1beta2/runtimecomponent_types.go b/vendor/github.com/application-stacks/runtime-component-operator/api/v1beta2/runtimecomponent_types.go index dc06fcad7..1ebd2e3d4 100644 --- a/vendor/github.com/application-stacks/runtime-component-operator/api/v1beta2/runtimecomponent_types.go +++ b/vendor/github.com/application-stacks/runtime-component-operator/api/v1beta2/runtimecomponent_types.go @@ -361,7 +361,7 @@ const ( // +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Reconciled')].reason",priority=1,description="Reason for the failure of reconcile condition" // +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Reconciled')].message",priority=1,description="Failure message from reconcile condition" // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",priority=0,description="Age of the resource" -//+operator-sdk:csv:customresourcedefinitions:displayName="RuntimeComponent",resources={{Deployment,v1},{Service,v1},{StatefulSet,v1},{Route,v1},{HorizontalPodAutoscaler,v1},{ServiceAccount,v1},{Secret,v1}} +// +operator-sdk:csv:customresourcedefinitions:displayName="RuntimeComponent",resources={{Deployment,v1},{Service,v1},{StatefulSet,v1},{Route,v1},{HorizontalPodAutoscaler,v1},{ServiceAccount,v1},{Secret,v1}} // Represents the deployment of a runtime component type RuntimeComponent struct { @@ -432,6 +432,21 @@ func (p *RuntimeComponentProbes) GetStartupProbe() *corev1.Probe { return p.Startup } +// GetDefaultLivenessProbe returns default values for liveness probe +func (p *RuntimeComponentProbes) GetDefaultLivenessProbe(ba common.BaseComponent) *corev1.Probe { + return common.GetDefaultMicroProfileLivenessProbe(ba) +} + +// GetDefaultReadinessProbe returns default values for readiness probe +func (p *RuntimeComponentProbes) GetDefaultReadinessProbe(ba common.BaseComponent) *corev1.Probe { + return common.GetDefaultMicroProfileReadinessProbe(ba) +} + +// GetDefaultStartupProbe returns default values for startup probe +func (p *RuntimeComponentProbes) GetDefaultStartupProbe(ba common.BaseComponent) *corev1.Probe { + return common.GetDefaultMicroProfileStartupProbe(ba) +} + // GetVolumes returns volumes slice func (cr *RuntimeComponent) GetVolumes() []corev1.Volume { return cr.Spec.Volumes diff --git a/vendor/github.com/application-stacks/runtime-component-operator/api/v1beta2/zz_generated.deepcopy.go b/vendor/github.com/application-stacks/runtime-component-operator/api/v1beta2/zz_generated.deepcopy.go index 88c33de85..f5a8a8df6 100644 --- a/vendor/github.com/application-stacks/runtime-component-operator/api/v1beta2/zz_generated.deepcopy.go +++ b/vendor/github.com/application-stacks/runtime-component-operator/api/v1beta2/zz_generated.deepcopy.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated /* diff --git a/vendor/github.com/application-stacks/runtime-component-operator/common/common.go b/vendor/github.com/application-stacks/runtime-component-operator/common/common.go new file mode 100644 index 000000000..7571f7536 --- /dev/null +++ b/vendor/github.com/application-stacks/runtime-component-operator/common/common.go @@ -0,0 +1,53 @@ +package common + +import ( + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/util/intstr" +) + +// GetDefaultMicroProfileStartupProbe returns the default values for MicroProfile Health-based startup probe. +func GetDefaultMicroProfileStartupProbe(ba BaseComponent) *corev1.Probe { + return &corev1.Probe{ + Handler: corev1.Handler{ + HTTPGet: &corev1.HTTPGetAction{ + Path: "/health/started", + Port: intstr.FromInt(int(ba.GetService().GetPort())), + Scheme: "HTTPS", + }, + }, + } +} + +// GetDefaultMicroProfileReadinessProbe returns the default values for MicroProfile Health-based readiness probe. +func GetDefaultMicroProfileReadinessProbe(ba BaseComponent) *corev1.Probe { + return &corev1.Probe{ + Handler: corev1.Handler{ + HTTPGet: &corev1.HTTPGetAction{ + Path: "/health/ready", + Port: intstr.FromInt(int(ba.GetService().GetPort())), + Scheme: "HTTPS", + }, + }, + InitialDelaySeconds: 30, + PeriodSeconds: 10, + TimeoutSeconds: 3, + FailureThreshold: 3, + } +} + +// GetDefaultMicroProfileLivenessProbe returns the default values for MicroProfile Health-based liveness probe. +func GetDefaultMicroProfileLivenessProbe(ba BaseComponent) *corev1.Probe { + return &corev1.Probe{ + Handler: corev1.Handler{ + HTTPGet: &corev1.HTTPGetAction{ + Path: "/health/live", + Port: intstr.FromInt(int(ba.GetService().GetPort())), + Scheme: "HTTPS", + }, + }, + InitialDelaySeconds: 60, + PeriodSeconds: 10, + TimeoutSeconds: 3, + FailureThreshold: 3, + } +} diff --git a/vendor/github.com/application-stacks/runtime-component-operator/common/types.go b/vendor/github.com/application-stacks/runtime-component-operator/common/types.go index e8c25a1c2..c00b590d6 100644 --- a/vendor/github.com/application-stacks/runtime-component-operator/common/types.go +++ b/vendor/github.com/application-stacks/runtime-component-operator/common/types.go @@ -118,6 +118,10 @@ type BaseComponentProbes interface { GetLivenessProbe() *corev1.Probe GetReadinessProbe() *corev1.Probe GetStartupProbe() *corev1.Probe + + GetDefaultLivenessProbe(ba BaseComponent) *corev1.Probe + GetDefaultReadinessProbe(ba BaseComponent) *corev1.Probe + GetDefaultStartupProbe(ba BaseComponent) *corev1.Probe } // BaseComponent represents basic kubernetes application diff --git a/vendor/github.com/application-stacks/runtime-component-operator/utils/utils.go b/vendor/github.com/application-stacks/runtime-component-operator/utils/utils.go index 74cd74d02..7d0d25355 100644 --- a/vendor/github.com/application-stacks/runtime-component-operator/utils/utils.go +++ b/vendor/github.com/application-stacks/runtime-component-operator/utils/utils.go @@ -243,6 +243,58 @@ func CustomizeService(svc *corev1.Service, ba common.BaseComponent) { } } +func CustomizeProbes(container *corev1.Container, ba common.BaseComponent) { + probesConfig := ba.GetProbes() + + // Probes not defined -- reset all probesConfig to nil + if probesConfig == nil { + container.ReadinessProbe = nil + container.LivenessProbe = nil + container.StartupProbe = nil + return + } + + container.ReadinessProbe = customizeProbe(probesConfig.GetReadinessProbe(), probesConfig.GetDefaultReadinessProbe, ba) + container.LivenessProbe = customizeProbe(probesConfig.GetLivenessProbe(), probesConfig.GetDefaultLivenessProbe, ba) + container.StartupProbe = customizeProbe(probesConfig.GetStartupProbe(), probesConfig.GetDefaultStartupProbe, ba) +} + +func customizeProbe(config *corev1.Probe, defaultProbeCallback func(ba common.BaseComponent) *corev1.Probe, ba common.BaseComponent) *corev1.Probe { + // Probe not defined -- set probe to nil + if config == nil { + return nil + } + + // Probe handler is defined in config so use probe as is + if config.Handler != (corev1.Handler{}) { + return config + } + + // Probe handler is not defined so use default values for the probe if values not set in probe config + return customizeProbeDefaults(config, defaultProbeCallback(ba)) +} + +func customizeProbeDefaults(config *corev1.Probe, defaultProbe *corev1.Probe) *corev1.Probe { + probe := defaultProbe + if config.InitialDelaySeconds != 0 { + probe.InitialDelaySeconds = config.InitialDelaySeconds + } + if config.TimeoutSeconds != 0 { + probe.TimeoutSeconds = config.TimeoutSeconds + } + if config.PeriodSeconds != 0 { + probe.PeriodSeconds = config.PeriodSeconds + } + if config.SuccessThreshold != 0 { + probe.SuccessThreshold = config.SuccessThreshold + } + if config.FailureThreshold != 0 { + probe.FailureThreshold = config.FailureThreshold + } + + return probe +} + // CustomizeAffinity ... func CustomizeAffinity(affinity *corev1.Affinity, ba common.BaseComponent) { @@ -388,15 +440,7 @@ func CustomizePodSpec(pts *corev1.PodTemplateSpec, ba common.BaseComponent) { appContainer.Resources = *ba.GetResourceConstraints() } - if ba.GetProbes() != nil { - appContainer.ReadinessProbe = ba.GetProbes().GetReadinessProbe() - appContainer.LivenessProbe = ba.GetProbes().GetLivenessProbe() - appContainer.StartupProbe = ba.GetProbes().GetStartupProbe() - } else { - appContainer.ReadinessProbe = nil - appContainer.LivenessProbe = nil - appContainer.StartupProbe = nil - } + CustomizeProbes(&appContainer, ba) if ba.GetPullPolicy() != nil { appContainer.ImagePullPolicy = *ba.GetPullPolicy() @@ -554,17 +598,9 @@ func CustomizeKnativeService(ksvc *servingv1.Service, ba common.BaseComponent) { ksvc.Spec.Template.Spec.Containers[0].Image = ba.GetStatus().GetImageReference() // Knative sets its own resource constraints - //ksvc.Spec.Template.Spec.Containers[0].Resources = *cr.Spec.ResourceConstraints + // ksvc.Spec.Template.Spec.Containers[0].Resources = *cr.Spec.ResourceConstraints - if ba.GetProbes() != nil { - ksvc.Spec.Template.Spec.Containers[0].ReadinessProbe = ba.GetProbes().GetReadinessProbe() - ksvc.Spec.Template.Spec.Containers[0].LivenessProbe = ba.GetProbes().GetLivenessProbe() - ksvc.Spec.Template.Spec.Containers[0].StartupProbe = ba.GetProbes().GetStartupProbe() - } else { - ksvc.Spec.Template.Spec.Containers[0].ReadinessProbe = nil - ksvc.Spec.Template.Spec.Containers[0].LivenessProbe = nil - ksvc.Spec.Template.Spec.Containers[0].StartupProbe = nil - } + CustomizeProbes(&ksvc.Spec.Template.Spec.Containers[0], ba) ksvc.Spec.Template.Spec.Containers[0].ImagePullPolicy = *ba.GetPullPolicy() ksvc.Spec.Template.Spec.Containers[0].Env = ba.GetEnv() diff --git a/vendor/modules.txt b/vendor/modules.txt index 4edb0e4a7..1258e9d5a 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,6 +1,6 @@ # cloud.google.com/go v0.65.0 cloud.google.com/go/compute/metadata -# github.com/application-stacks/runtime-component-operator v0.8.1-0.20220405182540-00ecc1f1f51d +# github.com/application-stacks/runtime-component-operator v0.8.1-0.20220406013638-131565c1b2b8 ## explicit github.com/application-stacks/runtime-component-operator/api/v1beta2 github.com/application-stacks/runtime-component-operator/common