From e1b93f2cfb71f29ddd88d503b915ea5b0fd503c2 Mon Sep 17 00:00:00 2001 From: "chentao.cht" Date: Wed, 16 Aug 2023 12:58:28 +0800 Subject: [PATCH] fix(scheduler): unable to get current replicas from federatedObject correctly --- pkg/controllers/scheduler/schedulingunit.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/controllers/scheduler/schedulingunit.go b/pkg/controllers/scheduler/schedulingunit.go index ba4b44d6..c05dfc59 100644 --- a/pkg/controllers/scheduler/schedulingunit.go +++ b/pkg/controllers/scheduler/schedulingunit.go @@ -176,8 +176,8 @@ func getCurrentReplicasFromObject( } for _, patch := range override.Patches { - if patch.Op == replicasPath && (patch.Op == overridePatchOpReplace || patch.Op == "") { - var replicas *int64 + if patch.Path == replicasPath && (patch.Op == overridePatchOpReplace || patch.Op == "") { + replicas := new(int64) if err := json.Unmarshal(patch.Value.Raw, replicas); err != nil { continue }