Replace klog with non-exiting fork

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 29c8b238e5)
This commit is contained in:
Brad Davidson
2021-09-08 10:56:18 -07:00
committed by Brad Davidson
parent 30c7723c03
commit 7364fe8cc6
15 changed files with 92 additions and 75 deletions

View File

@@ -3,6 +3,7 @@ package cluster
import (
"context"
"crypto/tls"
"errors"
"io/ioutil"
"log"
"net"
@@ -91,7 +92,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