mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 08:17:26 +00:00
fix "kubectl create --raw"
This commit is contained in:
parent
923f6c54bb
commit
82d101a6fa
@ -264,12 +264,16 @@ func (o *CreateOptions) raw(f cmdutil.Factory) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// TODO post content with stream. Right now it ignores body content
|
// 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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Fprintf(o.Out, "%v", string(bytes))
|
fmt.Fprintf(o.Out, "%v", string(body))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user