From 6e5d7abcc5a66dd7eea92385b100b37d4eefb5b9 Mon Sep 17 00:00:00 2001 From: Murat Kabilov Date: Wed, 17 May 2017 11:05:15 +0200 Subject: [PATCH 1/2] pass cluster by reference --- pkg/cluster/cluster.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/cluster/cluster.go b/pkg/cluster/cluster.go index c6f5ed9e0..b0152309d 100644 --- a/pkg/cluster/cluster.go +++ b/pkg/cluster/cluster.go @@ -248,7 +248,7 @@ func (c *Cluster) Create(stopCh <-chan struct{}) error { return nil } -func (c Cluster) sameServiceWith(service *v1.Service) (match bool, reason string) { +func (c *Cluster) sameServiceWith(service *v1.Service) (match bool, reason string) { //TODO: improve comparison if !reflect.DeepEqual(c.Service.Spec.LoadBalancerSourceRanges, service.Spec.LoadBalancerSourceRanges) { reason = "new service's LoadBalancerSourceRange doesn't match the current one" @@ -258,7 +258,7 @@ func (c Cluster) sameServiceWith(service *v1.Service) (match bool, reason string return } -func (c Cluster) sameVolumeWith(volume spec.Volume) (match bool, reason string) { +func (c *Cluster) sameVolumeWith(volume spec.Volume) (match bool, reason string) { if !reflect.DeepEqual(c.Spec.Volume, volume) { reason = "new volume's specification doesn't match the current one" } else { @@ -267,7 +267,7 @@ func (c Cluster) sameVolumeWith(volume spec.Volume) (match bool, reason string) return } -func (c Cluster) compareStatefulSetWith(statefulSet *v1beta1.StatefulSet) (match, needsRollUpdate bool, reason string) { +func (c *Cluster) compareStatefulSetWith(statefulSet *v1beta1.StatefulSet) (match, needsRollUpdate bool, reason string) { match = true //TODO: improve me if *c.Statefulset.Spec.Replicas != *statefulSet.Spec.Replicas { From 22bcae07846a1aa82e6d21495b5eba8bccd792a4 Mon Sep 17 00:00:00 2001 From: Murat Kabilov Date: Wed, 17 May 2017 11:15:09 +0200 Subject: [PATCH 2/2] skip unused variable --- pkg/util/config/util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/util/config/util.go b/pkg/util/config/util.go index 5a9e23630..40d9e6ed9 100644 --- a/pkg/util/config/util.go +++ b/pkg/util/config/util.go @@ -26,7 +26,7 @@ func decoderFrom(field reflect.Value) (d Decoder) { d, ok := field.Interface().(Decoder) if !ok && field.CanAddr() { - d, ok = field.Addr().Interface().(Decoder) + d, _ = field.Addr().Interface().(Decoder) } return d