Skip to content

Commit c07f4d8

Browse files
committed
[cmd/alpha/tunnel] Set keepalive to 5s
1 parent 688a804 commit c07f4d8

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

pkg/cmd/alpha/tunnel.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ var createCmd = &cobra.Command{
5656
} else {
5757
return fmt.Errorf("either --file or stdin must be specified")
5858
}
59+
if err != nil {
60+
return fmt.Errorf("failed to load TunnelNode: %w", err)
61+
}
5962

6063
_, err = client.CoreV1alpha().TunnelNodes().Create(ctx, tunnelNode, metav1.CreateOptions{})
6164
if err != nil {

pkg/cmd/alpha/tunnel_run.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,9 +322,10 @@ func syncTunnelNode(tunnelNodeLister corev1alphaclient.TunnelNodeLister,
322322
peerTunnelNode := peerTunnelNodes[peerPublicKey]
323323

324324
peerConf := &wireguard.PeerConfig{
325-
PublicKey: ptr.To(peerTunnelNode.Status.PublicKey),
326-
Endpoint: ptr.To(peerTunnelNode.Status.ExternalAddress),
327-
AllowedIPs: []string{peerTunnelNode.Status.InternalAddress},
325+
PublicKey: ptr.To(peerTunnelNode.Status.PublicKey),
326+
Endpoint: ptr.To(peerTunnelNode.Status.ExternalAddress),
327+
AllowedIPs: []string{peerTunnelNode.Status.InternalAddress},
328+
PersistentKeepaliveIntervalSec: ptr.To(uint16(5)),
328329
}
329330

330331
slog.Debug("Adding peer",

0 commit comments

Comments
 (0)