Pass new and old object to DropDisabledFields

This commit is contained in:
Jordan Liggitt
2018-12-18 17:50:22 -05:00
parent 88284f637b
commit 901ddba812
9 changed files with 28 additions and 18 deletions

View File

@@ -24,8 +24,11 @@ import (
// DropDisabledFields removes disabled fields from the pvc spec.
// This should be called from PrepareForCreate/PrepareForUpdate for all resources containing a pvc spec.
func DropDisabledFields(pvcSpec *core.PersistentVolumeClaimSpec) {
func DropDisabledFields(pvcSpec, oldPVCSpec *core.PersistentVolumeClaimSpec) {
if !utilfeature.DefaultFeatureGate.Enabled(features.BlockVolume) {
pvcSpec.VolumeMode = nil
if oldPVCSpec != nil {
oldPVCSpec.VolumeMode = nil
}
}
}