Closed ah8ad3 closed 2 months ago
Welcome @ah8ad3!
It looks like this is your first PR to kubernetes-sigs/kubectl-validate 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.
You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.
You can also check if kubernetes-sigs/kubectl-validate has its own contribution guidelines.
You may want to refer to our testing guide if you run into trouble with your tests not passing.
If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!
Thank you, and welcome to Kubernetes. :smiley:
/cc @alexzielenski
Looking thru the code for this PR i see we already have logic to skip empty YAML documents, I am curious how that bug persists...
@ah8ad3 could you add a test case for the linked issue (---
) and investigate why the existing logic for this does not skip the document as expected for that case before we consider removing error checking logic
Good catch, lazy of me to not giving it enough attention.
It seems that IsEmptyYamlDocument
only accepts a yaml as a empty if you have some sort of comments with #
in it, otherwise it react to it as a non empty file. I changed the condition of that function and added two files to testcases/manifests
one with comments and one with only ---
and it should work now.
PTAL @alexzielenski.
Commits squashed.
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: ah8ad3, alexzielenski
The full list of commands accepted by this bot can be found here.
The pull request process is described here
CI is unhappy with a comment it seems
It was a odd one, my IDE didn't warn me that :|. Gofmt was not happy with ,
at the end of the line.
It should be fixed now. @alexzielenski .
/lgtm
What type of PR is this?
/kind bug
What this PR does / why we need it:
Ignore empty documents.
Which issue(s) this PR fixes:
Fixes https://github.com/kubernetes-sigs/kubectl-validate/issues/109
Special notes for your reviewer:
I am not sure ignoring would effect other things or not (we don't have any failing test), please point out if it would.
Does this PR introduce a user-facing change?