diff --git a/pkg/authz/oauth/provider.go b/pkg/authz/oauth/provider.go index 137185d10..815b11dda 100644 --- a/pkg/authz/oauth/provider.go +++ b/pkg/authz/oauth/provider.go @@ -97,7 +97,7 @@ func NewProvider(idp corecfg.IDPConfig, tlsCfg corecfg.TLSConfig, proxyURL strin metadata, err := p.fetchMetadata() if err != nil { p.logger. - WithField("name", p.cfg.GetIDPName()). + WithField("provider", p.cfg.GetIDPName()). WithField("type", p.cfg.GetIDPType()). WithField("metadata-url", p.metadataURL). WithError(err). @@ -371,6 +371,7 @@ func (p *provider) RegisterClient(clientReq ClientMetadata) (ClientMetadata, err p.logger. WithField("provider", p.cfg.GetIDPName()). WithField("client-name", clientReq.GetClientName()). + WithField("client-id", clientReq.GetClientName()). WithField("grant-type", clientReq.GetGrantTypes()). WithField("token-auth-method", clientReq.GetTokenEndpointAuthMethod()). WithField("response-type", clientReq.GetResponseTypes()). @@ -381,6 +382,7 @@ func (p *provider) RegisterClient(clientReq ClientMetadata) (ClientMetadata, err err = fmt.Errorf("error status code: %d, body: %s", response.Code, string(response.Body)) p.logger. + WithField("provider", p.cfg.GetIDPName()). WithField("client-name", clientReq.GetClientName()). WithField("grant-type", clientReq.GetGrantTypes()). WithField("token-auth-method", clientReq.GetTokenEndpointAuthMethod()). @@ -479,14 +481,14 @@ func (p *provider) UnregisterClient(clientID, accessToken string) error { err := fmt.Errorf("error status code: %d, body: %s", response.Code, string(response.Body)) p.logger. WithField("provider", p.cfg.GetIDPName()). - WithField("client-name", clientID). + WithField("client-id", clientID). Error(err.Error()) return err } p.logger. WithField("provider", p.cfg.GetIDPName()). - WithField("client-name", clientID). + WithField("client-id", clientID). Info("unregistered client") return nil } diff --git a/pkg/jobs/pool.go b/pkg/jobs/pool.go index 134c988dc..a3377c310 100644 --- a/pkg/jobs/pool.go +++ b/pkg/jobs/pool.go @@ -49,11 +49,6 @@ func newPool() *Pool { } newPool.SetStatus(PoolStatusInitializing) - // start routine to check all job status funcs and catch any failures - go newPool.jobChecker() - // start the pool watcher - go newPool.watchJobs() - return &newPool } @@ -75,6 +70,13 @@ func (p *Pool) setBackoff(backoff *backoff) { func (p *Pool) recordJob(job JobExecution) string { p.jobsMapLock.Lock() defer p.jobsMapLock.Unlock() + if len(p.jobs) > 0 && p.poolStatus == PoolStatusInitializing { + // start routine to check all job status funcs and catch any failures + go p.jobChecker() + // start the pool watcher + go p.watchJobs() + } + p.logger. WithField("job-id", job.GetID()). WithField("job-name", job.GetName()).