From 3bbc43f24de46d64bab1c666c956081ab4e235b2 Mon Sep 17 00:00:00 2001 From: Alban Crequy Date: Tue, 26 Jan 2016 18:54:56 +0100 Subject: [PATCH] *: add "dns" field to the configuration appc/cni#76 added a "dns" field in the result JSON. But before this patch, the plugins had no way of knowing which name server to return. There could be two ways of knowing which name server to return: 1. add it as an extra argument ("CNI_ARGS") 2. add it in the network configuration as a convenience (received via stdin) I chose the second way because it is easier. In the case of rkt, it means the user could just add the DNS name servers in /etc/rkt/net.d/mynetwork.conf. --- types/types.go | 1 + 1 file changed, 1 insertion(+) diff --git a/types/types.go b/types/types.go index 7fce5b82..e5558be4 100644 --- a/types/types.go +++ b/types/types.go @@ -67,6 +67,7 @@ type NetConf struct { type Result struct { IP4 *IPConfig `json:"ip4,omitempty"` IP6 *IPConfig `json:"ip6,omitempty"` + DNS []string `json:"dns,omitempty"` } func (r *Result) Print() error {