mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-01 04:42:24 +02:00
Move service account to Controller
This commit is contained in:
@@ -51,6 +51,8 @@ type Controller struct {
|
||||
lastClusterSyncTime int64
|
||||
|
||||
workerLogs map[uint32]ringlog.RingLogger
|
||||
|
||||
PodServiceAccount *v1.ServiceAccount
|
||||
}
|
||||
|
||||
// NewController creates a new controller
|
||||
@@ -128,9 +130,9 @@ func (c *Controller) initPodServiceAccount() {
|
||||
case groupVersionKind.Kind != "ServiceAccount":
|
||||
panic(fmt.Errorf("pod service account definiton in the operator config map defines another type of resource: %v", groupVersionKind.Kind))
|
||||
default:
|
||||
c.opConfig.PodServiceAccount = *obj.(*v1.ServiceAccount)
|
||||
c.PodServiceAccount = obj.(*v1.ServiceAccount)
|
||||
// ensure consistent naming of the account
|
||||
c.opConfig.PodServiceAccount.Name = c.opConfig.PodServiceAccountName
|
||||
c.PodServiceAccount.Name = c.opConfig.PodServiceAccountName
|
||||
}
|
||||
|
||||
// actual service accounts are deployed at the time of Postgres/Spilo cluster creation
|
||||
|
||||
@@ -26,6 +26,7 @@ func (c *Controller) makeClusterConfig() cluster.Config {
|
||||
RestConfig: c.config.RestConfig,
|
||||
OpConfig: config.Copy(c.opConfig),
|
||||
InfrastructureRoles: infrastructureRoles,
|
||||
PodServiceAccount: c.PodServiceAccount,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user