Added support for kube-context flag, to specify kubernetes context (#1595)

This commit is contained in:
Rahul Bhati
2020-05-11 18:54:06 +05:30
committed by GitHub
parent 3e8cbe112f
commit 2d69542265
8 changed files with 26 additions and 20 deletions
+2 -1
View File
@@ -42,6 +42,7 @@ func Log(input cli.Input) error {
func (opts *LogSubCommand) do(input cli.Input) error {
dbType := input.String(flagkey.FnLogDBType)
fnPod := input.String(flagkey.FnLogPod)
kubeContext := input.String(flagkey.KubeContext)
logReverseQuery := !input.Bool(flagkey.FnLogFollow) && input.Bool(flagkey.FnLogReverseQuery)
@@ -58,7 +59,7 @@ func (opts *LogSubCommand) do(input cli.Input) error {
return errors.Wrap(err, "error getting function")
}
server, err := util.GetApplicationUrl("application=fission-api")
server, err := util.GetApplicationUrl("application=fission-api", kubeContext)
if err != nil {
return err
}
+2 -2
View File
@@ -51,14 +51,14 @@ func (opts *TestSubCommand) do(input cli.Input) error {
Name: input.String(flagkey.FnName),
Namespace: input.String(flagkey.NamespaceFunction),
}
kubeContext := input.String(flagkey.KubeContext)
routerURL := os.Getenv("FISSION_ROUTER")
if len(routerURL) != 0 {
console.Warn("The environment variable FISSION_ROUTER is no longer supported for this command")
}
// Portforward to the fission router
localRouterPort, err := util.SetupPortForward(util.GetFissionNamespace(), "application=fission-router")
localRouterPort, err := util.SetupPortForward(util.GetFissionNamespace(), "application=fission-router", kubeContext)
if err != nil {
return err
}