Skip to content

Commit ecd9a4a

Browse files
authored
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 <[email protected]>
1 parent 3986790 commit ecd9a4a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

conditions/conditions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func (c *condition) Set(ctx context.Context, status metav1.ConditionStatus, opti
9898
}
9999
}
100100
meta.SetStatusCondition(&operatorCond.Spec.Conditions, *newCond)
101-
err = c.client.Status().Update(ctx, operatorCond)
101+
err = c.client.Update(ctx, operatorCond)
102102
if err != nil {
103103
return err
104104
}

0 commit comments

Comments
 (0)