operator-framework / operator-courier

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

When user provides invalid files, the error does not mention which files are invalid and why #74

Open scoheb opened 5 years ago

scoheb commented 5 years ago

(tmp-XVr6zr33) shebert@localhost/tmp/scott:$ operator-courier -v 1.2.0 (tmp-XVr6zr33) shebert@localhost/tmp/scott:$ operator-courier verify . ERROR:operatorcourier.identify:Courier requires valid CSV, CRD, and Package files Courier requires valid CSV, CRD, and Package files

awgreene commented 5 years ago

Hello @scoheb. This error would result from the following conditions:

  1. A file in the directory is not a valid yaml file.
  2. If the directory only contains valid yaml files, then this log would be produced if none of the following conditions are met:
    • The packageName field doesn't exist.
    • The kind is not set to ClusterServiceVersion or CustomResourceDefintion.

The code that produced this log can be seen here.

We could update the message to report that one of the conditions above was not met.

scoheb commented 5 years ago

@awgreene The above text would be good to output to the user. Even better would be your suggestion of We could update the message to report that one of the conditions above was not met.

brianwcook commented 5 years ago

request we say -which- file is not a valid yaml file if possible

brianwcook commented 5 years ago

also i assume you are using a custom config for linting? I get hard errors from yammlint like

23:81 error line too long (3902 > 80 characters) (line-length)

but obviously this is required due to the base64 encoded images in the yaml. So I think we need detailed yaml lint output reported so we know what issues actually are considered errrors by operator-courier.