Browse Source

remove byte conversion and add return error

rodmartinez 4 years ago
parent
commit
90abbdf642
1 changed files with 7 additions and 1 deletions
  1. 7 1
      pkg/provider/oracle/oracle.go

+ 7 - 1
pkg/provider/oracle/oracle.go

@@ -140,9 +140,15 @@ func (vms *VaultManagementService) GetSecret(ctx context.Context, ref esv1alpha1
 	if !ok {
 		return nil, fmt.Errorf(errUnexpectedContent)
 	}
+
 	payload, err := base64.StdEncoding.DecodeString(*bt.Content)
+
+	if err != nil {
+		return nil, err
+	}
+
 	if ref.Property == "" {
-		return []byte(payload), nil
+		return payload, nil
 	}
 
 	val := gjson.Get(string(payload), ref.Property)