kyverno: [BUG] Kyverno CLI `test` command and `-f` flag
Software version numbers State the version numbers of applications involved in the bug.
- Kubernetes version: 1.21
- Kubernetes platform (if applicable; ex., EKS, GKE, OpenShift): K3d
- Kyverno version: 1.4.2
Describe the bug
When passing an argument to the kyverno test -f
flag, the name of the test file, regardless if it’s specified as a relative path or full path, is not accepted and Kyverno CLI prints Error: a directory is required
.
To Reproduce Steps to reproduce the behavior:
- Have a directory containing a test file, policy, and resource as outlined in #2303
cd
to the directory having these files.- Run
kyverno test -f test.yaml
- See error.
- Format the file path with a fully-qualified path like
kyverno test -f /foo/bar/test.yaml
. - See error.
Expected behavior
The kyverno test -f
command accepts relative and fully-qualified paths to a test file of the specified name. The test manifest’s references to files should be assumed to be relative paths unless otherwise specified.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 19 (18 by maintainers)
@NoSkillGirl I’ve edited the above output. See what you think:
This is a great improvement, @NoSkillGirl, but there is some polishing needed both in language and examples. Let me respond a bit later with some suggestions.
The file is found. It’s there.