Skip to content

Commit

Permalink
Fix bug where token cache can be loaded as null
Browse files Browse the repository at this point in the history
  • Loading branch information
dqsully committed Apr 30, 2021
1 parent c802ffb commit 4d5be60
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions engines/vault/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,18 @@ func (controller *vaultController) Init() error {
return nil
}

config := vaultConfig{
TokenCache: make(map[string]cachedToken),
}
config := vaultConfig{}

if !vars.IsCICD {
err := util.LoadConfig("vault", &config)
if err != nil {
return err
}

if config.TokenCache == nil {
config.TokenCache = make(map[string]cachedToken)
}

needToSave := false
now := time.Now().Unix()

Expand Down

0 comments on commit 4d5be60

Please sign in to comment.