mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-23 08:56:29 +00:00
add debug logs to vault implementation
This commit is contained in:
parent
5f5a0413fe
commit
5e557bb2d8
1 changed files with 8 additions and 1 deletions
|
@ -92,17 +92,24 @@ func (v *vault) list(repo *model.Repo, build *model.Build) ([]*model.Secret, err
|
|||
continue
|
||||
}
|
||||
|
||||
logrus.Debugf("vault: read secret: %s", path)
|
||||
|
||||
vaultSecret, err := v.get(path)
|
||||
if err != nil {
|
||||
logrus.Debugf("vault: read secret failed: %s: %s", path, err)
|
||||
return nil, err
|
||||
}
|
||||
if vaultSecret == nil {
|
||||
logrus.Debugf("vault: read secret failed: %s: not found or empty value", path)
|
||||
continue
|
||||
}
|
||||
if !vaultSecret.Match(repo.FullName) {
|
||||
logrus.Debugf("vault: read secret: %s: restricted: %s", path, repo.FullName)
|
||||
continue
|
||||
}
|
||||
|
||||
logrus.Debugf("vault: read secret success: %s", err)
|
||||
|
||||
secrets = append(secrets, &model.Secret{
|
||||
Name: key,
|
||||
Value: vaultSecret.Value,
|
||||
|
@ -133,7 +140,7 @@ func (v *vault) start() {
|
|||
if v.done != nil {
|
||||
close(v.done)
|
||||
}
|
||||
logrus.Debugf("vault: token renewal enabled: renew every %v", v.renew)
|
||||
logrus.Infof("vault: token renewal enabled: renew every %v", v.renew)
|
||||
v.done = make(chan struct{})
|
||||
if v.renew != 0 {
|
||||
go v.renewLoop()
|
||||
|
|
Loading…
Reference in a new issue