-
Notifications
You must be signed in to change notification settings - Fork 41
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
Allow --local-crds
flag to receive multiple values
#101
Allow --local-crds
flag to receive multiple values
#101
Conversation
Welcome @doom! |
for _, dir := range k.dirs { | ||
files, err := utils.ReadDir(k.fs, dir) | ||
if err != nil { | ||
return nil, fmt.Errorf("error listing %s: %w", dir, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to stop if any of the directory fails? I think we do
But do we want to report all errors if multiple directories fail? I suspect so too, thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree for a better user experience we likely should accumulate and report all errors at once.
However it seems the current strategy for this function is to fail as soon as any error is encountered (e.g. first file that cannot be read). Perhaps we could revisit it outside of this PR ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sgtm
/retest |
/ok-to-test Not sure why the CI is stuck.. |
Hey @kannon92 ! Not very familiar with the process, but from my side the workflow is still marked as awaiting approval from a maintainer (and links to these docs). Would you or @apelisse be able to do that ? |
I marked it as ok to test |
0eb921d
to
64b569c
Compare
Hey @alexzielenski, thank you ! I have rebased the branch on top of |
/approve Thanks for this! Will defer lgtm for a bit in case @apelisse has anything to add |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alexzielenski, doom The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
I ran into an issue recently, where in my CRDs directory, where i had to copy all my CRDs, a non CRD yaml file existed, which caused kubectl-validate to fail, like below. kubectl-validate namespaces/visual-regression-tracker --local-crds ./crds
Error: no kind "ClusterPolicy" is registered for version "kyverno.io/v1" in scheme "pkg/runtime/scheme.go:100" So if multiple directories would be possible for --local-crds imho there should be some check if the files in the directories are valid CRDs. |
That is valid, I agree we should ignore non-crds in those directories. Could you file a separate issue to track this? |
/lgtm |
done :) |
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR allows the
--local-crds
flag to receive multiple values.Which issue(s) this PR fixes:
Fixes #100
Special notes for your reviewer:
N/A
Does this PR introduce a user-facing change?