refactor + bugs

This commit is contained in:
0xdcarns
2022-04-25 19:33:31 -04:00
parent a6ee8101e6
commit cfb0904bd6
2 changed files with 8 additions and 0 deletions

View File

@@ -15,6 +15,7 @@ import (
"github.com/gravitl/netmaker/netclient/local"
"github.com/gravitl/netmaker/netclient/ncutils"
"github.com/gravitl/netmaker/netclient/wireguard"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
//homedir "github.com/mitchellh/go-homedir"
)
@@ -53,6 +54,10 @@ func Pull(network string, iface bool) (*models.Node, error) {
resNode := nodeGET.Node
// ensure that the OS never changes
resNode.OS = runtime.GOOS
if nodeGET.Peers == nil {
nodeGET.Peers = []wgtypes.PeerConfig{}
}
if iface {
if err = config.ModConfig(&resNode); err != nil {
return nil, err