mirror of
https://github.com/gravitl/netmaker.git
synced 2025-02-25 16:44:01 +08:00
fixing donotpropagate
This commit is contained in:
parent
cf26b31779
commit
cacab5c30b
3 changed files with 11 additions and 6 deletions
|
@ -42,6 +42,11 @@ func GetPeersList(networkName string) ([]models.Node, error) {
|
|||
peer.IsEgressGateway = node.IsEgressGateway
|
||||
}
|
||||
if node.Network == networkName && node.IsPending != "yes" {
|
||||
if node.IsRelay == "yes" { // handle relay stuff
|
||||
peer.RelayAddrs = node.RelayAddrs
|
||||
peer.IsRelay = node.IsRelay
|
||||
}
|
||||
peer.DoNotPropagate = node.DoNotPropagate
|
||||
peer.PublicKey = node.PublicKey
|
||||
peer.Endpoint = node.Endpoint
|
||||
peer.LocalAddress = node.LocalAddress
|
||||
|
|
|
@ -87,7 +87,7 @@ func SetNodesDoNotPropagate(yesOrno string, networkName string, addrs []string)
|
|||
if node.Network == networkName {
|
||||
for _, addr := range addrs {
|
||||
if addr == node.Address || addr == node.Address6 {
|
||||
node.DoNotPropogate = yesOrno
|
||||
node.DoNotPropagate = yesOrno
|
||||
data, err := json.Marshal(&node)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
@ -52,7 +52,7 @@ type Node struct {
|
|||
CheckInInterval int32 `json:"checkininterval" bson:"checkininterval" yaml:"checkininterval"`
|
||||
Password string `json:"password" bson:"password" yaml:"password" validate:"required,min=6"`
|
||||
Network string `json:"network" bson:"network" yaml:"network" validate:"network_exists"`
|
||||
DoNotPropogate string `json:"donotpropogate" bson:"donotpropogate" yaml:"donotpropogate"`
|
||||
DoNotPropagate string `json:"donotpropagate" bson:"donotpropagate" yaml:"donotpropagate"`
|
||||
IsPending string `json:"ispending" bson:"ispending" yaml:"ispending"`
|
||||
IsRelay string `json:"isrelay" bson:"isrelay" yaml:"isrelay"`
|
||||
IsEgressGateway string `json:"isegressgateway" bson:"isegressgateway" yaml:"isegressgateway"`
|
||||
|
@ -87,9 +87,9 @@ func (node *Node) SetDefaulIsPending() {
|
|||
}
|
||||
}
|
||||
|
||||
func (node *Node) SetDefaultDoNotPropogate() {
|
||||
if node.DoNotPropogate == "" {
|
||||
node.DoNotPropogate = "no"
|
||||
func (node *Node) SetDefaultDoNotPropagate() {
|
||||
if node.DoNotPropagate == "" {
|
||||
node.DoNotPropagate = "no"
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -284,7 +284,7 @@ func (node *Node) SetDefaults() {
|
|||
node.SetDefaultIngressGateway()
|
||||
node.SetDefaulIsPending()
|
||||
node.SetDefaultMTU()
|
||||
node.SetDefaultDoNotPropogate()
|
||||
node.SetDefaultDoNotPropagate()
|
||||
node.SetDefaultIsRelay()
|
||||
node.KeyUpdateTimeStamp = time.Now().Unix()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue