[Bug] [CLI] kyverno apply fails when non policy files are in the policy directory #10171
Closed
2 tasks done
Labels
bug
Something isn't working
regression
Issues (bugs) which are regressions from an earlier release.
release-critical
Critical issues which MUST be addressed in the specified milestone. These cannot get bumped.
type:cli
cli releated issue
Milestone
Kyverno CLI Version
1.12.1
Description
It seems that the cli had some changes in v1.12.0, v1.12.1-rc.1 & v1.12.1 as now a kustomization file in the policies directory is not longer ignored as before:
In v1.11.4 we just used the policy directory from our gitops repo, to run kyver I cli in a GitHub action, which also contains a kustomization.yaml, which was working without any issues.
Steps to reproduce
Use a directory with policies and a kustomization.yaml for the validation of resources.
kyverno apply kubernetes/namespaces/kyverno/base/policies/ --resource dist/kubernetes/namespaces/kyverno/dev/de1 Error: failed to load policies (failed to parse document (failed to retrieve validator: failed to locate OpenAPI spec for GV: kustomize.config.k8s.io/v1beta1))
Expected behavior
Command runs normally and ignores non policy files.
Screenshots
No response
Kyverno logs
No response
Slack discussion
No response
Troubleshooting
The text was updated successfully, but these errors were encountered: