Skip to content

Commit

Permalink
Merge branch 'master' into pr75
Browse files Browse the repository at this point in the history
  • Loading branch information
mccv1r0 authored Apr 9, 2019
2 parents dd1a949 + fbd9acc commit 0ab8aaa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugins/ipam/dhcp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ ./dhcp daemon

If given `-pidfile <path>` arguments after 'daemon', the dhcp plugin will write
its PID to the given file.
If given `-hostprefix <prefix>` arguments after 'daemon', the dhcp plugin will use this prefix for netns as `<prefix>/<original netns>`. It could be used in case of running dhcp daemon as container.
If given `-hostprefix <prefix>` arguments after 'daemon', the dhcp plugin will use this prefix for DHCP socket as `<prefix>/run/cni/dhcp.sock`. You can use this prefix for references to the host filesystem, e.g. to access netns and the unix socket.

Alternatively, you can use systemd socket activation protocol.
Be sure that the .socket file uses /run/cni/dhcp.sock as the socket path.
Expand Down
2 changes: 1 addition & 1 deletion plugins/ipam/dhcp/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func runDaemon(pidfilePath string, hostPrefix string) error {
}
}

l, err := getListener()
l, err := getListener(hostPrefix + socketPath)
if err != nil {
return fmt.Errorf("Error getting listener: %v", err)
}
Expand Down
3 changes: 2 additions & 1 deletion plugins/ipam/dhcp/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ func main() {
var hostPrefix string
daemonFlags := flag.NewFlagSet("daemon", flag.ExitOnError)
daemonFlags.StringVar(&pidfilePath, "pidfile", "", "optional path to write daemon PID to")
daemonFlags.StringVar(&hostPrefix, "hostprefix", "", "optional prefix to netns")
daemonFlags.StringVar(&hostPrefix, "hostprefix", "", "optional prefix to host root")
daemonFlags.StringVar(&socketPath, "socketpath", "", "optional dhcp server socketpath")
daemonFlags.Parse(os.Args[2:])

if err := runDaemon(pidfilePath, hostPrefix); err != nil {
Expand Down

0 comments on commit 0ab8aaa

Please sign in to comment.