Skip to content

Commit

Permalink
Merge pull request #65489 from deads2k/cli-80-convert
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue (batch tested with PRs 64246, 65489, 65443). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubectl convert should not double wrap output in nested lists

@kubernetes/sig-cli-maintainers 
@soltysh 

```release-note
kubectl convert previous created a list inside of a list.  Now it is only wrapped once.
```
  • Loading branch information
Kubernetes Submit Queue committed Jun 27, 2018
2 parents 6d3bba7 + aee798b commit c581d09
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/kubectl/cmd/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,11 @@ func (o *ConvertOptions) RunConvert() error {
}

if meta.IsListType(objects) {
obj, err := objectListToVersionedObject([]runtime.Object{objects}, o.specifiedOutputVersion)
listContent, err := meta.ExtractList(objects)
if err != nil {
return err
}
obj, err := objectListToVersionedObject(listContent, o.specifiedOutputVersion)
if err != nil {
return err
}
Expand Down

0 comments on commit c581d09

Please sign in to comment.