Skip to content

Commit

Permalink
Merge pull request kubernetes#25202 from roberthbailey/automated-cher…
Browse files Browse the repository at this point in the history
…ry-pick-of-#24924-upstream-release-1.2

Automated cherry pick of kubernetes#24924 upstream release 1.2
  • Loading branch information
roberthbailey committed May 5, 2016
2 parents 4a62da3 + 1a61308 commit 82742c4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/registry/horizontalpodautoscaler/strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (autoscalerStrategy) AllowCreateOnUpdate() bool {
// PrepareForUpdate clears fields that are not allowed to be set by end users on update.
func (autoscalerStrategy) PrepareForUpdate(obj, old runtime.Object) {
newHPA := obj.(*extensions.HorizontalPodAutoscaler)
oldHPA := obj.(*extensions.HorizontalPodAutoscaler)
oldHPA := old.(*extensions.HorizontalPodAutoscaler)
// Update is not allowed to set status
newHPA.Status = oldHPA.Status
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/registry/persistentvolume/strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (persistentvolumeStrategy) AllowCreateOnUpdate() bool {
// PrepareForUpdate sets the Status fields which is not allowed to be set by an end user updating a PV
func (persistentvolumeStrategy) PrepareForUpdate(obj, old runtime.Object) {
newPv := obj.(*api.PersistentVolume)
oldPv := obj.(*api.PersistentVolume)
oldPv := old.(*api.PersistentVolume)
newPv.Status = oldPv.Status
}

Expand All @@ -86,7 +86,7 @@ var StatusStrategy = persistentvolumeStatusStrategy{Strategy}
// PrepareForUpdate sets the Spec field which is not allowed to be changed when updating a PV's Status
func (persistentvolumeStatusStrategy) PrepareForUpdate(obj, old runtime.Object) {
newPv := obj.(*api.PersistentVolume)
oldPv := obj.(*api.PersistentVolume)
oldPv := old.(*api.PersistentVolume)
newPv.Spec = oldPv.Spec
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/registry/persistentvolumeclaim/strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (persistentvolumeclaimStrategy) AllowCreateOnUpdate() bool {
// PrepareForUpdate sets the Status field which is not allowed to be set by end users on update
func (persistentvolumeclaimStrategy) PrepareForUpdate(obj, old runtime.Object) {
newPvc := obj.(*api.PersistentVolumeClaim)
oldPvc := obj.(*api.PersistentVolumeClaim)
oldPvc := old.(*api.PersistentVolumeClaim)
newPvc.Status = oldPvc.Status
}

Expand All @@ -86,7 +86,7 @@ var StatusStrategy = persistentvolumeclaimStatusStrategy{Strategy}
// PrepareForUpdate sets the Spec field which is not allowed to be changed when updating a PV's Status
func (persistentvolumeclaimStatusStrategy) PrepareForUpdate(obj, old runtime.Object) {
newPv := obj.(*api.PersistentVolumeClaim)
oldPv := obj.(*api.PersistentVolumeClaim)
oldPv := old.(*api.PersistentVolumeClaim)
newPv.Spec = oldPv.Spec
}

Expand Down

0 comments on commit 82742c4

Please sign in to comment.