remove teams api client from controller and make it per cluster

This commit is contained in:
Murat Kabilov
2017-07-25 01:01:49 +02:00
parent 9c19a22a7f
commit 941bfb3cc5
2 changed files with 4 additions and 7 deletions
+3 -7
View File
@@ -15,7 +15,6 @@ import (
"github.com/zalando-incubator/postgres-operator/pkg/util/config"
"github.com/zalando-incubator/postgres-operator/pkg/util/constants"
"github.com/zalando-incubator/postgres-operator/pkg/util/k8sutil"
"github.com/zalando-incubator/postgres-operator/pkg/util/teams"
)
type Config struct {
@@ -32,10 +31,9 @@ type Controller struct {
config Config
opConfig *config.Config
logger *logrus.Entry
KubeClient k8sutil.KubernetesClient
RestClient rest.Interface
TeamsAPIClient *teams.API
logger *logrus.Entry
KubeClient k8sutil.KubernetesClient
RestClient rest.Interface
clustersMu sync.RWMutex
clusters map[spec.NamespacedName]*cluster.Cluster
@@ -113,8 +111,6 @@ func (c *Controller) initController() {
c.logger.Level = logrus.DebugLevel
}
c.TeamsAPIClient = teams.NewTeamsAPI(c.opConfig.TeamsAPIUrl, c.logger.Logger)
if err := c.createTPR(); err != nil {
c.logger.Fatalf("could not register ThirdPartyResource: %v", err)
}