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

Kyverno CLI test command on Git repos default to main branch #2290

Closed
chipzoller opened this issue Aug 23, 2021 · 1 comment · Fixed by #2342
Closed

Kyverno CLI test command on Git repos default to main branch #2290

chipzoller opened this issue Aug 23, 2021 · 1 comment · Fixed by #2342
Assignees
Labels
enhancement New feature or request type:cli cli releated issue

Comments

@chipzoller
Copy link
Contributor

Is your feature request related to a problem? Please describe.
The Kyverno CLI, when using the test command with an upstream git repository, requires the format of that repo contain the branch name. This isn't aligned with about all software today which can default to pick up the main or master branch.

Describe the solution you'd like
When using the test command of the CLI to test against a web-server-backed Git repo, default to using the main branch (or master if main is not present). Users should be able to point the CLI like so: kyverno test https://github.com/kyverno/policies
Additionally, if both master and main are found, prefer main and print a message back to the console stating this.

@chipzoller chipzoller added enhancement New feature or request type:cli cli releated issue labels Aug 23, 2021
@vyankyGH vyankyGH self-assigned this Aug 23, 2021
@vyankyGH
Copy link
Contributor

vyankyGH commented Sep 3, 2021

@chipzoller Currently we don't have logic to fetch branch from given Git repo to pick up the main or master branch.
Kyverno test command validate given Url is correct or not. Repo and branch is present or not.
As you suggested, if user doesn't mention branch name in Url, By default I'm setting to main.
(kyverno test https://github.com/kyverno/policies/) .
Also you can test with any another branch name also (test https://github.com/kyverno/policies/add_sample_policy )
It will get fix once PR merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request type:cli cli releated issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants