From ecd9a4ac89111f2e1a470d113ca8def02caf33cd Mon Sep 17 00:00:00 2001 From: Nahshon Unna Tsameret <60659093+nunnatsa@users.noreply.github.com> Date: Wed, 28 Jul 2021 20:30:45 +0300 Subject: [PATCH] Fix permission issue when settin the operator-condition (#70) The conditions moved from the `Status` field to the `Spec`, but when setting the condition, the code still uses `client.Status().Update()` to set the condition, instead of just `client.Update()`. This is wrong in two ways: first, the code is trying to update the spec, so it will fail, and also, the operator does not have permissions to update the status. As result, the `Set` function always returns error. This PR changes the client call to use the regular client instead of the status client. Signed-off-by: Nahshon Unna-Tsameret --- conditions/conditions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conditions/conditions.go b/conditions/conditions.go index 4990447..645065e 100644 --- a/conditions/conditions.go +++ b/conditions/conditions.go @@ -98,7 +98,7 @@ func (c *condition) Set(ctx context.Context, status metav1.ConditionStatus, opti } } meta.SetStatusCondition(&operatorCond.Spec.Conditions, *newCond) - err = c.client.Status().Update(ctx, operatorCond) + err = c.client.Update(ctx, operatorCond) if err != nil { return err }