-
Notifications
You must be signed in to change notification settings - Fork 15
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
add resizing operation #231
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add this functionaity before this function
if err := factory.CreateOrUpdateStatefulSet(ctx, cluster, r.Client); err != nil { |
It should be separate function eg.:
if isStatefulSetDeletionRequired; {
if err := factory.DeleteStatefulSet(ctx, cluster, r.Client); err != nil {
return err
}
}
desiredStorage := instance.Spec.Storage.VolumeClaimTemplate.Spec.Resources.Requests[corev1.ResourceStorage] | ||
currentStorage := pvc.Spec.Resources.Requests[corev1.ResourceStorage] | ||
|
||
if !reflect.DeepEqual(desiredStorage, currentStorage) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use native Kubernetes method for comparing sizes instead of reflect
if desiredStorage.Cmp(currentStorage) != 0 {
// desiredStorage different, than currentStorage
}
desiredStorage := instance.Spec.Storage.VolumeClaimTemplate.Spec.Resources.Requests[corev1.ResourceStorage] | ||
currentStorage := pvc.Spec.Resources.Requests[corev1.ResourceStorage] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you have to compare storage from specific statefulSet.Spec.VolumeClaimTemplate
, not pvc
Do I understand it properly: with this PR we just update the StatefulSet without actual resizing of the PVCs? Since the PVCs are already created they won't be changed even if the |
Correct, the resizing of PVCs will probably implemented in separate PR |
closed if favor #254 |
added a comparison of pvc size with the existing one, and deletion in case of discrepancy. Should a new statefulset be created automatically after this?