Browse Source

fix: replace error check with ok check (#4636)

* fix: replace error check with ok check

Signed-off-by: Iuri Severo <nobreiuri@gmail.com>

* Update pkg/provider/vault/client_push.go

Signed-off-by: Gustavo Fernandes de Carvalho <17139678+gusfcarvalho@users.noreply.github.com>

---------

Signed-off-by: Iuri Severo <nobreiuri@gmail.com>
Signed-off-by: Gustavo Fernandes de Carvalho <17139678+gusfcarvalho@users.noreply.github.com>
Co-authored-by: Gustavo Fernandes de Carvalho <17139678+gusfcarvalho@users.noreply.github.com>
Iuri Severo 1 year ago
parent
commit
93853a4c75
1 changed files with 3 additions and 3 deletions
  1. 3 3
      pkg/provider/vault/client_push.go

+ 3 - 3
pkg/provider/vault/client_push.go

@@ -99,9 +99,9 @@ func (c *client) PushSecret(ctx context.Context, secret *corev1.Secret, data esv
 	// If a Push of a property only, we should merge and add/update the property
 	if data.GetProperty() != "" {
 		if _, ok := vaultSecret[data.GetProperty()]; ok {
-			d := vaultSecret[data.GetProperty()].(string)
-			if err != nil {
-				return fmt.Errorf("error marshaling vault secret: %w", err)
+			d, ok := vaultSecret[data.GetProperty()].(string)
+			if !ok {
+				return fmt.Errorf("error converting %s to string", data.GetProperty())
 			}
 			// If the property has the same value, don't update the secret
 			if bytes.Equal([]byte(d), value) {