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

Backport - Don't reject PVC update when different unit is used (#2857) #2858

Merged
merged 1 commit into from
Apr 10, 2020

Conversation

sebgl
Copy link
Contributor

@sebgl sebgl commented Apr 10, 2020

Backport #2857 on 1.1.

When we apply a manifest with a 1024Gi storage requirement, it may be
internally persisted with a different storage unit (eg. 1Ti). When doing
a strict deep equal comparison, 1Ti and 1024Gi are different.
A user applying such a manifest will not have any update allowed, even
though he keeps using 1024Gi.

This fixes it by relying on apiequality.Semantic.DeepEqual, which is
used in Kubernetes itself:
https://github.com/kubernetes/kubernetes/blob/c369cf187ea765c0a2387f2b39abe6ed18c8e6a8/pkg/apis/apps/validation/validation.go#L156

When we apply a manifest with a 1024Gi storage requirement, it may be
internally persisted with a different storage unit (eg. 1Ti). When doing
a strict deep equal comparison, 1Ti and 1024Gi are different.
A user applying such a manifest will not have any update allowed, even
though he keeps using 1024Gi.

This fixes it by relying on `apiequality.Semantic.DeepEqual`, which is
used in Kubernetes itself:
https://github.com/kubernetes/kubernetes/blob/c369cf187ea765c0a2387f2b39abe6ed18c8e6a8/pkg/apis/apps/validation/validation.go#L156
@sebgl sebgl added the backport For backport PRs label Apr 10, 2020
@sebgl
Copy link
Contributor Author

sebgl commented Apr 10, 2020

Jenkins test this please.

@sebgl sebgl merged commit 9f5d30f into elastic:1.1 Apr 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport For backport PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants