Skip to content

Commit

Permalink
pass waitgroup pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
luthermonson committed Jul 24, 2020
1 parent 393b18b commit 117c102
Show file tree
Hide file tree
Showing 16 changed files with 16 additions and 16 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ gofmt:
verify-modules:
$(if $(shell which go),,$(error "go not found in PATH"))
go mod tidy
go vet

gofmt-fix:
docker run -e CGO_ENABLED=$(CGO_ENABLED) -e GOARCH=$(ARCH) \
Expand Down
2 changes: 1 addition & 1 deletion backend/alivpc/alivpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func New(sm subnet.Manager, extIface *backend.ExternalInterface) (backend.Backen
return &be, nil
}

func (be *AliVpcBackend) RegisterNetwork(ctx context.Context, wg sync.WaitGroup, config *subnet.Config) (backend.Network, error) {
func (be *AliVpcBackend) RegisterNetwork(ctx context.Context, wg *sync.WaitGroup, config *subnet.Config) (backend.Network, error) {
// 1. Parse our configuration
cfg := struct {
AccessKeyID string
Expand Down
2 changes: 1 addition & 1 deletion backend/alloc/alloc.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func New(sm subnet.Manager, extIface *backend.ExternalInterface) (backend.Backen
return &be, nil
}

func (be *AllocBackend) RegisterNetwork(ctx context.Context, wg sync.WaitGroup, config *subnet.Config) (backend.Network, error) {
func (be *AllocBackend) RegisterNetwork(ctx context.Context, wg *sync.WaitGroup, config *subnet.Config) (backend.Network, error) {
attrs := subnet.LeaseAttrs{
PublicIP: ip.FromIP(be.extIface.ExtAddr),
}
Expand Down
2 changes: 1 addition & 1 deletion backend/awsvpc/awsvpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (conf *backendConfig) routeTableConfigured() bool {
return configured
}

func (be *AwsVpcBackend) RegisterNetwork(ctx context.Context, wg sync.WaitGroup, config *subnet.Config) (backend.Network, error) {
func (be *AwsVpcBackend) RegisterNetwork(ctx context.Context, wg *sync.WaitGroup, config *subnet.Config) (backend.Network, error) {
// Parse our configuration
var cfg backendConfig

Expand Down
2 changes: 1 addition & 1 deletion backend/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type ExternalInterface struct {
// needed.
type Backend interface {
// Called when the backend should create or begin managing a new network
RegisterNetwork(ctx context.Context, wg sync.WaitGroup, config *subnet.Config) (Network, error)
RegisterNetwork(ctx context.Context, wg *sync.WaitGroup, config *subnet.Config) (Network, error)
}

type Network interface {
Expand Down
2 changes: 1 addition & 1 deletion backend/extension/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (_ *ExtensionBackend) Run(ctx context.Context) {
<-ctx.Done()
}

func (be *ExtensionBackend) RegisterNetwork(ctx context.Context, wg sync.WaitGroup, config *subnet.Config) (backend.Network, error) {
func (be *ExtensionBackend) RegisterNetwork(ctx context.Context, wg *sync.WaitGroup, config *subnet.Config) (backend.Network, error) {
n := &network{
extIface: be.extIface,
sm: be.sm,
Expand Down
2 changes: 1 addition & 1 deletion backend/gce/gce.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (g *GCEBackend) ensureAPI() error {
return err
}

func (g *GCEBackend) RegisterNetwork(ctx context.Context, wg sync.WaitGroup, config *subnet.Config) (backend.Network, error) {
func (g *GCEBackend) RegisterNetwork(ctx context.Context, wg *sync.WaitGroup, config *subnet.Config) (backend.Network, error) {
attrs := subnet.LeaseAttrs{
PublicIP: ip.FromIP(g.extIface.ExtAddr),
}
Expand Down
2 changes: 1 addition & 1 deletion backend/hostgw/hostgw.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func New(sm subnet.Manager, extIface *backend.ExternalInterface) (backend.Backen
return be, nil
}

func (be *HostgwBackend) RegisterNetwork(ctx context.Context, wg sync.WaitGroup, config *subnet.Config) (backend.Network, error) {
func (be *HostgwBackend) RegisterNetwork(ctx context.Context, wg *sync.WaitGroup, config *subnet.Config) (backend.Network, error) {
n := &backend.RouteNetwork{
SimpleNetwork: backend.SimpleNetwork{
ExtIface: be.extIface,
Expand Down
2 changes: 1 addition & 1 deletion backend/hostgw/hostgw_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func New(sm subnet.Manager, extIface *backend.ExternalInterface) (backend.Backen
return be, nil
}

func (be *HostgwBackend) RegisterNetwork(ctx context.Context, wg sync.WaitGroup, config *subnet.Config) (backend.Network, error) {
func (be *HostgwBackend) RegisterNetwork(ctx context.Context, wg *sync.WaitGroup, config *subnet.Config) (backend.Network, error) {
// 1. Parse configuration
cfg := struct {
Name string
Expand Down
2 changes: 1 addition & 1 deletion backend/ipip/ipip.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func New(sm subnet.Manager, extIface *backend.ExternalInterface) (backend.Backen
return be, nil
}

func (be *IPIPBackend) RegisterNetwork(ctx context.Context, wg sync.WaitGroup, config *subnet.Config) (backend.Network, error) {
func (be *IPIPBackend) RegisterNetwork(ctx context.Context, wg *sync.WaitGroup, config *subnet.Config) (backend.Network, error) {
cfg := struct {
DirectRouting bool
}{}
Expand Down
3 changes: 1 addition & 2 deletions backend/ipsec/handle_charon.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ type CharonIKEDaemon struct {
ctx context.Context
}

func NewCharonIKEDaemon(ctx context.Context, wg sync.WaitGroup, espProposal string) (*CharonIKEDaemon, error) {

func NewCharonIKEDaemon(ctx context.Context, wg *sync.WaitGroup, espProposal string) (*CharonIKEDaemon, error) {
charon := &CharonIKEDaemon{ctx: ctx, espProposal: espProposal}

addr := strings.Split("unix:///var/run/charon.vici", "://")
Expand Down
2 changes: 1 addition & 1 deletion backend/ipsec/ipsec.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func New(sm subnet.Manager, extIface *backend.ExternalInterface) (
}

func (be *IPSECBackend) RegisterNetwork(
ctx context.Context, wg sync.WaitGroup, config *subnet.Config) (backend.Network, error) {
ctx context.Context, wg *sync.WaitGroup, config *subnet.Config) (backend.Network, error) {

cfg := struct {
UDPEncap bool
Expand Down
2 changes: 1 addition & 1 deletion backend/udp/udp_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func New(sm subnet.Manager, extIface *backend.ExternalInterface) (backend.Backen
return &be, nil
}

func (be *UdpBackend) RegisterNetwork(ctx context.Context, wg sync.WaitGroup, config *subnet.Config) (backend.Network, error) {
func (be *UdpBackend) RegisterNetwork(ctx context.Context, wg *sync.WaitGroup, config *subnet.Config) (backend.Network, error) {
cfg := struct {
Port int
}{
Expand Down
2 changes: 1 addition & 1 deletion backend/vxlan/vxlan.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func newSubnetAttrs(publicIP net.IP, mac net.HardwareAddr) (*subnet.LeaseAttrs,
}, nil
}

func (be *VXLANBackend) RegisterNetwork(ctx context.Context, wg sync.WaitGroup, config *subnet.Config) (backend.Network, error) {
func (be *VXLANBackend) RegisterNetwork(ctx context.Context, wg *sync.WaitGroup, config *subnet.Config) (backend.Network, error) {
// Parse our configuration
cfg := struct {
VNI int
Expand Down
2 changes: 1 addition & 1 deletion backend/vxlan/vxlan_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func newSubnetAttrs(publicIP net.IP, vnid uint16, mac net.HardwareAddr) (*subnet
}, nil
}

func (be *VXLANBackend) RegisterNetwork(ctx context.Context, wg sync.WaitGroup, config *subnet.Config) (backend.Network, error) {
func (be *VXLANBackend) RegisterNetwork(ctx context.Context, wg *sync.WaitGroup, config *subnet.Config) (backend.Network, error) {
// 1. Parse configuration
cfg := struct {
Name string
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ func main() {
os.Exit(1)
}

bn, err := be.RegisterNetwork(ctx, wg, config)
bn, err := be.RegisterNetwork(ctx, &wg, config)
if err != nil {
log.Errorf("Error registering network: %s", err)
cancel()
Expand Down

0 comments on commit 117c102

Please sign in to comment.