backend/manta: fix panic when insecure_skip_tls_verify was not set

The DefaultFunc for insecure_skip_tls_verify was sending an empty string
instead of a bool. Fixes to default to `false`.
This commit is contained in:
Kristin Laemmert 2019-09-26 10:08:29 -04:00
parent 69b6791ef1
commit 5300f85a79
1 changed files with 4 additions and 1 deletions

View File

@ -53,7 +53,7 @@ func New() backend.Backend {
"insecure_skip_tls_verify": { "insecure_skip_tls_verify": {
Type: schema.TypeBool, Type: schema.TypeBool,
Optional: true, Optional: true,
DefaultFunc: schema.EnvDefaultFunc("TRITON_SKIP_TLS_VERIFY", ""), DefaultFunc: schema.EnvDefaultFunc("TRITON_SKIP_TLS_VERIFY", false),
}, },
"path": { "path": {
@ -131,6 +131,9 @@ func (b *Backend) configure(ctx context.Context) error {
if data.Get("key_id").(string) == "" { if data.Get("key_id").(string) == "" {
validationError = multierror.Append(validationError, errors.New("`Key ID` must be configured for the Triton provider")) validationError = multierror.Append(validationError, errors.New("`Key ID` must be configured for the Triton provider"))
} }
if data.Get("key_id").(string) == "" {
validationError = multierror.Append(validationError, errors.New("`Key ID` must be configured for the Triton provider"))
}
if b.path == "" { if b.path == "" {
validationError = multierror.Append(validationError, errors.New("`Path` must be configured for the Triton provider")) validationError = multierror.Append(validationError, errors.New("`Path` must be configured for the Triton provider"))
} }