wait for initial sync to complete before starting control plane (#1636)

This commit is contained in:
Caleb Doxsey 2020-11-30 15:45:12 -07:00 committed by GitHub
parent e5d55f300e
commit 3f7777f7e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 49 additions and 6 deletions

View file

@ -27,6 +27,8 @@ type Authorize struct {
dataBrokerDataLock sync.RWMutex
dataBrokerData evaluator.DataBrokerData
dataBrokerInitialSync map[string]chan struct{}
}
// New validates and creates a new Authorize service from a set of config options.
@ -36,6 +38,10 @@ func New(cfg *config.Config) (*Authorize, error) {
store: evaluator.NewStore(),
templates: template.Must(frontend.NewTemplates()),
dataBrokerData: make(evaluator.DataBrokerData),
dataBrokerInitialSync: map[string]chan struct{}{
"type.googleapis.com/directory.Group": make(chan struct{}, 1),
"type.googleapis.com/directory.User": make(chan struct{}, 1),
},
}
state, err := newAuthorizeStateFromConfig(cfg, a.store)