Merge pull request #41474 from wojtek-t/debug_decode_parameters

Automatic merge from submit-queue (batch tested with PRs 41332, 41069, 41470, 41474)

Fix unnecessary conversions in parameter codec.

Fix #41472

@deads2k @smarterclayton @sttts
This commit is contained in:
Kubernetes Submit Queue 2017-02-15 10:10:12 -08:00 committed by GitHub
commit 14bdeceeb4

View File

@ -161,11 +161,12 @@ func (c *parameterCodec) DecodeParameters(parameters url.Values, from schema.Gro
if err != nil {
return err
}
targetGVK := targetGVKs[0]
if targetGVK.GroupVersion() == from {
return c.convertor.Convert(&parameters, into, nil)
for i := range targetGVKs {
if targetGVKs[i].GroupVersion() == from {
return c.convertor.Convert(&parameters, into, nil)
}
}
input, err := c.creator.New(from.WithKind(targetGVK.Kind))
input, err := c.creator.New(from.WithKind(targetGVKs[0].Kind))
if err != nil {
return err
}