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

View File

@ -104,6 +104,7 @@ func New(cfg Config, kubeClient k8sutil.KubernetesClient, pgSpec spec.Postgresql
deleteOptions: &meta_v1.DeleteOptions{OrphanDependents: &orphanDependents},
podEventsQueue: podEventsQueue,
KubeClient: kubeClient,
teamsAPIClient: teams.NewTeamsAPI(cfg.OpConfig.TeamsAPIUrl, logger.Logger),
}
return cluster

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 {
@ -35,7 +34,6 @@ type Controller struct {
logger *logrus.Entry
KubeClient k8sutil.KubernetesClient
RestClient rest.Interface
TeamsAPIClient *teams.API
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)
}