OIDC provider: show success message in CLI (#12574)

This commit is contained in:
John-Michael Faircloth 2021-09-17 11:41:08 -05:00 committed by GitHub
parent 5c94e5157c
commit bee9f25277
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 2 deletions

View File

@ -1023,7 +1023,7 @@ func (i *IdentityStore) pathOIDCClientExistenceCheck(ctx context.Context, req *l
// pathOIDCCreateUpdateProvider is used to create a new named provider or update an existing one
func (i *IdentityStore) pathOIDCCreateUpdateProvider(ctx context.Context, req *logical.Request, d *framework.FieldData) (*logical.Response, error) {
resp := &logical.Response{}
var resp logical.Response
name := d.Get("name").(string)
var provider provider
@ -1141,7 +1141,15 @@ func (i *IdentityStore) pathOIDCCreateUpdateProvider(ctx context.Context, req *l
return nil, err
}
return resp, req.Storage.Put(ctx, entry)
if err := req.Storage.Put(ctx, entry); err != nil {
return nil, err
}
if len(resp.Warnings) == 0 {
return nil, nil
}
return &resp, nil
}
// pathOIDCListProvider is used to list named providers