Skip to content

Commit

Permalink
fix shutdown
Browse files Browse the repository at this point in the history
Signed-off-by: Fabrice Aneche <[email protected]>
  • Loading branch information
akhenakh committed Sep 25, 2024
1 parent 1612031 commit 488c6e5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions cmd/sshjump/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type EnvConfig struct {

var (
grpcHealthServer *grpc.Server
sshServer *ssh.Server
sshServer *Server
httpMetricsServer *http.Server
)

Expand Down Expand Up @@ -101,10 +101,10 @@ func main() {
os.Exit(1)
}

s := NewServer(logger, healthServer, signer, keys, clientset)
sshServer = NewServer(logger, healthServer, signer, keys, clientset)

// start watching for config change
if err := s.StartWatchConfig(ctx, envCfg.ConfigPath); err != nil {
if err := sshServer.StartWatchConfig(ctx, envCfg.ConfigPath); err != nil {
logger.Error("failed to start watch config", "error", err)
os.Exit(1)
}
Expand All @@ -116,7 +116,7 @@ func main() {

// ssh server
g.Go(func() error {
return startSSHServer(logger, envCfg, s)
return startSSHServer(logger, envCfg, sshServer)
})

select {
Expand Down Expand Up @@ -147,7 +147,7 @@ func main() {
grpcHealthServer.GracefulStop()
}

s.StopWatchConfig()
sshServer.StopWatchConfig()

err = g.Wait()
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion helm/templates/tcproute.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
parentRefs:
- group: gateway.networking.k8s.io
kind: Gateway
name: {{ .Values.tcpRoute.gatewayName }}
name: {{ .Values.tcpRoute.gatewayName }}
namespace: {{ .Values.tcpRoute.gatewayNamespace }}
rules:
- backendRefs:
Expand Down

0 comments on commit 488c6e5

Please sign in to comment.