diff --git a/apiserver/pkg/model/converter.go b/apiserver/pkg/model/converter.go index 67aae876a8..8e6a529868 100755 --- a/apiserver/pkg/model/converter.go +++ b/apiserver/pkg/model/converter.go @@ -192,8 +192,8 @@ func PopulateWorkerNodeSpec(specs []rayv1api.WorkerGroupSpec) []*api.WorkerGroup for _, spec := range specs { workerNodeSpec := &api.WorkerGroupSpec{ RayStartParams: spec.RayStartParams, - MaxReplicas: *spec.MinReplicas, - MinReplicas: *spec.MaxReplicas, + MaxReplicas: *spec.MaxReplicas, + MinReplicas: *spec.MinReplicas, Replicas: *spec.Replicas, GroupName: spec.GroupName, Image: spec.Template.Annotations[util.RayClusterImageAnnotationKey], diff --git a/apiserver/pkg/model/converter_test.go b/apiserver/pkg/model/converter_test.go index bda0d2ea3a..52c70059f5 100644 --- a/apiserver/pkg/model/converter_test.go +++ b/apiserver/pkg/model/converter_test.go @@ -19,6 +19,8 @@ var ( deploymentReplicas int32 = 1 headNodeReplicas int32 = 1 workerReplicas int32 = 5 + workerMinReplicas int32 = 1 + workerMaxReplicas int32 = 3 unhealthySecondThreshold int32 = 900 floatNumber float64 = 1 secondsValue int32 = 100 @@ -148,8 +150,8 @@ var configMapWithTolerations = v1.ConfigMap{ var workerSpecTest = rayv1api.WorkerGroupSpec{ GroupName: "", Replicas: &workerReplicas, - MinReplicas: &workerReplicas, - MaxReplicas: &workerReplicas, + MinReplicas: &workerMinReplicas, + MaxReplicas: &workerMaxReplicas, RayStartParams: map[string]string{ "node-ip-address": "$MY_POD_IP", },