diff --git a/parse/parse.go b/parse/parse.go index 053ad33a7..fecba6c52 100644 --- a/parse/parse.go +++ b/parse/parse.go @@ -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 } diff --git a/types/mapper/metadata.go b/types/mapper/metadata.go index 5bd7e5f2c..7596a8753 100644 --- a/types/mapper/metadata.go +++ b/types/mapper/metadata.go @@ -14,7 +14,7 @@ func NewMetadataMapper() types.Mapper { Move{From: "creationTimestamp", To: "created"}, Move{From: "deletionTimestamp", To: "removed"}, Drop{Field: "deletionGracePeriodSeconds"}, - Drop{Field: "clusterName"}, + Drop{Field: "clusterName", IgnoreDefinition: true}, ReadOnly{Field: "*"}, Access{ Fields: map[string]string{ diff --git a/types/mapper/move.go b/types/mapper/move.go index c9d5e015b..2f4a8fa65 100644 --- a/types/mapper/move.go +++ b/types/mapper/move.go @@ -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)