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

KubeadmControlPlane validation should match kubebuilder validation patterns #1795

Closed
ncdc opened this issue Nov 22, 2019 · 3 comments · Fixed by #1844
Closed

KubeadmControlPlane validation should match kubebuilder validation patterns #1795

ncdc opened this issue Nov 22, 2019 · 3 comments · Fixed by #1844
Assignees
Labels
area/control-plane Issues or PRs related to control-plane lifecycle management good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Milestone

Comments

@ncdc
Copy link
Contributor

ncdc commented Nov 22, 2019

The validation for KubeadmControlPlane should be updated to match the patterns shown in https://book.kubebuilder.io/cronjob-tutorial/webhook-implementation.html. Specifically, it should look like this:

var allErrs field.ErrorList

if err := someValidation(); err != nil {
  allErrs = append(allErrs, err)
}
// more validations here

if len(allErrs) == 0 {
  return nil
}

return apierrors.NewInvalid(
  GroupVersion.WithKind("KubeadmControlPlane").GroupKind(),
  r.Name, allErrs)

/kind cleanup
/help
/good-first-issue
/milestone v0.3.0
/priority important-soon

@k8s-ci-robot
Copy link
Contributor

@ncdc:
This request has been marked as suitable for new contributors.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue command.

In response to this:

The validation for KubeadmControlPlane should be updated to match the patterns shown in https://book.kubebuilder.io/cronjob-tutorial/webhook-implementation.html. Specifically, it should look like this:

var allErrs field.ErrorList

if err := someValidation(); err != nil {
 allErrs = append(allErrs, err)
}
// more validations here

if len(allErrs) == 0 {
 return nil
}

return apierrors.NewInvalid(
 GroupVersion.WithKind("KubeadmControlPlane").GroupKind(),
 r.Name, allErrs)

/kind cleanup
/help
/good-first-issue
/milestone v0.3.0
/priority important-soon

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added this to the v0.3.0 milestone Nov 22, 2019
@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Nov 22, 2019
@neeleshkorade
Copy link
Contributor

I would like to work on this if no one else is working on it yet. Looking to start contributing to cluster-api as much as I can. Thanks

@ncdc
Copy link
Contributor Author

ncdc commented Nov 22, 2019

@neeleshkorade you got it, thanks! Please add a comment /lifecycle active when you start working on it. I'm going to assign it to myself so it's "taken".

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/control-plane Issues or PRs related to control-plane lifecycle management good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants