Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] [CLI] kyverno apply fails when non policy files are in the policy directory #10171

Closed
2 tasks done
monotek opened this issue May 5, 2024 · 1 comment · Fixed by #10270
Closed
2 tasks done

[Bug] [CLI] kyverno apply fails when non policy files are in the policy directory #10171

monotek opened this issue May 5, 2024 · 1 comment · Fixed by #10270
Assignees
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

Comments

@monotek
Copy link
Contributor

monotek commented May 5, 2024

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

  • I have read and followed the troubleshooting guide.
  • I have searched other issues in this repository and mine is not recorded.
@monotek monotek added bug Something isn't working triage Default label assigned to all new issues indicating label curation is needed to fully organize. type:cli cli releated issue labels May 5, 2024
@monotek monotek changed the title [Bug] [CLI] [Bug] [CLI] kyverno apply fails when non policy files are in the policy directory May 5, 2024
@realshuting realshuting added regression Issues (bugs) which are regressions from an earlier release. and removed triage Default label assigned to all new issues indicating label curation is needed to fully organize. labels May 6, 2024
@realshuting realshuting added this to the Kyverno Release 1.12.2 milestone May 6, 2024
@realshuting realshuting added the release-critical Critical issues which MUST be addressed in the specified milestone. These cannot get bumped. label May 16, 2024
@monotek
Copy link
Contributor Author

monotek commented May 23, 2024

Works for me now with v1.12.2-rc.2 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants