Files
weave/prog/weavewait/main.go
T
Bryan Boreham 2eed101a93 In weavewait, wait for the multicast route to be added before calling container entrypoint.
We have moved the 'route add' command to the end of 'attach', so this
indicates that all network interface set-up is complete.
2015-08-27 15:10:31 +01:00

41 lines
567 B
Go

package main
import (
"errors"
"fmt"
"os"
"os/exec"
"syscall"
weavenet "github.com/weaveworks/weave/net"
)
var (
ErrNoCommandSpecified = errors.New("No command specified")
)
func main() {
var (
args = os.Args[1:]
)
_, err := weavenet.EnsureInterfaceAndMcastRoute("ethwe")
checkErr(err)
if len(args) == 0 {
checkErr(ErrNoCommandSpecified)
}
binary, err := exec.LookPath(args[0])
checkErr(err)
checkErr(syscall.Exec(binary, args, os.Environ()))
}
func checkErr(err error) {
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}