Feature Request: Pull policy if not in local store
Is your feature request related to a problem?
The creation of Kubernetes manifests currently requires two commands:
-
kwctl pull ghcr.io/kubewarden/policies/container-resources:v0.2.4 -
kwctl scaffold manifest -t ClusterAdmissionPolicy registry://ghcr.io/kubewarden/policies/container-resources:v0.2.4
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
I took a quick look at that, I have some drafted code I'll be happy to share with whoever takes this issue
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