From bee9f25277d6630ecfa1cd46cd3e6f0b411b19f8 Mon Sep 17 00:00:00 2001 From: John-Michael Faircloth Date: Fri, 17 Sep 2021 11:41:08 -0500 Subject: [PATCH] OIDC provider: show success message in CLI (#12574) --- vault/identity_store_oidc_provider.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/vault/identity_store_oidc_provider.go b/vault/identity_store_oidc_provider.go index 980ac8ff0..79d4fc86a 100644 --- a/vault/identity_store_oidc_provider.go +++ b/vault/identity_store_oidc_provider.go @@ -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