Merge pull request #54245 from deads2k/cli-03-postraw

Automatic merge from submit-queue. 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>.

add kubectl create --raw -f

Adds `--raw` to `kubectl create` to match `kubectl get --raw`.  It re-uses the transport, reads the input stream (stdin or a single file for now) and posts directly to the endpoint specified.  This let's you direct data directly at a subresource (as a for instance).  I'd like to see this extended to `kubectl replace` too, so that we have full access to subresources via scripting without having to reproduce the transports.

@kubernetes/sig-cli-pr-reviews 

```release-note
add `--raw` to `kubectl create` to POST using the normal transport
```
This commit is contained in:
Kubernetes Submit Queue
2017-10-23 17:16:01 -07:00
committed by GitHub
3 changed files with 69 additions and 4 deletions

View File

@@ -34,7 +34,8 @@ func TestExtraArgsFail(t *testing.T) {
f, _, _, _ := cmdtesting.NewAPIFactory()
c := NewCmdCreate(f, buf, errBuf)
if ValidateArgs(c, []string{"rc"}) == nil {
options := CreateOptions{}
if options.ValidateArgs(c, []string{"rc"}) == nil {
t.Errorf("unexpected non-error")
}
}