... | ... |
@@ -64,7 +64,7 @@ func (persistentvolumeStrategy) AllowCreateOnUpdate() bool { |
64 | 64 |
// PrepareForUpdate sets the Status fields which is not allowed to be set by an end user updating a PV |
65 | 65 |
func (persistentvolumeStrategy) PrepareForUpdate(obj, old runtime.Object) { |
66 | 66 |
newPv := obj.(*api.PersistentVolume) |
67 |
- oldPv := obj.(*api.PersistentVolume) |
|
67 |
+ oldPv := old.(*api.PersistentVolume) |
|
68 | 68 |
newPv.Status = oldPv.Status |
69 | 69 |
} |
70 | 70 |
|
... | ... |
@@ -86,7 +86,7 @@ var StatusStrategy = persistentvolumeStatusStrategy{Strategy} |
86 | 86 |
// PrepareForUpdate sets the Spec field which is not allowed to be changed when updating a PV's Status |
87 | 87 |
func (persistentvolumeStatusStrategy) PrepareForUpdate(obj, old runtime.Object) { |
88 | 88 |
newPv := obj.(*api.PersistentVolume) |
89 |
- oldPv := obj.(*api.PersistentVolume) |
|
89 |
+ oldPv := old.(*api.PersistentVolume) |
|
90 | 90 |
newPv.Spec = oldPv.Spec |
91 | 91 |
} |
92 | 92 |
|
... | ... |
@@ -64,7 +64,7 @@ func (persistentvolumeclaimStrategy) AllowCreateOnUpdate() bool { |
64 | 64 |
// PrepareForUpdate sets the Status field which is not allowed to be set by end users on update |
65 | 65 |
func (persistentvolumeclaimStrategy) PrepareForUpdate(obj, old runtime.Object) { |
66 | 66 |
newPvc := obj.(*api.PersistentVolumeClaim) |
67 |
- oldPvc := obj.(*api.PersistentVolumeClaim) |
|
67 |
+ oldPvc := old.(*api.PersistentVolumeClaim) |
|
68 | 68 |
newPvc.Status = oldPvc.Status |
69 | 69 |
} |
70 | 70 |
|
... | ... |
@@ -86,7 +86,7 @@ var StatusStrategy = persistentvolumeclaimStatusStrategy{Strategy} |
86 | 86 |
// PrepareForUpdate sets the Spec field which is not allowed to be changed when updating a PV's Status |
87 | 87 |
func (persistentvolumeclaimStatusStrategy) PrepareForUpdate(obj, old runtime.Object) { |
88 | 88 |
newPv := obj.(*api.PersistentVolumeClaim) |
89 |
- oldPv := obj.(*api.PersistentVolumeClaim) |
|
89 |
+ oldPv := old.(*api.PersistentVolumeClaim) |
|
90 | 90 |
newPv.Spec = oldPv.Spec |
91 | 91 |
} |
92 | 92 |
|