Fix bug when using tailscale config by file

Signed-off-by: Manuel Buil <mbuil@suse.com>
pull/10214/head
Manuel Buil 2024-05-07 11:29:47 +02:00
parent 0029d7a71e
commit 2593230e51
1 changed files with 4 additions and 4 deletions

View File

@ -90,16 +90,16 @@ func Run(ctx *cli.Context) error {
contextCtx := signals.SetupSignalContext() contextCtx := signals.SetupSignalContext()
go cmds.WriteCoverage(contextCtx) go cmds.WriteCoverage(contextCtx)
if cmds.AgentConfig.VPNAuthFile != "" { if cfg.VPNAuthFile != "" {
cmds.AgentConfig.VPNAuth, err = util.ReadFile(cmds.AgentConfig.VPNAuthFile) cfg.VPNAuth, err = util.ReadFile(cfg.VPNAuthFile)
if err != nil { if err != nil {
return err return err
} }
} }
// Starts the VPN in the agent if config was set up // Starts the VPN in the agent if config was set up
if cmds.AgentConfig.VPNAuth != "" { if cfg.VPNAuth != "" {
err := vpn.StartVPN(cmds.AgentConfig.VPNAuth) err := vpn.StartVPN(cfg.VPNAuth)
if err != nil { if err != nil {
return err return err
} }