Extract portforward to separate package (#728)

* Extract port-forward from CLI to own package (for reuseability)
* Extract CLI logging to subpackage
This commit is contained in:
Erwin van Eyk
2018-06-13 11:26:39 +08:00
committed by Ta-Ching Chen
parent ddff7100e9
commit cf1f944069
13 changed files with 239 additions and 183 deletions
+5 -4
View File
@@ -27,6 +27,7 @@ import (
"github.com/fission/fission"
"github.com/fission/fission/crd"
"github.com/fission/fission/fission/log"
)
func wCreate(c *cli.Context) error {
@@ -34,7 +35,7 @@ func wCreate(c *cli.Context) error {
fnName := c.String("function")
if len(fnName) == 0 {
fatal("Need a function name to create a watch, use --function")
log.Fatal("Need a function name to create a watch, use --function")
}
fnNamespace := c.String("fnNamespace")
@@ -95,13 +96,13 @@ func wCreate(c *cli.Context) error {
func wGet(c *cli.Context) error {
// TODO
fatal("Not implemented")
log.Fatal("Not implemented")
return nil
}
func wUpdate(c *cli.Context) error {
// TODO
fatal("Not implemented")
log.Fatal("Not implemented")
return nil
}
@@ -110,7 +111,7 @@ func wDelete(c *cli.Context) error {
wName := c.String("name")
if len(wName) == 0 {
fatal("Need name of watch to delete, use --name")
log.Fatal("Need name of watch to delete, use --name")
}
wNs := c.String("triggerns")