From 5c9db54decbcc4c1627a029ef2e72e1f918bd109 Mon Sep 17 00:00:00 2001 From: ted chang Date: Mon, 13 Nov 2023 15:01:37 -0800 Subject: [PATCH] Flip Min and max replicas for apiserver workerNodeSpec (#1638) --- apiserver/pkg/model/converter.go | 4 ++-- apiserver/pkg/model/converter_test.go | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) 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", },