From 8a95fbc00651136bb0d20017d46a900dc43c6bf1 Mon Sep 17 00:00:00 2001 From: Gerard Nguyen Date: Mon, 30 Dec 2024 16:21:02 +1100 Subject: [PATCH] feat: [sc-117743] preflight check: ensure valid nameservers in /etc/resolv.conf (#1665) --- pkg/preflights/host-preflight.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkg/preflights/host-preflight.yaml b/pkg/preflights/host-preflight.yaml index 6d8341ce6..091e0fdde 100644 --- a/pkg/preflights/host-preflight.yaml +++ b/pkg/preflights/host-preflight.yaml @@ -443,6 +443,17 @@ spec: - pass: when: "false" message: "Neither 'nameserver localhost' nor 'nameserver 127.0.01' is present in resolv.conf" + - textAnalyze: + checkName: Nameserver Configuration + fileName: host-collectors/run-host/resolv.conf.txt + regex: '(?m)^nameserver\s+\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\s*$' + outcomes: + - fail: + when: "false" + message: "No nameservers are configured in resolv.conf. Update resolv.conf to include at least one nameserver." + - pass: + when: "true" + message: "Nameservers are configured in resolv.conf." - filesystemPerformance: checkName: Filesystem Write Latency collectorName: filesystem-write-latency-etcd