Skip to content

Add OpenConfig DNS provider implementation - #471

Open
rgildein wants to merge 5 commits into
mainfrom
feat/openconfig-dns
Open

Add OpenConfig DNS provider implementation#471
rgildein wants to merge 5 commits into
mainfrom
feat/openconfig-dns

Conversation

@rgildein

Copy link
Copy Markdown

Implement EnsureDNS and DeleteDNS for the OpenConfig provider targeting SR Linux via gNMI. Maps DNSSpec. Domain to /system/dns/config/search and DNSSpec.Servers to /system/dns/servers/server list.
Rejects unsupported fields (adminState: Down, sourceInterfaceName, vrfName) with explicit UnsupportedFieldError.

How I tested it

$ kubectl apply -f - <<EOF
  apiVersion: networking.metal.ironcore.dev/v1alpha1
  kind: DNS
  metadata:
    name: dns
    namespace: default
  spec:
    deviceRef:
      name: leaf1
    domain: example.com
    servers:
      - address: 8.8.8.8
      - address: 1.1.1.1
EOF
dns.networking.metal.ironcore.dev/dns configured
$ gnmic -a 172.20.20.2 --port 57400 -u admin -p 'NokiaSrl1!' --skip-verify --encoding JSON_IETF get --path "openconfig-system:system/dns"
[
  {
    "source": "172.20.20.2",
    "timestamp": 1785331298950342192,
    "time": "2026-07-29T15:21:38.950342192+02:00",
    "updates": [
      {
        "Path": "openconfig-system:system/dns",
        "values": {
          "openconfig-system:system/dns": {
            "config": {
              "search": [
                "example.com"
              ]
            },
            "host-entries": {},
            "servers": {
              "server": [
                {
                  "address": "8.8.8.8",
                  "config": {
                    "address": "8.8.8.8"
                  },
                  "state": {
                    "address": "8.8.8.8"
                  }
                },
                {
                  "address": "1.1.1.1",
                  "config": {
                    "address": "1.1.1.1"
                  },
                  "state": {
                    "address": "1.1.1.1"
                  }
                }
              ]
            },
            "state": {
              "search": [
                "example.com"
              ]
            }
          }
        }
      }
    ]
  }
]

Implement EnsureDNS and DeleteDNS for the OpenConfig provider targeting
SR Linux via gNMI. Maps DNSSpec.Domain to /system/dns/config/search and
DNSSpec.Servers to /system/dns/servers/server list. Rejects unsupported
fields (adminState: Down, sourceInterfaceName, vrfName) with explicit
UnsupportedFieldError.

Signed-off-by: Robert Gildein <rgildein@users.noreply.github.com>
@rgildein rgildein self-assigned this Jul 30, 2026
@rgildein rgildein added the area/switch-automation Automation processes for network switch management and operations. label Jul 30, 2026
@rgildein
rgildein marked this pull request as ready for review August 4, 2026 08:59
Comment thread internal/provider/openconfig/dns_test.go Outdated
rgildein and others added 2 commits August 5, 2026 12:58
Signed-off-by: Robert Gildein <rgildein@users.noreply.github.com>
Comment thread internal/provider/openconfig/testdata/dns.json Outdated
Signed-off-by: Robert Gildein <rgildein@users.noreply.github.com>
@rgildein
rgildein force-pushed the feat/openconfig-dns branch from e266713 to 5f86770 Compare August 7, 2026 08:07
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

Merging this branch will not change overall coverage

Impacted Packages Coverage Δ 🤖
github.com/ironcore-dev/network-operator/internal/provider/openconfig 0.00% (ø)

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/ironcore-dev/network-operator/internal/provider/openconfig/dns.go 0.00% (ø) 23 (+23) 0 23 (+23)

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/switch-automation Automation processes for network switch management and operations. size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants