ipam/host-local: add ResolvConf argument for DNS configuration
This adds the option `resolvConf` to the host-local IPAM configuration. If specified, the plugin will try to parse the file as a resolv.conf(5) type file and return it in the DNS response.
This commit is contained in:

committed by
Casey Callendrello

parent
4406607649
commit
5cde14cd7b
@ -33,6 +33,16 @@ func cmdAdd(args *skel.CmdArgs) error {
|
||||
return err
|
||||
}
|
||||
|
||||
r := types.Result{}
|
||||
|
||||
if ipamConf.ResolvConf != "" {
|
||||
dns, err := parseResolvConf(ipamConf.ResolvConf)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
r.DNS = *dns
|
||||
}
|
||||
|
||||
store, err := disk.New(ipamConf.Name, ipamConf.DataDir)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -48,10 +58,8 @@ func cmdAdd(args *skel.CmdArgs) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
r.IP4 = ipConf
|
||||
|
||||
r := &types.Result{
|
||||
IP4: ipConf,
|
||||
}
|
||||
return r.Print()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user