support editing before creating resource
This commit is contained in:
@@ -29,9 +29,10 @@ import (
|
||||
func TestExtraArgsFail(t *testing.T) {
|
||||
initTestErrorHandler(t)
|
||||
buf := bytes.NewBuffer([]byte{})
|
||||
errBuf := bytes.NewBuffer([]byte{})
|
||||
|
||||
f, _, _, _ := cmdtesting.NewAPIFactory()
|
||||
c := NewCmdCreate(f, buf)
|
||||
c := NewCmdCreate(f, buf, errBuf)
|
||||
if ValidateArgs(c, []string{"rc"}) == nil {
|
||||
t.Errorf("unexpected non-error")
|
||||
}
|
||||
@@ -59,8 +60,9 @@ func TestCreateObject(t *testing.T) {
|
||||
}
|
||||
tf.Namespace = "test"
|
||||
buf := bytes.NewBuffer([]byte{})
|
||||
errBuf := bytes.NewBuffer([]byte{})
|
||||
|
||||
cmd := NewCmdCreate(f, buf)
|
||||
cmd := NewCmdCreate(f, buf, errBuf)
|
||||
cmd.Flags().Set("filename", "../../../examples/guestbook/legacy/redis-master-controller.yaml")
|
||||
cmd.Flags().Set("output", "name")
|
||||
cmd.Run(cmd, []string{})
|
||||
@@ -94,8 +96,9 @@ func TestCreateMultipleObject(t *testing.T) {
|
||||
}
|
||||
tf.Namespace = "test"
|
||||
buf := bytes.NewBuffer([]byte{})
|
||||
errBuf := bytes.NewBuffer([]byte{})
|
||||
|
||||
cmd := NewCmdCreate(f, buf)
|
||||
cmd := NewCmdCreate(f, buf, errBuf)
|
||||
cmd.Flags().Set("filename", "../../../examples/guestbook/legacy/redis-master-controller.yaml")
|
||||
cmd.Flags().Set("filename", "../../../examples/guestbook/frontend-service.yaml")
|
||||
cmd.Flags().Set("output", "name")
|
||||
@@ -129,8 +132,9 @@ func TestCreateDirectory(t *testing.T) {
|
||||
}
|
||||
tf.Namespace = "test"
|
||||
buf := bytes.NewBuffer([]byte{})
|
||||
errBuf := bytes.NewBuffer([]byte{})
|
||||
|
||||
cmd := NewCmdCreate(f, buf)
|
||||
cmd := NewCmdCreate(f, buf, errBuf)
|
||||
cmd.Flags().Set("filename", "../../../examples/guestbook/legacy")
|
||||
cmd.Flags().Set("output", "name")
|
||||
cmd.Run(cmd, []string{})
|
||||
|
||||
Reference in New Issue
Block a user