runbundle: refactor printing deployment/pod errors#3908
runbundle: refactor printing deployment/pod errors#3908varshaprasad96 merged 8 commits intooperator-framework:masterfrom
Conversation
5909f5e to
8e004b2
Compare
In light of eric's comments, I'm rescinding my lgtm
|
@bharathi-tenneti I honestly prefer the original implementation of this PR: d987f78 I think we should go back to that. I see @estroz point in that Result is meant for the validation and not meant to be a general error framework. @camilamacedo86 point is valid which is why we could make |
| return err | ||
| if s.Type == appsv1.DeploymentAvailable && s.Status != corev1.ConditionTrue { | ||
| podError := c.checkPodErrors(ctx, depSelectors, key) | ||
| if podError.Error() == "" { |
There was a problem hiding this comment.
| if podError.Error() == "" { | |
| if podError == nil { |
| name: ds.Name, | ||
| issue: s.Reason, | ||
| }) | ||
| return depErr |
There was a problem hiding this comment.
Other deployments may have errors
| return depErr | |
| break |
| name: ds.Name, | ||
| issue: podError.Error(), | ||
| }) | ||
| return depErr |
There was a problem hiding this comment.
Other deployments may have errors
| return depErr | |
| break |
|
Hii @estroz, WDYT about merge this one and we working on in the fix/improvements in a follow-up. Do you see something that is a blocker to get it merged? |
|
@camilamacedo86 : Have taken this up from Bharathi. I can make the suggested changes and push it to this PR. |
|
Have addressed review comments |
…k#3908) * refactor printDeployment and printPodError funcs * Addressing PR comments * fix sanity error * Reverting a2ed4 and 8e004 * Reverting a2ed4 and 8e004 * Addressing PR comments * Added podError struct, and other PR comments * Address review comments Co-authored-by: varshaprasad96 <varshaprasad96@gmail.com>
Description:
Refactor the existing
printDeploymentErrorsandprintPodErrors()functions fromclient.goto collect and return errors in a struct/map.https://github.com/operator-framework/operator-sdk/blob/master/internal/olm/client/client.go
Have the return type defined as custom error, for re-usability.
Refactor the test cases and write new ones as needed based on above code re-factor.