Skip to content

Commit 774b917

Browse files
authored
fix: when rayJobInstance.Spec.RayClusterSpec is nil, kuberay operator crash (#4102)
Signed-off-by: KunWuLuan <kunwuluan@gmail.com>
1 parent 9bd753c commit 774b917

File tree

1 file changed

+1
-1
lines changed
  • ray-operator/controllers/ray/common

1 file changed

+1
-1
lines changed

ray-operator/controllers/ray/common/job.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ func BuildJobSubmitCommand(rayJobInstance *rayv1.RayJob, submissionMode rayv1.Jo
164164
cmd = append(cmd, "--runtime-env-json", strconv.Quote(runtimeEnvJson))
165165
}
166166

167-
if len(metadata) > 0 {
167+
if len(metadata) > 0 && rayJobInstance.Spec.RayClusterSpec != nil {
168168
metadataJson, err := GetMetadataJson(metadata, rayJobInstance.Spec.RayClusterSpec.RayVersion)
169169
if err != nil {
170170
return nil, err

0 commit comments

Comments
 (0)