mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-09-30 10:11:49 +02:00
committed by
Oleksii Kliukin
parent
d34273543e
commit
4acaf27a5d
@@ -5,7 +5,6 @@ import (
|
||||
"sync"
|
||||
|
||||
"github.com/Sirupsen/logrus"
|
||||
etcdclient "github.com/coreos/etcd/client"
|
||||
"k8s.io/client-go/kubernetes"
|
||||
"k8s.io/client-go/pkg/api/v1"
|
||||
"k8s.io/client-go/rest"
|
||||
@@ -21,7 +20,6 @@ type Config struct {
|
||||
RestConfig *rest.Config
|
||||
KubeClient *kubernetes.Clientset
|
||||
RestClient *rest.RESTClient
|
||||
EtcdClient etcdclient.KeysAPI
|
||||
TeamsAPIClient *teams.API
|
||||
InfrastructureRoles map[string]spec.PgUser
|
||||
}
|
||||
@@ -122,10 +120,6 @@ func (c *Controller) initController() {
|
||||
DeleteFunc: c.podDelete,
|
||||
})
|
||||
|
||||
if err := c.initEtcdClient(c.opConfig.EtcdHost); err != nil {
|
||||
c.logger.Fatalf("Can't get etcd client: %s", err)
|
||||
}
|
||||
|
||||
c.clusterEventQueues = make([]*cache.FIFO, c.opConfig.Workers)
|
||||
for i := range c.clusterEventQueues {
|
||||
c.clusterEventQueues[i] = cache.NewFIFO(func(obj interface{}) (string, error) {
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
etcdclient "github.com/coreos/etcd/client"
|
||||
)
|
||||
|
||||
func (c *Controller) initEtcdClient(etcdHost string) error {
|
||||
etcdURL := fmt.Sprintf("http://%s", etcdHost)
|
||||
|
||||
cfg, err := etcdclient.New(etcdclient.Config{
|
||||
Endpoints: []string{etcdURL},
|
||||
Transport: etcdclient.DefaultTransport,
|
||||
HeaderTimeoutPerRequest: time.Second,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
c.EtcdClient = etcdclient.NewKeysAPI(cfg)
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -23,7 +23,6 @@ func (c *Controller) makeClusterConfig() cluster.Config {
|
||||
return cluster.Config{
|
||||
KubeClient: c.KubeClient,
|
||||
RestClient: c.RestClient,
|
||||
EtcdClient: c.EtcdClient,
|
||||
TeamsAPIClient: c.TeamsAPIClient,
|
||||
OpConfig: config.Copy(c.opConfig),
|
||||
InfrastructureRoles: infrastructureRoles,
|
||||
|
||||
Reference in New Issue
Block a user