Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
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
|
||||
|
Reference in New Issue
Block a user