From 0d9a75284cbcae627d8010def93fb1a05bab01a7 Mon Sep 17 00:00:00 2001 From: Sidharth Menon Date: Fri, 20 Dec 2024 03:07:44 +0000 Subject: [PATCH] move comment --- pkg/kube/client.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/kube/client.go b/pkg/kube/client.go index fdd0b1a2c..0b723c33b 100644 --- a/pkg/kube/client.go +++ b/pkg/kube/client.go @@ -433,10 +433,6 @@ func (c *Client) Update(original, target ResourceList, force bool) (*Result, err c.Log("error applying the resource %q:\n\t %v", info.Name, err) updateErrors = append(updateErrors, err.Error()) } - - // afterwards, we will reconcile managed fields on these objects and re-apply if necessary. - // the reason we do this is to avoid 3 network requests in the "happy/normal" case with SSA. - // we want to first (1) apply, (2) try to check if a migration is needed, and (3) run the migration if we must. return nil }) @@ -631,6 +627,9 @@ func (c *Client) applyResource(target *resource.Info, force bool) error { } target.Refresh(obj, true) + // afterwards, we will reconcile managed fields on these objects and re-apply if necessary. + // the reason we do this is to avoid 3 network requests in the "happy/normal" case with SSA. + // we want to first (1) apply, (2) try to check if a migration is needed, and (3) run the migration if we must. // now, we will try to migrate managed fields of the object, if necessary. didMigrate, err := migrateManagedFields( helper,