honor AllowFail option

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2021-03-05 15:52:39 +03:00
parent 87d8c31a76
commit fb665f0d99
2 changed files with 4 additions and 92 deletions

View File

@@ -69,7 +69,7 @@ func (c *vaultConfig) Init(opts ...config.Option) error {
}
cli, err := api.NewClient(cfg)
if err != nil {
if err != nil && !c.opts.AllowFail {
return err
}
@@ -78,7 +78,7 @@ func (c *vaultConfig) Init(opts ...config.Option) error {
"role_id": roleID,
"secret_id": secretID,
})
if err != nil {
if err != nil && !c.opts.AllowFail {
return err
}
token = rsp.Auth.ClientToken