operator-framework / operator-courier

Build, verify and push operators
Apache License 2.0
41 stars 53 forks source link

Raise error after validation is written to file #113

Closed jeremy-wl closed 5 years ago

jeremy-wl commented 5 years ago

Currently when we initialize the VerifiedManifest object and validate the input yamls, if the validation fails, OpCourierBadBundle Error will be raised before the warnings/errors are written to a file (if the user specifies this option).

We need to move the code raising the error after the warnings/errors have been written to a file.

jeremy-wl commented 5 years ago

/cc @kevinrizza @SamiSousa

jeremy-wl commented 5 years ago

@SamiSousa It seems those are the only 2 places where the "other potential errors" are. But we probably should not also put them into the validation_dict, since that dict comes from ValidateCmd class that validate only the yaml content. For those other errors, I guess we probably should just raise the error and exit, just like here.

kevinrizza commented 5 years ago

@jeremylinlin Can this also include a test so that we don't regress here again?

jeremy-wl commented 5 years ago

@kevinrizza Thanks for the comments. I have addressed them and also added several integration tests so that similar bugs can be captured in the future.

kevinrizza commented 5 years ago

/lgtm