Skip to content

Commit

Permalink
fix: Run gin in release mode and print local webui url
Browse files Browse the repository at this point in the history
  • Loading branch information
codablock committed Aug 23, 2023
1 parent a84c011 commit a1fdd32
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/webui/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"k8s.io/client-go/rest"
"net"
"net/http"
"os"
"sigs.k8s.io/controller-runtime/pkg/client"
"time"
)
Expand Down Expand Up @@ -94,6 +95,10 @@ func (s *CommandResultsServer) Run(host string, port int) error {

s.cam.start()

if os.Getenv(gin.EnvGinMode) == "" {
gin.SetMode(gin.ReleaseMode)
}

router := gin.New()
router.Use(gin.LoggerWithConfig(gin.LoggerConfig{
SkipPaths: []string{"/healthz", "/readyz"},
Expand Down Expand Up @@ -152,6 +157,8 @@ func (s *CommandResultsServer) Run(host string, port int) error {
Handler: router.Handler(),
}

status.Infof(s.ctx, "Webui is available at: http://%s\n", address)

return httpServer.Serve(listener)
}

Expand Down

0 comments on commit a1fdd32

Please sign in to comment.