Force namespace via cmdline parameter (#53)

* Force name via cmdline parameter

* Use a library to parse CLI flags

* Use less env vars

* Document it
This commit is contained in:
Andrey Pokhilko
2022-10-28 12:39:19 +01:00
committed by GitHub
parent d9edcf2f48
commit 786bddc478
8 changed files with 93 additions and 30 deletions

View File

@@ -44,9 +44,9 @@ func contextSetter(data *subproc.DataLayer) gin.HandlerFunc {
}
}
func NewRouter(abortWeb utils.ControlChan, data *subproc.DataLayer) *gin.Engine {
func NewRouter(abortWeb utils.ControlChan, data *subproc.DataLayer, debug bool) *gin.Engine {
var api *gin.Engine
if os.Getenv("DEBUG") == "" {
if debug {
api = gin.New()
api.Use(gin.Recovery())
} else {