mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-06 10:21:05 +02:00
Fix reload panic in Authorize code (#652)
This commit is contained in:
parent
49604ed458
commit
6196278046
1 changed files with 6 additions and 2 deletions
|
@ -88,10 +88,14 @@ func newPolicyEvaluator(opts *config.Options) (evaluator.Evaluator, error) {
|
||||||
// UpdateOptions implements the OptionsUpdater interface and updates internal
|
// UpdateOptions implements the OptionsUpdater interface and updates internal
|
||||||
// structures based on config.Options
|
// structures based on config.Options
|
||||||
func (a *Authorize) UpdateOptions(opts config.Options) error {
|
func (a *Authorize) UpdateOptions(opts config.Options) error {
|
||||||
|
if a == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
log.Info().Str("checksum", fmt.Sprintf("%x", opts.Checksum())).Msg("authorize: updating options")
|
log.Info().Str("checksum", fmt.Sprintf("%x", opts.Checksum())).Msg("authorize: updating options")
|
||||||
var err error
|
pe, err := newPolicyEvaluator(&opts)
|
||||||
if a.pe, err = newPolicyEvaluator(&opts); err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
a.pe = pe
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue