@@ -28,6 +28,8 @@ import (
2828
2929 "math/rand/v2"
3030
31+ "github.com/application-stacks/runtime-component-operator/common"
32+
3133 wlv1 "github.com/WASdev/websphere-liberty-operator/api/v1"
3234 rcoutils "github.com/application-stacks/runtime-component-operator/utils"
3335 routev1 "github.com/openshift/api/route/v1"
@@ -1153,7 +1155,7 @@ func patchFileBasedProbe(defaultProbe *corev1.Probe, instanceProbe *corev1.Probe
11531155 defaultProbe = getOrInitProbe (defaultProbe )
11541156 instanceProbe = getOrInitProbe (instanceProbe )
11551157 isExecConfigured := instanceProbe .Exec != nil // this flag allows the user to override the ExecAction object to bring their own custom file-based health check
1156- instanceProbe = rcoutils .CustomizeProbeDefaults (instanceProbe , defaultProbe )
1158+ instanceProbe = common .CustomizeProbeDefaults (instanceProbe , defaultProbe )
11571159 if ! isExecConfigured {
11581160 configureFileBasedProbeExec (instanceProbe , scriptName , probeFile )
11591161 }
@@ -1186,14 +1188,15 @@ func customizeFileBasedProbes(appContainer *corev1.Container, instance *wlv1.Web
11861188 if appContainer == nil {
11871189 return
11881190 }
1189- if instance .Spec .Probes .WebSphereLibertyApplicationProbes .Startup != nil {
1190- appContainer .StartupProbe = patchFileBasedProbe (instance .Spec .Probes .WebSphereLibertyApplicationProbes .GetDefaultStartupProbe (instance ), instance .Spec .Probes .Startup , StartupProbeFileBasedScriptName , StartupProbeFileName )
1191+ probes := instance .Spec .Probes .WebSphereLibertyApplicationProbes
1192+ if probes .Startup != nil {
1193+ appContainer .StartupProbe = patchFileBasedProbe (probes .GetDefaultStartupProbe (instance ), probes .GetStartupProbe (), StartupProbeFileBasedScriptName , StartupProbeFileName )
11911194 }
1192- if instance . Spec . Probes . WebSphereLibertyApplicationProbes .Liveness != nil {
1193- appContainer .LivenessProbe = patchFileBasedProbe (instance . Spec . Probes . WebSphereLibertyApplicationProbes . GetDefaultLivenessProbe (instance ), instance . Spec . Probes . Liveness , LivenessProbeFileBasedScriptName , LivenessProbeFileName )
1195+ if probes .Liveness != nil {
1196+ appContainer .LivenessProbe = patchFileBasedProbe (probes . GetDefaultLivenessProbe (instance ), probes . GetLivenessProbe () , LivenessProbeFileBasedScriptName , LivenessProbeFileName )
11941197 }
1195- if instance . Spec . Probes . WebSphereLibertyApplicationProbes .Readiness != nil {
1196- appContainer .ReadinessProbe = patchFileBasedProbe (instance . Spec . Probes . WebSphereLibertyApplicationProbes . GetDefaultReadinessProbe (instance ), instance . Spec . Probes . Readiness , ReadinessProbeFileBasedScriptName , ReadinessProbeFileName )
1198+ if probes .Readiness != nil {
1199+ appContainer .ReadinessProbe = patchFileBasedProbe (probes . GetDefaultReadinessProbe (instance ), probes . GetReadinessProbe () , ReadinessProbeFileBasedScriptName , ReadinessProbeFileName )
11971200 }
11981201}
11991202
0 commit comments