From 129bcd7bd61dc3126f27453a59b73d8b9a4054fd Mon Sep 17 00:00:00 2001
From: Murat Kabilov <murat@kabilov.com>
Date: Mon, 17 Jul 2017 17:08:40 +0200
Subject: [PATCH] rest client: use interface instead of structure pointer

---
 pkg/cluster/cluster.go       | 2 +-
 pkg/controller/controller.go | 2 +-
 pkg/util/k8sutil/k8sutil.go  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/pkg/cluster/cluster.go b/pkg/cluster/cluster.go
index 994abf22..028d2b12 100644
--- a/pkg/cluster/cluster.go
+++ b/pkg/cluster/cluster.go
@@ -37,7 +37,7 @@ var (
 // Config contains operator-wide clients and configuration used from a cluster. TODO: remove struct duplication.
 type Config struct {
 	KubeClient          *kubernetes.Clientset //TODO: move clients to the better place?
-	RestClient          *rest.RESTClient
+	RestClient          rest.Interface
 	RestConfig          *rest.Config
 	TeamsAPIClient      *teams.API
 	OpConfig            config.Config
diff --git a/pkg/controller/controller.go b/pkg/controller/controller.go
index 0091d70e..6112ec6b 100644
--- a/pkg/controller/controller.go
+++ b/pkg/controller/controller.go
@@ -20,7 +20,7 @@ import (
 type Config struct {
 	RestConfig          *rest.Config
 	KubeClient          *kubernetes.Clientset
-	RestClient          *rest.RESTClient
+	RestClient          rest.Interface
 	TeamsAPIClient      *teams.API
 	InfrastructureRoles map[string]spec.PgUser
 }
diff --git a/pkg/util/k8sutil/k8sutil.go b/pkg/util/k8sutil/k8sutil.go
index 2239fbde..f3be75bf 100644
--- a/pkg/util/k8sutil/k8sutil.go
+++ b/pkg/util/k8sutil/k8sutil.go
@@ -38,7 +38,7 @@ func ResourceNotFound(err error) bool {
 	return apierrors.IsNotFound(err)
 }
 
-func KubernetesRestClient(c *rest.Config) (*rest.RESTClient, error) {
+func KubernetesRestClient(c *rest.Config) (rest.Interface, error) {
 	c.GroupVersion = &schema.GroupVersion{Version: constants.K8sVersion}
 	c.APIPath = constants.K8sAPIPath
 	c.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs}
-- 
GitLab