Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend the Probe interface to support optional path, port and scheme properties #648

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions api/v1/webspherelibertyapplication_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,15 +254,15 @@ type WebSphereLibertyApplicationServiceAccount struct {
type WebSphereLibertyApplicationProbes struct {
// Periodic probe of container liveness. Container will be restarted if the probe fails.
// +operator-sdk:csv:customresourcedefinitions:order=49,type=spec,displayName="Liveness Probe"
Liveness *corev1.Probe `json:"liveness,omitempty"`
Liveness *common.BaseComponentProbe `json:"liveness,omitempty"`

// Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails.
// +operator-sdk:csv:customresourcedefinitions:order=50,type=spec,displayName="Readiness Probe"
Readiness *corev1.Probe `json:"readiness,omitempty"`
Readiness *common.BaseComponentProbe `json:"readiness,omitempty"`

// Probe to determine successful initialization. If specified, other probes are not executed until this completes successfully.
// +operator-sdk:csv:customresourcedefinitions:order=51,type=spec,displayName="Startup Probe"
Startup *corev1.Probe `json:"startup,omitempty"`
Startup *common.BaseComponentProbe `json:"startup,omitempty"`
}

// Configure pods to run on particular Nodes.
Expand Down Expand Up @@ -776,32 +776,32 @@ func (cr *WebSphereLibertyApplication) GetProbes() common.BaseComponentProbes {
}

// GetLivenessProbe returns liveness probe
func (p *WebSphereLibertyApplicationProbes) GetLivenessProbe() *corev1.Probe {
func (p *WebSphereLibertyApplicationProbes) GetLivenessProbe() *common.BaseComponentProbe {
return p.Liveness
}

// GetReadinessProbe returns readiness probe
func (p *WebSphereLibertyApplicationProbes) GetReadinessProbe() *corev1.Probe {
func (p *WebSphereLibertyApplicationProbes) GetReadinessProbe() *common.BaseComponentProbe {
return p.Readiness
}

// GetStartupProbe returns startup probe
func (p *WebSphereLibertyApplicationProbes) GetStartupProbe() *corev1.Probe {
func (p *WebSphereLibertyApplicationProbes) GetStartupProbe() *common.BaseComponentProbe {
return p.Startup
}

// GetDefaultLivenessProbe returns default values for liveness probe
func (p *WebSphereLibertyApplicationProbes) GetDefaultLivenessProbe(ba common.BaseComponent) *corev1.Probe {
func (p *WebSphereLibertyApplicationProbes) GetDefaultLivenessProbe(ba common.BaseComponent) *common.BaseComponentProbe {
return common.GetDefaultMicroProfileLivenessProbe(ba)
}

// GetDefaultReadinessProbe returns default values for readiness probe
func (p *WebSphereLibertyApplicationProbes) GetDefaultReadinessProbe(ba common.BaseComponent) *corev1.Probe {
func (p *WebSphereLibertyApplicationProbes) GetDefaultReadinessProbe(ba common.BaseComponent) *common.BaseComponentProbe {
return common.GetDefaultMicroProfileReadinessProbe(ba)
}

// GetDefaultStartupProbe returns default values for startup probe
func (p *WebSphereLibertyApplicationProbes) GetDefaultStartupProbe(ba common.BaseComponent) *corev1.Probe {
func (p *WebSphereLibertyApplicationProbes) GetDefaultStartupProbe(ba common.BaseComponent) *common.BaseComponentProbe {
return common.GetDefaultMicroProfileStartupProbe(ba)
}

Expand Down
6 changes: 3 additions & 3 deletions api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ metadata:
capabilities: Auto Pilot
categories: Application Runtime
containerImage: icr.io/cpopen/websphere-liberty-operator:daily
createdAt: "2024-05-15T18:51:13Z"
createdAt: "2024-05-16T12:09:32Z"
description: Deploy and manage containerized Liberty applications
olm.skipRange: '>=1.0.0 <1.3.2'
operators.openshift.io/infrastructure-features: '["disconnected"]'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3194,8 +3194,6 @@ spec:
description: Scheme to use for connecting to the host.
Defaults to HTTP.
type: string
required:
- port
type: object
initialDelaySeconds:
description: 'Number of seconds after the container has started
Expand Down Expand Up @@ -3345,8 +3343,6 @@ spec:
description: Scheme to use for connecting to the host.
Defaults to HTTP.
type: string
required:
- port
type: object
initialDelaySeconds:
description: 'Number of seconds after the container has started
Expand Down Expand Up @@ -3497,8 +3493,6 @@ spec:
description: Scheme to use for connecting to the host.
Defaults to HTTP.
type: string
required:
- port
type: object
initialDelaySeconds:
description: 'Number of seconds after the container has started
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3190,8 +3190,6 @@ spec:
description: Scheme to use for connecting to the host.
Defaults to HTTP.
type: string
required:
- port
type: object
initialDelaySeconds:
description: 'Number of seconds after the container has started
Expand Down Expand Up @@ -3341,8 +3339,6 @@ spec:
description: Scheme to use for connecting to the host.
Defaults to HTTP.
type: string
required:
- port
type: object
initialDelaySeconds:
description: 'Number of seconds after the container has started
Expand Down Expand Up @@ -3493,8 +3489,6 @@ spec:
description: Scheme to use for connecting to the host.
Defaults to HTTP.
type: string
required:
- port
type: object
initialDelaySeconds:
description: 'Number of seconds after the container has started
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/WASdev/websphere-liberty-operator
go 1.21

require (
github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20240501200723-fc6ae9079c88
github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20240516142046-336488006a05
github.com/cert-manager/cert-manager v1.11.5
github.com/go-logr/logr v1.2.4
github.com/openshift/api v0.0.0-20230928134114-673ed0cfc7f1
Expand Down
8 changes: 8 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk5
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20240501200723-fc6ae9079c88 h1:v+D27NsIOia3fLxx9Z8n0WEvHJZsASrnsygOUT60z9g=
github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20240501200723-fc6ae9079c88/go.mod h1:QI32wLzUBxvvisPG+p1XeogxeUhk64Vc/U0lx7rxx5M=
github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20240510131031-d7ca862afa46 h1:3qrdycEhTI1oU3xYyG7BThe9c3FPr79k6DgpmeaZkaw=
github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20240510131031-d7ca862afa46/go.mod h1:SCojMAukVov6aOA8VEjpr0nLcheOrtoAVUGRvLT9qyI=
github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20240514135533-812d07575e8c h1:XSLTxOd3Y76jE8bXMb/sIX6LEyH4MbsrKug/diVh7Wg=
github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20240514135533-812d07575e8c/go.mod h1:SCojMAukVov6aOA8VEjpr0nLcheOrtoAVUGRvLT9qyI=
github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20240515205711-ea15efc009bc h1:ZO6TmqetJSRPah1luUsyG9On5N9XRm3/IBKsbsLLOwM=
github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20240515205711-ea15efc009bc/go.mod h1:SCojMAukVov6aOA8VEjpr0nLcheOrtoAVUGRvLT9qyI=
github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20240516142046-336488006a05 h1:FPa3upDX4TvTDgRF+NXoUMhPsFb7YVhvld/pUN7r23A=
github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20240516142046-336488006a05/go.mod h1:SCojMAukVov6aOA8VEjpr0nLcheOrtoAVUGRvLT9qyI=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
Expand Down
6 changes: 0 additions & 6 deletions internal/deploy/kubectl/websphereliberty-app-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3193,8 +3193,6 @@ spec:
description: Scheme to use for connecting to the host.
Defaults to HTTP.
type: string
required:
- port
type: object
initialDelaySeconds:
description: 'Number of seconds after the container has started
Expand Down Expand Up @@ -3344,8 +3342,6 @@ spec:
description: Scheme to use for connecting to the host.
Defaults to HTTP.
type: string
required:
- port
type: object
initialDelaySeconds:
description: 'Number of seconds after the container has started
Expand Down Expand Up @@ -3496,8 +3492,6 @@ spec:
description: Scheme to use for connecting to the host.
Defaults to HTTP.
type: string
required:
- port
type: object
initialDelaySeconds:
description: 'Number of seconds after the container has started
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3193,8 +3193,6 @@ spec:
description: Scheme to use for connecting to the host.
Defaults to HTTP.
type: string
required:
- port
type: object
initialDelaySeconds:
description: 'Number of seconds after the container has started
Expand Down Expand Up @@ -3344,8 +3342,6 @@ spec:
description: Scheme to use for connecting to the host.
Defaults to HTTP.
type: string
required:
- port
type: object
initialDelaySeconds:
description: 'Number of seconds after the container has started
Expand Down Expand Up @@ -3496,8 +3492,6 @@ spec:
description: Scheme to use for connecting to the host.
Defaults to HTTP.
type: string
required:
- port
type: object
initialDelaySeconds:
description: 'Number of seconds after the container has started
Expand Down