mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-01 17:47:37 +02:00
Feature/infrastructure roles (#91)
* Add infrastructure roles configured globally. Those are the roles defined in the operator itself. The operator's configuration refers to the secret containing role names, passwords and membership information. While they are referred to as roles, in reality those are users. In addition, improve the regex to filter out invalid users and make sure user secret names are compatible with DNS name spec. Add an example manifest for the infrastructure roles.
This commit is contained in:
committed by
Murat Kabilov
parent
b8fba429df
commit
71b93b4cc2
@@ -17,11 +17,12 @@ import (
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
PodNamespace string
|
||||
KubeClient *kubernetes.Clientset
|
||||
RestClient *rest.RESTClient
|
||||
EtcdClient etcdclient.KeysAPI
|
||||
TeamsAPIClient *teams.TeamsAPI
|
||||
PodNamespace string
|
||||
KubeClient *kubernetes.Clientset
|
||||
RestClient *rest.RESTClient
|
||||
EtcdClient etcdclient.KeysAPI
|
||||
TeamsAPIClient *teams.TeamsAPI
|
||||
InfrastructureRoles map[string]spec.PgUser
|
||||
}
|
||||
|
||||
type Controller struct {
|
||||
@@ -74,6 +75,11 @@ func (c *Controller) initController() {
|
||||
}
|
||||
|
||||
c.TeamsAPIClient.RefreshTokenAction = c.getOAuthToken
|
||||
if infraRoles, err := c.getInfrastructureRoles(); err != nil {
|
||||
c.logger.Warningf("Can't get infrastructure roles: %s", err)
|
||||
} else {
|
||||
c.InfrastructureRoles = infraRoles
|
||||
}
|
||||
|
||||
// Postgresqls
|
||||
clusterLw := &cache.ListWatch{
|
||||
|
||||
Reference in New Issue
Block a user