From 0109c08b9b45956f18c6574efe4cc2ac33962ee1 Mon Sep 17 00:00:00 2001 From: mqliang Date: Thu, 5 May 2016 09:38:56 +0800 Subject: [PATCH] fix PrepareForUpdate bug for HPA --- pkg/registry/horizontalpodautoscaler/strategy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/registry/horizontalpodautoscaler/strategy.go b/pkg/registry/horizontalpodautoscaler/strategy.go index 623cf222441..3a8ade0794e 100644 --- a/pkg/registry/horizontalpodautoscaler/strategy.go +++ b/pkg/registry/horizontalpodautoscaler/strategy.go @@ -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 }