Skip to content

Commit 9df78e4

Browse files
committed
[tunnel] Minor style fixes
1 parent a81e531 commit 9df78e4

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

pkg/cmd/tunnel/cmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ func init() {
214214
createCmd.Flags().StringVarP(&tunnelNodeFile, "file", "f", "", "Path to the TunnelNode file to create.")
215215
updateCmd.Flags().StringVarP(&tunnelNodeFile, "file", "f", "", "Path to the TunnelNode file to update.")
216216
tunnelRunCmd.Flags().StringVarP(&tunnelNodePcapPath, "pcap", "p", "", "Path to the TunnelNode file to create.")
217-
tunnelRunCmd.Flags().StringVarP(&tunnelModeS, "mode", "m", "", "Mode to run the TunnelNode in")
217+
tunnelRunCmd.Flags().StringVarP(&tunnelModeS, "mode", "m", "user", "Mode to run the TunnelNode in.")
218218

219219
tunnelCmd.AddCommand(createCmd)
220220
tunnelCmd.AddCommand(getCmd)

pkg/cmd/tunnel/run.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ func (t *tunnelNodeReconciler) Reconcile(ctx context.Context, req ctrl.Request)
225225
RequeueAfter: time.Second,
226226
}, nil
227227
} else {
228-
cOpts = append(cOpts, tunnel.WithServerAddr(tunnelNode.Status.Addresses[rand.Intn(len(tunnelNode.Status.Addresses))]))
228+
srvAddr := tunnelNode.Status.Addresses[rand.Intn(len(tunnelNode.Status.Addresses))]
229+
cOpts = append(cOpts, tunnel.WithServerAddr(srvAddr))
229230
}
230231
}
231232
if t.cfg.IsLocalMode {

pkg/tunnel/router/server_netlink_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func NewNetlinkRouter(opts ...Option) (*NetlinkRouter, error) {
5454

5555
extLink, err := netlink.LinkByName(options.extIfaceName)
5656
if err != nil {
57-
return nil, fmt.Errorf("failed to get external interface: %w", err)
57+
return nil, fmt.Errorf("failed to get external interface %s: %w", options.extIfaceName, err)
5858
}
5959

6060
tunDev, err := tun.CreateTUN(options.tunIfaceName, netstack.IPv6MinMTU)

0 commit comments

Comments
 (0)