move cluster config struct to the spec package

This commit is contained in:
Murat Kabilov
2017-07-13 16:51:41 +02:00
parent 333dfdd640
commit ea0ed11e86
8 changed files with 63 additions and 65 deletions
+13
View File
@@ -5,8 +5,12 @@ import (
"fmt"
"strings"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/pkg/api/v1"
"k8s.io/client-go/pkg/types"
"k8s.io/client-go/rest"
"github.com/zalando-incubator/postgres-operator/pkg/util/teams"
)
// EvenType contains type of the events for the TPRs and Pods received from Kubernetes
@@ -67,6 +71,15 @@ type PgSyncUserRequest struct {
User PgUser
}
// Config contains operator-wide clients and configuration used from a cluster. TODO: remove struct duplication.
type ClusterConfig struct {
KubeClient *kubernetes.Clientset //TODO: move clients to the better place?
RestClient *rest.RESTClient
TeamsAPIClient *teams.API
RestConfig *rest.Config
InfrastructureRoles map[string]PgUser // inherited from the controller
}
// UserSyncer defines an interface for the implementations to sync users from the manifest to the DB.
type UserSyncer interface {
ProduceSyncRequests(dbUsers PgUserMap, newUsers PgUserMap) (req []PgSyncUserRequest)