Replace klog with non-exiting fork

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
This commit is contained in:
Brad Davidson
2021-09-08 10:56:18 -07:00
committed by Brad Davidson
parent 90960ebf4e
commit 29c8b238e5
18 changed files with 102 additions and 81 deletions

View File

@@ -3,6 +3,7 @@ package cluster
import (
"context"
"crypto/tls"
"errors"
"log"
"net"
"net/http"
@@ -85,7 +86,9 @@ func (c *Cluster) initClusterAndHTTPS(ctx context.Context) error {
// Start the supervisor http server on the tls listener
go func() {
err := server.Serve(listener)
logrus.Fatalf("server stopped: %v", err)
if err != nil && !errors.Is(err, http.ErrServerClosed) {
logrus.Fatalf("server stopped: %v", err)
}
}()
// Shutdown the http server when the context is closed