diff --git a/handlers.go b/handlers.go index 6bdefc7..8bf143a 100644 --- a/handlers.go +++ b/handlers.go @@ -375,11 +375,17 @@ func (app *App) HandleStatus(w http.ResponseWriter, r *http.Request) { } func parseImage(image string) (container string) { - pref, err := regexp.Compile("[^a-zA-Z0-9]+") - if err != nil { - return "selenoid-browser" + browser := "browser" + if len(image) > 0 { + pref, err := regexp.Compile("[^a-zA-Z0-9]+") + if err != nil { + return browser + } + fragments := strings.Split(image, "/") + image = fragments[len(fragments)-1] + return pref.ReplaceAllString(image, "-") } - return pref.ReplaceAllString(image, "-") + return browser } func getSessionStats(sessions []platform.Service) (active []platform.Service, pending []platform.Service) { diff --git a/selenosis.go b/selenosis.go index f463bdd..407fb4e 100644 --- a/selenosis.go +++ b/selenosis.go @@ -63,7 +63,7 @@ func New(logger *log.Logger, client platform.Platform, browsers *config.Browsers if quota, err = client.Quota().Get(); err != nil { quota, err = client.Quota().Create(currentTotal()) if err != nil { - logger.Errorf("failed to create quota resource: %v", err) + logger.Fatalf("failed to create quota resource: %v", err) } }