From 2125c45cc32f726dda77b47e711ac0899dbebbd3 Mon Sep 17 00:00:00 2001 From: amrita Date: Wed, 18 Dec 2024 15:52:46 +0545 Subject: [PATCH] handle ocis server start in separate routine --- tests/ociswrapper/ocis/ocis.go | 2 ++ tests/ociswrapper/wrapper/handlers/handler.go | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/ociswrapper/ocis/ocis.go b/tests/ociswrapper/ocis/ocis.go index a867b6b51b9..4570a3f93d6 100644 --- a/tests/ociswrapper/ocis/ocis.go +++ b/tests/ociswrapper/ocis/ocis.go @@ -285,6 +285,8 @@ func RunOcisService(service string) { cmd = exec.Command(config.Get("bin"), service, "server") + cmd.Env = append(os.Environ(), EnvConfigs...) + logs, err := cmd.StderrPipe() if err != nil { log.Panic(err) diff --git a/tests/ociswrapper/wrapper/handlers/handler.go b/tests/ociswrapper/wrapper/handlers/handler.go index 9154fd02ccf..30f828f3e7d 100644 --- a/tests/ociswrapper/wrapper/handlers/handler.go +++ b/tests/ociswrapper/wrapper/handlers/handler.go @@ -223,7 +223,8 @@ func OcisServiceHandler(res http.ResponseWriter, req *http.Request) { success, _ := ocis.Restart(ocis.EnvConfigs) if success { sendResponse(res, http.StatusOK, "oCIS configured successfully") - ocis.RunOcisService(serviceName) + go ocis.RunOcisService(serviceName) + sendResponse(res, http.StatusOK, "oCIS server started successfully") return } sendResponse(res, http.StatusInternalServerError, "Failed to restart oCIS with new configuration")