1
0
mirror of https://github.com/rancher/norman.git synced 2025-09-07 18:20:17 +00:00

remove the checks on some return values, which was added recently by another PR, to make it work when being used in rancher

This commit is contained in:
Jiaqi Luo
2022-12-02 20:27:19 -07:00
parent c943439888
commit 29dae41a91
2 changed files with 3 additions and 9 deletions

View File

@@ -293,10 +293,7 @@ func parseAction(url *url.URL) (string, string) {
}
func Body(req *http.Request) (map[string]interface{}, error) {
err := req.ParseMultipartForm(maxFormSize)
if err != nil {
return nil, err
}
_ = req.ParseMultipartForm(maxFormSize)
if req.MultipartForm != nil {
return valuesToBody(req.MultipartForm.Value), nil
}

View File

@@ -2,7 +2,6 @@ package mapper
import (
"fmt"
"strings"
"github.com/rancher/norman/types"
@@ -39,13 +38,11 @@ func (m Move) ModifySchema(s *types.Schema, schemas *types.Schemas) error {
return fmt.Errorf("failed to find field %s on schema %s", m.From, s.ID)
}
toSchema, toFieldName, _, ok, err := getField(s, schemas, m.To)
toSchema, toFieldName, _, _, err := getField(s, schemas, m.To)
if err != nil {
return err
}
if !ok {
return fmt.Errorf("failed to find field %s on schema %s", m.To, s.ID)
}
_, ok = toSchema.ResourceFields[toFieldName]
if ok && !strings.Contains(m.To, "/") && !m.DestDefined {
return fmt.Errorf("field %s already exists on schema %s", m.To, s.ID)