From 4d2bfbbfc3fed37098e6b203d1b77f910785f731 Mon Sep 17 00:00:00 2001 From: Vivek Koppuru Date: Thu, 8 Dec 2022 01:07:00 +0000 Subject: [PATCH] Bug fix for clusterresourceset apply --- exp/addons/internal/controllers/clusterresourceset_scope.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/exp/addons/internal/controllers/clusterresourceset_scope.go b/exp/addons/internal/controllers/clusterresourceset_scope.go index 3cf15d1516c8..6488311c93de 100644 --- a/exp/addons/internal/controllers/clusterresourceset_scope.go +++ b/exp/addons/internal/controllers/clusterresourceset_scope.go @@ -142,6 +142,8 @@ func (r *reconcileStrategyScope) apply(ctx context.Context, c client.Client, obj } patch := client.MergeFrom(currentObj.DeepCopy()) + // metadata.ResourceVersion needs to be set to avoid webhook errors in applying + obj.SetResourceVersion(currentObj.GetResourceVersion()) if err = c.Patch(ctx, obj, patch); err != nil { return errors.Wrapf( err,