Test for httptrigger and functions container/newdeploy (#2861)

* Test for httptrigger and functions
* Fixes with multierror
* review changes

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
Sanket Sudake
2023-10-27 15:05:20 +05:30
committed by GitHub
parent 2eb2eba88c
commit 2223081c80
24 changed files with 292 additions and 166 deletions
+9 -9
View File
@@ -65,17 +65,17 @@ func (opts *TestSubCommand) do(input cli.Input) error {
Name: fnName,
Namespace: namespace,
}
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(input.Context(), opts.Client(), util.GetFissionNamespace(), "application=fission-router")
if err != nil {
return err
routerURL := os.Getenv("FISSION_ROUTER_URL")
if len(routerURL) == 0 {
// Portforward to the fission router
localRouterPort, err := util.SetupPortForward(input.Context(), opts.Client(), util.GetFissionNamespace(), "application=fission-router")
if err != nil {
return err
}
routerURL = "http://127.0.0.1:" + localRouterPort
}
fnURL := "http://127.0.0.1:" + localRouterPort + util.UrlForFunction(m.Name, m.Namespace)
fnURL := routerURL + util.UrlForFunction(m.Name, m.Namespace)
if input.IsSet(flagkey.FnSubPath) {
subPath := input.String(flagkey.FnSubPath)
if !strings.HasPrefix(subPath, "/") {