From c818941d8e545586cafc6a84240e6de305525324 Mon Sep 17 00:00:00 2001 From: Eugene Babichev Date: Mon, 16 Sep 2024 21:30:24 +1000 Subject: [PATCH] Do not update cache if already found --- pkg/controllers/nodeclaim/lifecycle/registration.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/controllers/nodeclaim/lifecycle/registration.go b/pkg/controllers/nodeclaim/lifecycle/registration.go index 0089b531a1..dc2aed2f57 100644 --- a/pkg/controllers/nodeclaim/lifecycle/registration.go +++ b/pkg/controllers/nodeclaim/lifecycle/registration.go @@ -96,8 +96,8 @@ func (r *Registration) syncNode(ctx context.Context, nodeClaim *v1.NodeClaim, no nodeClaim.Labels[v1.NodePoolLabelKey], nodeClaim.Labels[corev1.LabelInstanceTypeStable], ) - cacheValue, found := r.cache.Get(cacheMapKey) - if !found || !equality.Semantic.DeepEqual(cacheValue.(corev1.ResourceList), nodeClaim.Status.Allocatable) { + _, found := r.cache.Get(cacheMapKey) + if !found { log.FromContext(ctx).WithValues("NodePool", nodeClaim.Labels[v1.NodePoolLabelKey]).Info(fmt.Sprintf("Updating allocatable cache for %s", nodeClaim.Labels[corev1.LabelInstanceTypeStable])) r.cache.Set(cacheMapKey, stored.Status.Allocatable, cache.DefaultExpiration) }