kubewarden / kwctl

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

Feature Request: Pull policy if not in local store #844

Closed mueller-ma closed 2 weeks ago

mueller-ma commented 1 month ago

Is your feature request related to a problem?

The creation of Kubernetes manifests currently requires two commands:

Omitting the first command results in an error:

Error: Cannot find policy 'registry://ghcr.io/kubewarden/policies/container-resources:v0.2.4' inside of the local store.
Try executing `kwctl pull registry://ghcr.io/kubewarden/policies/container-resources:v0.2.4`

Solution you'd like

If the policy is not in the local store, pull it automatically. The docker cli also does this and you say in the Readme: "Think of it as the docker CLI tool if you were working with containers."

Alternatives you've considered

No response

Anything else?

No response

flavio commented 1 month ago

I took a quick look at that, I have some drafted code I'll be happy to share with whoever takes this issue

flavio commented 1 month ago

I've published the WIP code I had here: https://github.com/kubewarden/kwctl/tree/manifest-should-pull-on-missing-policy

I've to leave for vacation, feel free to use it. There's a TODO block documenting what is missing