-
Notifications
You must be signed in to change notification settings - Fork 712
Move to Patch API on infra-client #2995
Description
Description:
Follow up from #2807, which is still happening in the latest version (v1.0.0). I noticed this behavior because the EG is utilizing the Update API instead of the Patch API in infra-client.
gateway/internal/infrastructure/kubernetes/infra_client.go
Lines 40 to 45 in c655811
| if updateChecker() { | |
| specific.SetUID(current.GetUID()) | |
| if err := cli.Client.Update(ctx, specific); err != nil { | |
| return fmt.Errorf("for Update: %w", err) | |
| } | |
| } |
As a result, instead of only updating the changed field, it turned out to re-applies all fields causing the field to revert to its original value, instead of updating what changed. For example on the Deployment object, if the replicas field is set to null, it will be reverted to null.
So, I tried in my local to use Patch API, and it worked as expected.
[optional Relevant Links:]
Any extra documentation required to understand the issue.