From c0d8b51600b30a25452ad34ecef11aba780f3b81 Mon Sep 17 00:00:00 2001 From: A386official Date: Sat, 28 Feb 2026 09:34:07 +0000 Subject: [PATCH] fix(api): nil pointer panic in readiness probe port fallback When a container has only a readiness probe (no liveness probe), the readiness probe handler incorrectly referenced `livenessProbe.HTTPGet` instead of `readinessProbe.HTTPGet` for the named-port fallback lookup. Since livenessProbe is nil in the else branch, this causes a nil pointer dereference panic when parsing Helm charts without liveness probe config. Fixes goodrain/rainbond#2512 Signed-off-by: A386official --- api/handler/resource_public_function.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/handler/resource_public_function.go b/api/handler/resource_public_function.go index 2e353b7df2..f59b751f2e 100644 --- a/api/handler/resource_public_function.go +++ b/api/handler/resource_public_function.go @@ -329,7 +329,7 @@ func PodTemplateSpecResource(parameter model.YamlResourceParameter, volumeClaimT hcm.Path = readinessProbe.HTTPGet.Path hcm.Port = int(readinessProbe.HTTPGet.Port.IntVal) if hcm.Port == 0 { - hcm.Port = int(NameAndPort[livenessProbe.HTTPGet.Port.StrVal]) + hcm.Port = int(NameAndPort[readinessProbe.HTTPGet.Port.StrVal]) } if hcm.Port == 0 { hcm.Port = int(po)