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

Standard might not be the default storage class #1061

Merged

Conversation

barkbay
Copy link
Contributor

@barkbay barkbay commented Jun 12, 2019

standard might not be the default storage class, or there may be no storage class at all.
In that case we should not try to compare the storage class and return true.

return reflect.DeepEqual(claim.Spec.StorageClassName, candidate.Spec.StorageClassName)
if claim.Spec.StorageClassName == nil {
// volumeClaimTemplate has no storageClass set
return true
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure I understand why we return true here? I read it as "if there is no storage class requested, then the candidate PV is compatible" which sounds wrong?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm I guess we have no way of knowing what is the "default" storage class on a given cluster, so we fallback to anything?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that's it

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should get that comment a bit more explicit:

// volumeClaimTemplate has no storageClass set: it should use the k8s cluster default
// since we don't know that default, we fallback to reusing any available volume 
// from the same cluster (whatever the storage class actually is)

@barkbay barkbay merged commit e09bf2e into elastic:master Jun 12, 2019
@barkbay barkbay deleted the standard-might-not-be-the-default-storage-class branch June 12, 2019 16:09
@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