feat(validation): add empty probe lists validation

This commit is contained in:
Piotr Icikowski 2024-03-02 15:52:01 +01:00 committed by Piotr Icikowski
parent ea92b2979c
commit 82b6034625

View File

@ -56,6 +56,14 @@ func (kp *kubeprobes) validate() error {
err = errors.Join(err, fmt.Errorf("liveness and readiness probes have the same values (both %q)", kp.pathLive))
}
if len(kp.livenessProbes) == 0 {
err = errors.Join(err, fmt.Errorf("no liveness probes defined"))
}
if len(kp.readinessProbes) == 0 {
err = errors.Join(err, fmt.Errorf("no readiness probes defined"))
}
return err
}