Turn ServiceAccount into struct value to avoid race conditon during account creation

This commit is contained in:
Sergey Dudoladov
2018-04-20 13:05:05 +02:00
parent a5a65e93f4
commit bd51d2922b
3 changed files with 15 additions and 13 deletions
+4 -4
View File
@@ -68,10 +68,10 @@ type Config struct {
Resources
Auth
Scalyr
PodServiceAccount *v1.ServiceAccount
WatchedNamespace string `name:"watched_namespace"` // special values: "*" means 'watch all namespaces', the empty string "" means 'watch a namespace where operator is deployed to'
EtcdHost string `name:"etcd_host" default:"etcd-client.default.svc.cluster.local:2379"`
DockerImage string `name:"docker_image" default:"registry.opensource.zalan.do/acid/spiloprivate-9.6:1.2-p4"`
PodServiceAccount v1.ServiceAccount // has to be struct value, not a pointer
WatchedNamespace string `name:"watched_namespace"` // special values: "*" means 'watch all namespaces', the empty string "" means 'watch a namespace where operator is deployed to'
EtcdHost string `name:"etcd_host" default:"etcd-client.default.svc.cluster.local:2379"`
DockerImage string `name:"docker_image" default:"registry.opensource.zalan.do/acid/spiloprivate-9.6:1.2-p4"`
// re-use one account for both Spilo pods and the operator; this grants extra privileges to pods
ServiceAccountName string `name:"service_account_name" default:"operator"`
PodServiceAccountName string `name:"pod_service_account_name" default:"operator"`