Added support for kube-context flag, to specify kubernetes context (#1595)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user