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

separate args validation for better reuse #899

Merged
merged 1 commit into from
Aug 8, 2022

Conversation

a7i
Copy link
Contributor

@a7i a7i commented Aug 5, 2022

  1. Separate validations for reuse
  2. Aggregate all errors as opposed to stopping on first validation error

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 5, 2022
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 5, 2022
@a7i
Copy link
Contributor Author

a7i commented Aug 5, 2022

/cc @damemi @ingvagabund

Copy link
Contributor

@damemi damemi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this work @a7i, but this change wasn't really my intent with the comment in #861 (comment). The point I'm trying to get at more is that our default plugins shouldn't be any different from theoretical third-party plugins. So, not dependent on any internal functions like this.

In my other comment, I meant more that Namespace and Label arg validation should be public, common functions that we export as part of the framework (to be used by any plugins). Does that make sense?

@a7i
Copy link
Contributor Author

a7i commented Aug 5, 2022

In my other comment, I meant more that Namespace and Label arg validation should be public, common functions that we export as part of the framework (to be used by any plugins). Does that make sense?

So basically move the new functions to a new file and make them public. Do you have a place in mind that will fit this?
same directory i.e. pkg/apis/componentconfig/validation seems good?

@damemi
Copy link
Contributor

damemi commented Aug 5, 2022

@a7i I think for now they can stay where they are, I just wanted to make a note of my intent for these eventually. Breaking them into individual functions works toward that goal so this PR looks fine to me. Sorry for the confusion
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 5, 2022
@damemi
Copy link
Contributor

damemi commented Aug 8, 2022

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: damemi

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 8, 2022
@k8s-ci-robot k8s-ci-robot merged commit 27ed7d1 into kubernetes-sigs:master Aug 8, 2022
@a7i a7i deleted the separate-args-validations branch August 8, 2022 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants