Skip to content

Commit

Permalink
Merge branch 'master' of github.com:mccv1r0/plugins into pr75
Browse files Browse the repository at this point in the history
  • Loading branch information
mccv1r0 committed Apr 9, 2019
2 parents 4d7722a + fbd9acc commit c86be21
Show file tree
Hide file tree
Showing 3 changed files with 3 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 @@ -172,7 +172,7 @@ func runDaemon(pidfilePath string, hostPrefix string, socketPath string) error {
}
}

l, err := getListener(socketPath)
l, err := getListener(hostPrefix + socketPath)
if err != nil {
return fmt.Errorf("Error getting listener: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/ipam/dhcp/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func main() {
var socketPath 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:])

Expand Down

0 comments on commit c86be21

Please sign in to comment.