@@ -234,7 +234,9 @@ func containersValidation(kind userconfig.Kind) *cr.StructFieldValidation {
234234 probeValidation ("LivenessProbe" , true ),
235235 }
236236
237- if kind != userconfig .TaskAPIKind {
237+ if kind == userconfig .RealtimeAPIKind {
238+ validations = append (validations , probeValidation ("ReadinessProbe" , true ))
239+ } else if kind == userconfig .AsyncAPIKind || kind == userconfig .BatchAPIKind {
238240 validations = append (validations , probeValidation ("ReadinessProbe" , false ))
239241 }
240242
@@ -760,13 +762,14 @@ func validateContainers(
760762 }
761763
762764 if container .ReadinessProbe != nil {
763- if err := validateProbe (* container .ReadinessProbe , true ); err != nil {
765+ supportsExecProbe := kind == userconfig .RealtimeAPIKind
766+ if err := validateProbe (* container .ReadinessProbe , supportsExecProbe ); err != nil {
764767 return errors .Wrap (err , s .Index (i ), userconfig .ReadinessProbeKey )
765768 }
766769 }
767770
768771 if container .LivenessProbe != nil {
769- if err := validateProbe (* container .LivenessProbe , false ); err != nil {
772+ if err := validateProbe (* container .LivenessProbe , true ); err != nil {
770773 return errors .Wrap (err , s .Index (i ), userconfig .LivenessProbeKey )
771774 }
772775 }
@@ -776,7 +779,7 @@ func validateContainers(
776779 return nil
777780}
778781
779- func validateProbe (probe userconfig.Probe , isReadinessProbe bool ) error {
782+ func validateProbe (probe userconfig.Probe , supportsExecProbe bool ) error {
780783 numSpecifiedProbes := 0
781784 if probe .HTTPGet != nil {
782785 numSpecifiedProbes ++
@@ -790,7 +793,7 @@ func validateProbe(probe userconfig.Probe, isReadinessProbe bool) error {
790793
791794 if numSpecifiedProbes != 1 {
792795 validProbes := []string {userconfig .HTTPGetKey , userconfig .TCPSocketKey }
793- if ! isReadinessProbe {
796+ if supportsExecProbe {
794797 validProbes = append (validProbes , userconfig .ExecKey )
795798 }
796799 return ErrorSpecifyExactlyOneField (numSpecifiedProbes , validProbes ... )
0 commit comments