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(cstor-webhook): fixes pool scaledown bug #122

Merged
merged 3 commits into from
Jul 9, 2020

Conversation

sonasingh46
Copy link
Contributor

In case of scaling down a pool by removing a pool spec from the CSPC, the webhook server was reporting an out of bounds error. This commit fixes this bug.

Bug Description:
The validation code, in case of scaledown, was trying to list CSPI based on all the labels present on the nodes of the corresponding CSPI. On the other hand, CSPI only has kubernetes.io/hostname label to it and not all the other node labels. As labels are ANDed for output, we were not getting any items in the CSPI list and hence out of bounds error was caused.

Signed-off-by: Ashutosh Kumar ashutosh.kumar@mayadata.io

In case of scaling down a pool by removing a pool spec
from the CSPC, webhook server was reporting a out of bounds exception.
This commit fixes this bug.

Signed-off-by: Ashutosh Kumar <ashutosh.kumar@mayadata.io>
@sonasingh46 sonasingh46 added admission-webhook bug Something isn't working labels Jul 9, 2020
@sonasingh46 sonasingh46 self-assigned this Jul 9, 2020
Copy link
Contributor

@shubham14bajpai shubham14bajpai left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@mittachaitu mittachaitu left a comment

Choose a reason for hiding this comment

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

provided comments

pkg/webhook/cspc.go Outdated Show resolved Hide resolved
pkg/webhook/cspc.go Outdated Show resolved Hide resolved
Ashutosh Kumar added 2 commits July 9, 2020 18:34
Signed-off-by: Ashutosh Kumar <ashutosh.kumar@mayadata.io>
Signed-off-by: Ashutosh Kumar <ashutosh.kumar@mayadata.io>
Copy link
Contributor

@mittachaitu mittachaitu left a comment

Choose a reason for hiding this comment

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

changes are good

Copy link
Contributor

@prateekpandey14 prateekpandey14 left a comment

Choose a reason for hiding this comment

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

lgtm

@prateekpandey14 prateekpandey14 merged commit 70adf7a into openebs-archive:master Jul 9, 2020
sonasingh46 pushed a commit to sonasingh46/cstor-operators that referenced this pull request Jul 9, 2020
…penebs-archive#122)

While scaling down a pool by removing a pool spec
from the CSPC, there was nil pool list getting initialized due to 
additional node-selector labels get added in pool list label-selector not
matches with existing CSPI labels, causing the webhook failures 

Signed-off-by: Ashutosh Kumar <ashutosh.kumar@mayadata.io>
prateekpandey14 pushed a commit that referenced this pull request Jul 9, 2020
) (#123)

While scaling down a pool by removing a pool spec from the CSPC
there was nil pool list getting initialized due to additional node-selector
labels get added in pool list label-selector, not matches with existing 
CSPI labels, causing the webhook failures 

Signed-off-by: Ashutosh Kumar <ashutosh.kumar@mayadata.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
admission-webhook bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants