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

Fix maxUnavailable to round down instead up #1076

Merged

Conversation

gregory-lyons
Copy link

What this PR does / why we need it:
kube-state-metrics rounding logic should match Kubernetes rounding logic

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #1075

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 21, 2020
@@ -33,7 +33,7 @@ var (
depl2Replicas int32 = 5

depl1MaxUnavailable = intstr.FromInt(10)
depl2MaxUnavailable = intstr.FromString("20%")
depl2MaxUnavailable = intstr.FromString("25%")
Copy link
Author

Choose a reason for hiding this comment

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

With rounding up, this will fail to produce the existing expected value of 1. With my change (rounding down) we still produce the existing expected value.

@gregory-lyons
Copy link
Author

/assign @tariq1890

@tariq1890
Copy link
Contributor

Thanks for fixing this @gregory-lyons. Can you point this to the release-1.9 branch?

@tariq1890
Copy link
Contributor

@lilic @brancz I think we should get a patch release out of this. Thoughts?

@gregory-lyons gregory-lyons changed the base branch from master to release-1.9 February 21, 2020 22:15
@gregory-lyons gregory-lyons changed the base branch from release-1.9 to master February 21, 2020 22:15
@gregory-lyons
Copy link
Author

@tariq1890 do you want me to rebase onto the top of release-1.9 branch?

@tariq1890
Copy link
Contributor

Yes please.

@gregory-lyons gregory-lyons changed the base branch from master to release-1.9 February 21, 2020 23:21
@tariq1890
Copy link
Contributor

/lgtm
/hold

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 21, 2020
@lilic
Copy link
Member

lilic commented Feb 22, 2020

@lilic @brancz I think we should get a patch release out of this. Thoughts?

@tariq1890 was this "bug" introduced in the 1.9 branch? 🤔

@tariq1890
Copy link
Contributor

@lilic fair point :). In that case, we could just retarget to master.

@tariq1890
Copy link
Contributor

@gregory-lyons sorry for the inconvenience; can we retarget this back to the master branch.

@k8s-ci-robot k8s-ci-robot added do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 24, 2020
@gregory-lyons gregory-lyons changed the base branch from release-1.9 to master February 24, 2020 17:53
@k8s-ci-robot k8s-ci-robot removed the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Feb 24, 2020
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Feb 24, 2020
@gregory-lyons
Copy link
Author

@tariq1890 no worries, updated it

@tariq1890
Copy link
Contributor

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 24, 2020
@tariq1890
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 24, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gregory-lyons, tariq1890

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

@brancz
Copy link
Member

brancz commented Feb 25, 2020

The kube bot requires us to not have the "Fixes #..." type thing in the commit message. Can you remove that? Then we can merge this.

@tariq1890 tariq1890 closed this Feb 25, 2020
@tariq1890 tariq1890 reopened this Feb 25, 2020
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Feb 25, 2020
@k8s-ci-robot k8s-ci-robot merged commit 22d195f into kubernetes:master Feb 25, 2020
@tariq1890
Copy link
Contributor

Thanks @gregory-lyons :)!

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

Successfully merging this pull request may close these issues.

kube-state-metrics should round down maxUnavailable
5 participants