Skip to content

Commit

Permalink
Patch the correct observed state after a rm.ReadOne call
Browse files Browse the repository at this point in the history
`resourceManager.ReadOne` is not returning the correct observed state
when `sdkFind` returns with an error. Which is causing the reconciler
to patch to wrong state (`desird` instead `observed`). This patch fixes
this issue by passing the correct observed state to `onError`.
  • Loading branch information
a-hilaly committed Jun 2, 2021
1 parent e625f74 commit d182f73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion templates/pkg/resource/manager.go.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (rm *resourceManager) ReadOne(
}
observed, err := rm.sdkFind(ctx, r)
if err != nil {
return rm.onError(r, err)
return rm.onError(observed, err)
}
return rm.onSuccess(observed)
}
Expand Down

0 comments on commit d182f73

Please sign in to comment.