kubewarden / kwctl

Go-to CLI tool for Kubewarden users
https://kubewarden.io
Apache License 2.0
73 stars 15 forks source link

Error while checking if the policy has been created using Opa/Gatekeeper #662

Closed vfarcic closed 10 months ago

vfarcic commented 10 months ago

Is there an existing issue for this?

Current Behavior

When I execute wctl annotate policy.wasm --metadata-path metadata.yml --output-path annotated-policy.wasm, I'm getting the following error:

Error: Error while checking if the policy has been created using Opa/Gatekeeper: No such file or directory (os error 2)

https://docs.kubewarden.io/distributing-policies does not mention OPA/Gatekeeper so I'm not sure what the relation is and what I might be missing to make it work.

Expected Behavior

It works or the error message shows a clearer message what the issue might be.

Steps To Reproduce

No response

Environment

- OS: macOS
- Architecture: M1 (Apple Silicon)

Anything else?

No response

flavio commented 10 months ago

Looking at the code, I think the way we're handling the error is leading to a wrong error message.

I think the policy.wasm file is not found, which leads to the No such file or directory (os error 2) error, which is then wrapped up into the misleading message you got.

We're going to improve the error handling to provide better feedback. In the meantime, are you sure the policy.wasm file exists?

flavio commented 10 months ago

Moving to blocked, waiting for user feedback