Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/ipam/host-local/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func cmdAdd(args *skel.CmdArgs) error {
if err != nil {
return err
}
result.DNS = *dns
result.DNS = dns
}

store, err := disk.New(ipamConf.Name, ipamConf.DataDir)
Expand Down
2 changes: 1 addition & 1 deletion plugins/ipam/static/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ func cmdAdd(args *skel.CmdArgs) error {

result := &current.Result{
CNIVersion: current.ImplementedSpecVersion,
DNS: ipamConf.DNS,
DNS: &ipamConf.DNS,
Routes: ipamConf.Routes,
}
for _, v := range ipamConf.Addresses {
Expand Down
9 changes: 1 addition & 8 deletions plugins/main/bridge/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ func cmdAdd(args *skel.CmdArgs) error {

// Use incoming DNS settings if provided, otherwise use the
// settings that were already configued by the IPAM plugin
if dnsConfSet(n.DNS) {
if n.DNS != nil {
result.DNS = n.DNS
}

Expand All @@ -743,13 +743,6 @@ func cmdAdd(args *skel.CmdArgs) error {
return types.PrintResult(result, cniVersion)
}

func dnsConfSet(dnsConf types.DNS) bool {
return dnsConf.Nameservers != nil ||
dnsConf.Search != nil ||
dnsConf.Options != nil ||
dnsConf.Domain != ""
}

func cmdDel(args *skel.CmdArgs) error {
n, _, err := loadNetConf(args.StdinData, args.Args)
if err != nil {
Expand Down
9 changes: 1 addition & 8 deletions plugins/main/ptp/ptp.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,20 +241,13 @@ func cmdAdd(args *skel.CmdArgs) error {
// Only override the DNS settings in the previous result if any DNS fields
// were provided to the ptp plugin. This allows, for example, IPAM plugins
// to specify the DNS settings instead of the ptp plugin.
if dnsConfSet(conf.DNS) {
if conf.DNS != nil {
result.DNS = conf.DNS
}

return types.PrintResult(result, conf.CNIVersion)
}

func dnsConfSet(dnsConf types.DNS) bool {
return dnsConf.Nameservers != nil ||
dnsConf.Search != nil ||
dnsConf.Options != nil ||
dnsConf.Domain != ""
}

func cmdDel(args *skel.CmdArgs) error {
conf := NetConf{}
if err := json.Unmarshal(args.StdinData, &conf); err != nil {
Expand Down