Browse Source

Update client.go

modified getSecret() when using name to return error if len(s) == 0

Signed-off-by: Bill Hamilton <bill.hamilton@pacificcode.com>
Bill Hamilton 1 year ago
parent
commit
a10bcc231d
1 changed files with 4 additions and 0 deletions
  1. 4 0
      pkg/provider/secretserver/client.go

+ 4 - 0
pkg/provider/secretserver/client.go

@@ -137,6 +137,10 @@ func (c *client) getSecret(_ context.Context, ref esv1beta1.ExternalSecretDataRe
 		if err != nil {
 			return nil, err
 		}
+		if len(s) == 0 {
+			return nil, errors.New("unable to retrieve secret at this time")
+		}
+
 		return &s[0], nil
 	}
 	return c.api.Secret(id)