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

🐛 Validate MHC MaxUnhealthy strings are percentages #2648

Merged

Conversation

JoelSpeed
Copy link
Contributor

What this PR does / why we need it:

It is currently possible to put {"spec": {"maxUnhealthy": 1}} and {"spec": {"maxUnhealthy": "1"}} and get different behaviour within MHC. Within the apps group types, they validate that the string values are valid percentages before persisting, thus allowing the bug that I hit during the demo today to go unnoticed for such a long time.

I've added this validation to the webhook for MHC and this should prevent users from hitting this in the future

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 11, 2020
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Mar 11, 2020
Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

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

/milestone v0.3.1
/approve

@k8s-ci-robot k8s-ci-robot added this to the v0.3.1 milestone Mar 11, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JoelSpeed, vincepri

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 Mar 11, 2020
@ncdc
Copy link
Contributor

ncdc commented Mar 11, 2020

/lgtm
maybe we should consider not using the IntOrString in the future

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 11, 2020
@k8s-ci-robot k8s-ci-robot merged commit 846731f into kubernetes-sigs:master Mar 11, 2020
@JoelSpeed JoelSpeed deleted the improve-mhc-validation branch March 12, 2020 08:47
@JoelSpeed
Copy link
Contributor Author

@ncdc I appreciate your concern with this type, I have raised an issue after some discussion yesterday so this one may, hopefully, get fixed kubernetes/kubernetes#89082

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/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants