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

[controller] fix pod removal when diff > 1 #125

Merged
merged 2 commits into from
Apr 19, 2019

Conversation

schallert
Copy link
Collaborator

@schallert schallert commented Apr 18, 2019

There was a bug in the instance removal logic that would continuously
try to remove the last pod in a set even if it had already been removed
from the placement. This fixes that.

@codecov
Copy link

codecov bot commented Apr 18, 2019

Codecov Report

Merging #125 into master will increase coverage by 0.1%.
The diff coverage is 80%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #125     +/-   ##
=========================================
+ Coverage   68.67%   68.77%   +0.1%     
=========================================
  Files          26       26             
  Lines        1896     1909     +13     
=========================================
+ Hits         1302     1313     +11     
- Misses        491      493      +2     
  Partials      103      103

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6bdd7d1...27f2ab6. Read the comment docs.

There was a bug in the instance removal logic that would continuously
try to remove the last pod in a set even if it had already been removed
from the placement. This fixes that.

Tested by creating a cluster w/ 3 reps, 1 node each. Scaled each rep to
9, then back down to 1.
@schallert schallert marked this pull request as ready for review April 19, 2019 18:16
current := *set.Spec.Replicas
// Nunber of instances currently in the placement.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fix typo

for i := len(podIDs) - 1; i >= 0; i-- {
pod := podIDs[i].pod
inst, err := c.findPodInPlacement(cluster, pl, pod)
if err == errPodNotInPlacement {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Cause() on error

@schallert schallert merged commit aa922f1 into master Apr 19, 2019
@schallert schallert deleted the schallert/fix_multi_remove branch April 19, 2019 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant