fix "kubectl create --raw"

This commit is contained in:
Cao Shufeng 2018-04-08 11:59:41 +08:00
parent 923f6c54bb
commit 82d101a6fa

View File

@ -264,12 +264,16 @@ func (o *CreateOptions) raw(f cmdutil.Factory) error {
}
}
// TODO post content with stream. Right now it ignores body content
bytes, err := restClient.Post().RequestURI(o.Raw).Body(data).DoRaw()
result := restClient.Post().RequestURI(o.Raw).Body(data).Do()
if err := result.Error(); err != nil {
return err
}
body, err := result.Raw()
if err != nil {
return err
}
fmt.Fprintf(o.Out, "%v", string(bytes))
fmt.Fprintf(o.Out, "%v", string(body))
return nil
}