@@ -16,8 +16,9 @@ type ConfigDB struct {
1616 ACLTables map [string ]ACLTable `json:"ACL_TABLE,omitempty"`
1717 Breakouts map [string ]BreakoutConfig `json:"BREAKOUT_CFG,omitempty"`
1818 DeviceMetadata `json:"DEVICE_METADATA"`
19- Features map [string ]Feature `json:"FEATURE,omitempty"`
20- Interfaces map [string ]Interface `json:"INTERFACE,omitempty"`
19+ DNSNameservers map [string ]DNSNameserver `json:"DNS_NAMESERVER,omitempty"`
20+ Features map [string ]Feature `json:"FEATURE,omitempty"`
21+ Interfaces map [string ]Interface `json:"INTERFACE,omitempty"`
2122 LLDP `json:"LLDP"`
2223 LoopbackInterface map [string ]struct {} `json:"LOOPBACK_INTERFACE,omitempty"`
2324 MCLAGDomains map [string ]MCLAGDomain `json:"MCLAG_DOMAIN,omitempty"`
@@ -59,6 +60,7 @@ func GenerateConfigDB(input *values.Values, platform *p.Platform, currentDeviceM
5960 ACLTables : tables ,
6061 Breakouts : breakouts ,
6162 DeviceMetadata : * deviceMetadata ,
63+ DNSNameservers : getDNSNameservers (input .Nameservers ),
6264 Features : map [string ]Feature {
6365 "dhcp_relay" : {
6466 AutoRestart : FeatureModeEnabled ,
@@ -207,6 +209,14 @@ func getDeviceMetadata(input *values.Values, currentMetadata DeviceMetadata) (*D
207209 }, nil
208210}
209211
212+ func getDNSNameservers (nameservers []string ) map [string ]DNSNameserver {
213+ dnsNameservers := make (map [string ]DNSNameserver )
214+ for _ , n := range nameservers {
215+ dnsNameservers [n ] = DNSNameserver {}
216+ }
217+ return dnsNameservers
218+ }
219+
210220func getInterfaces (ports []values.Port , bgpPorts []string ) map [string ]Interface {
211221 interfaces := make (map [string ]Interface )
212222
0 commit comments