Returning status.Error instead of just error simplifies usage of the
return value, which is usually appended to a MultiError or returned
directly to state.invalidate(err). The caller doesn't need to append,
if there's no other error that needs to be reported to the RSync status.
This change also fixes SetImageToSyncAnnotation to return APIServer
errors, instead of wrapping all errors as Source errors. This is
better because most error types from client.Patch are APIServer errors,
and we have no explicit interface contract to detect OCI image
signature validation errors from a webhook.
Needs approval from an approver in each of these files:
- ~~[OWNERS](https://github.com/GoogleContainerTools/kpt-config-sync/blob/main/OWNERS)~~ [nan-yu]
Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
Returning status.Error instead of just error simplifies usage of the return value, which is usually appended to a MultiError or returned directly to state.invalidate(err). The caller doesn't need to append, if there's no other error that needs to be reported to the RSync status.
This change also fixes SetImageToSyncAnnotation to return APIServer errors, instead of wrapping all errors as Source errors. This is better because most error types from client.Patch are APIServer errors, and we have no explicit interface contract to detect OCI image signature validation errors from a webhook.