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

PVC may be stolen by an other pod #1052

Merged
merged 3 commits into from
Jun 11, 2019
Merged

Conversation

barkbay
Copy link
Contributor

@barkbay barkbay commented Jun 11, 2019

This PR fixes a situation where a PVC can be adopted/stolen if a Pod takes too long to be created.

Copy link
Collaborator

@pebrc pebrc left a comment

Choose a reason for hiding this comment

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

Can we test this somehow (probably hard due to it being a timing issue)

@@ -326,6 +327,11 @@ func (d *defaultDriver) Reconcile(
}
}

orphanedPVCs, err := pvc.FindOrphanedVolumeClaims(d.Client, es)
Copy link
Collaborator

Choose a reason for hiding this comment

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

A comment why this fixes the problem would be nice.

@thbkrkr thbkrkr mentioned this pull request Jun 11, 2019
@barkbay
Copy link
Contributor Author

barkbay commented Jun 11, 2019

Can we test this somehow (probably hard due to it being a timing issue)

My concern here is that the reconcile loop is not covered by unit tests.
It would mean add some units tests to this part of the code which is not trivial.
Testability should be improved later when we move all the Elasticsearch interactions out of the main reconciliation loop.

Copy link
Contributor

@thbkrkr thbkrkr left a comment

Choose a reason for hiding this comment

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

LGTM

@barkbay barkbay merged commit 5b7bbfb into elastic:master Jun 11, 2019
@pebrc pebrc added >bug Something isn't working v0.9.0 labels Jul 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug Something isn't working v0.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants