From f5c5dea82d5f1d2e7a7dbe8f24ac815484d6ed35 Mon Sep 17 00:00:00 2001 From: fighterhit Date: Thu, 21 Jul 2022 20:55:18 +0800 Subject: [PATCH] fix: fix wrong parameter for resolveControllerRef (#1583) --- pkg/common/util/reconciler.go | 2 +- pkg/common/util/reconciler_generic.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/common/util/reconciler.go b/pkg/common/util/reconciler.go index cae8b19ec0..880437bfac 100644 --- a/pkg/common/util/reconciler.go +++ b/pkg/common/util/reconciler.go @@ -98,7 +98,7 @@ func OnDependentUpdateFunc(jc *common.JobController) func(updateEvent event.Upda if controllerRefChanged && oldControllerRef != nil { // The ControllerRef was changed. Sync the old controller, if any. - if job := resolveControllerRef(jc, oldObj.GetName(), oldControllerRef); job != nil { + if job := resolveControllerRef(jc, oldObj.GetNamespace(), oldControllerRef); job != nil { logger.Infof("pod/service controller ref updated: %v, %v", newObj, oldObj) return true } diff --git a/pkg/common/util/reconciler_generic.go b/pkg/common/util/reconciler_generic.go index b32f0b7e24..64be5c42d3 100644 --- a/pkg/common/util/reconciler_generic.go +++ b/pkg/common/util/reconciler_generic.go @@ -91,7 +91,7 @@ func OnDependentUpdateFuncGeneric(jc *common.JobController) func(updateEvent eve if controllerRefChanged && oldControllerRef != nil { // The ControllerRef was changed. Sync the old controller, if any. - if job := resolveControllerRef(jc, oldObj.GetName(), oldControllerRef); job != nil { + if job := resolveControllerRef(jc, oldObj.GetNamespace(), oldControllerRef); job != nil { logger.Infof("%s controller ref updated: %v, %v", kind, newObj, oldObj) return true }