fixup error
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
fbdb6e332b
commit
cb81c3f768
8
vault.go
8
vault.go
@ -70,6 +70,8 @@ func (c *vaultConfig) Init(opts ...config.Option) error {
|
||||
|
||||
cli, err := api.NewClient(cfg)
|
||||
if err != nil && !c.opts.AllowFail {
|
||||
return nil
|
||||
} else if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -99,6 +101,12 @@ func (c *vaultConfig) Load(ctx context.Context) error {
|
||||
}
|
||||
}
|
||||
|
||||
if c.cli == nil && !c.opts.AllowFail {
|
||||
return ErrPathNotExist
|
||||
} else if c.cli == nil && c.opts.AllowFail {
|
||||
return nil
|
||||
}
|
||||
|
||||
pair, err := c.cli.Logical().Read(c.path)
|
||||
if err != nil && !c.opts.AllowFail {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user