mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-31 18:07:17 +02:00
zero: add service accounts support (#5031)
* zero: add service accounts support * quit on terminal errors
This commit is contained in:
parent
715fd75994
commit
4193583301
7 changed files with 210 additions and 108 deletions
|
@ -2,6 +2,7 @@ package bootstrap
|
|||
|
||||
import (
|
||||
"context"
|
||||
"encoding/base64"
|
||||
"sync"
|
||||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
|
@ -56,13 +57,12 @@ func (src *source) UpdateBootstrap(ctx context.Context, cfg cluster_api.Bootstra
|
|||
incoming := current.Clone()
|
||||
applyBootstrapConfig(incoming.Options, &cfg)
|
||||
|
||||
src.markReady.Do(func() { close(src.ready) })
|
||||
|
||||
if cmp.Equal(incoming.Options, current.Options, cmpOpts...) {
|
||||
return false
|
||||
}
|
||||
|
||||
src.cfg.Store(incoming)
|
||||
src.markReady.Do(func() { close(src.ready) })
|
||||
|
||||
src.notifyListeners(ctx, incoming)
|
||||
|
||||
|
@ -82,6 +82,7 @@ func (src *source) notifyListeners(ctx context.Context, cfg *config.Config) {
|
|||
}
|
||||
|
||||
func applyBootstrapConfig(dst *config.Options, src *cluster_api.BootstrapConfig) {
|
||||
dst.SharedKey = base64.StdEncoding.EncodeToString(src.SharedSecret)
|
||||
if src.DatabrokerStorageConnection != nil {
|
||||
dst.DataBrokerStorageType = config.StoragePostgresName
|
||||
dst.DataBrokerStorageConnectionString = *src.DatabrokerStorageConnection
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue