From 4a47c476507e89d51d744381cf5da14bb23b5837 Mon Sep 17 00:00:00 2001 From: Andy Goldstein Date: Fri, 21 Apr 2017 07:42:50 -0400 Subject: [PATCH] More RC/RS controller logging updates We were comparing the address of the old and new RC.spec.replicas and we have to compare the values. This only affects logging. Update RS controller to match RC controller to log when spec.replicas changes, not status.replicas. --- pkg/controller/replicaset/replica_set.go | 4 ++-- pkg/controller/replication/replication_controller.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/controller/replicaset/replica_set.go b/pkg/controller/replicaset/replica_set.go index d3125bace7d..068f9acd4e9 100644 --- a/pkg/controller/replicaset/replica_set.go +++ b/pkg/controller/replicaset/replica_set.go @@ -219,8 +219,8 @@ func (rsc *ReplicaSetController) updateRS(old, cur interface{}) { // this function), but in general extra resyncs shouldn't be // that bad as ReplicaSets that haven't met expectations yet won't // sync, and all the listing is done using local stores. - if oldRS.Status.Replicas != curRS.Status.Replicas { - glog.V(4).Infof("Observed updated replica count for ReplicaSet: %v, %d->%d", curRS.Name, oldRS.Status.Replicas, curRS.Status.Replicas) + if *(oldRS.Spec.Replicas) != *(curRS.Spec.Replicas) { + glog.V(4).Infof("Replica set %v updated. Desired pod count change: %d->%d", curRS.Name, *(oldRS.Spec.Replicas), *(curRS.Spec.Replicas)) } rsc.enqueueReplicaSet(cur) } diff --git a/pkg/controller/replication/replication_controller.go b/pkg/controller/replication/replication_controller.go index d16e9308618..cd8a2106ade 100644 --- a/pkg/controller/replication/replication_controller.go +++ b/pkg/controller/replication/replication_controller.go @@ -214,7 +214,7 @@ func (rm *ReplicationManager) updateRC(old, cur interface{}) { // this function), but in general extra resyncs shouldn't be // that bad as rcs that haven't met expectations yet won't // sync, and all the listing is done using local stores. - if oldRC.Spec.Replicas != curRC.Spec.Replicas { + if *(oldRC.Spec.Replicas) != *(curRC.Spec.Replicas) { glog.V(4).Infof("Replication controller %v updated. Desired pod count change: %d->%d", curRC.Name, *(oldRC.Spec.Replicas), *(curRC.Spec.Replicas)) } rm.enqueueController(cur)