Browse code

UPSTREAM: 24924: fix PrepareForUpdate bug for HPA

Jordan Liggitt authored on 2016/05/05 10:38:56
Showing 1 changed files
... ...
@@ -70,7 +70,7 @@ func (autoscalerStrategy) AllowCreateOnUpdate() bool {
70 70
 // PrepareForUpdate clears fields that are not allowed to be set by end users on update.
71 71
 func (autoscalerStrategy) PrepareForUpdate(obj, old runtime.Object) {
72 72
 	newHPA := obj.(*extensions.HorizontalPodAutoscaler)
73
-	oldHPA := obj.(*extensions.HorizontalPodAutoscaler)
73
+	oldHPA := old.(*extensions.HorizontalPodAutoscaler)
74 74
 	// Update is not allowed to set status
75 75
 	newHPA.Status = oldHPA.Status
76 76
 }