From e60f4c07f341a85e0b1cd42e2c76f33f9bc2d20c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 20 Feb 2024 19:31:43 +0800 Subject: [PATCH] fix cache manager panic in yurthub (#1951) (cherry picked from commit 3de0034fe2a120a6b1fa43148ecc45faf05015bb) Co-authored-by: rambohe-ch --- pkg/yurthub/filter/approver.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/yurthub/filter/approver.go b/pkg/yurthub/filter/approver.go index a48e017e2ad..a4dac40522a 100644 --- a/pkg/yurthub/filter/approver.go +++ b/pkg/yurthub/filter/approver.go @@ -128,11 +128,13 @@ func (a *approver) updateConfigMap(oldObj, newObj interface{}) { if !ok { return } + oldCM = oldCM.DeepCopy() newCM, ok := newObj.(*corev1.ConfigMap) if !ok { return } + newCM = newCM.DeepCopy() // request settings are changed or not needUpdated := a.requestSettingsUpdated(oldCM.Data, newCM.Data)