Просмотр исходного кода

remove byte conversion and add return error

rodmartinez 4 лет назад
Родитель
Сommit
90abbdf642
1 измененных файлов с 7 добавлено и 1 удалено
  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)