From 82548d95c761f484f2f90aeb958da526097f0686 Mon Sep 17 00:00:00 2001 From: JGAntunes Date: Fri, 15 Nov 2024 19:25:42 +0000 Subject: [PATCH] chore(preflights): replace run collector with host sysctl for ip_forwarding --- pkg/preflights/host-preflight.yaml | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/pkg/preflights/host-preflight.yaml b/pkg/preflights/host-preflight.yaml index 32f318b8b..05a9ee816 100644 --- a/pkg/preflights/host-preflight.yaml +++ b/pkg/preflights/host-preflight.yaml @@ -148,10 +148,6 @@ spec: exclude: '{{ eq .GlobalCIDR.CIDR "" }}' CIDRRangeAlloc: '{{ .GlobalCIDR.CIDR }}' desiredCIDR: {{.GlobalCIDR.Size}} - - run: - collectorName: "kernel-parameters" - command: "sysctl" - args: ["-a"] - sysctl: {} analyzers: - cpu: @@ -839,17 +835,6 @@ spec: - pass: when: "a-subnet-is-available" message: Specified CIDR is available. - - textAnalyze: - checkName: IP forwarding - fileName: host-collectors/run-host/kernel-parameters.txt - regex: 'net.ipv4.ip_forward = 1' - outcomes: - - pass: - when: "true" - message: IP forwarding is enabled. - - fail: - when: "false" - message: IP forwarding must be enabled. To enable it, edit /etc/sysctl.conf, add or uncomment the line 'net.ipv4.ip_forward=1', and run 'sudo sysctl -p'. - sysctl: checkName: "ARP Filter default value for newly created interfaces" outcomes: @@ -886,3 +871,12 @@ spec: - pass: when: 'net.ipv4.conf.all.arp_ignore == 0' message: "ARP ignore is disabled for all interfaces on the host." + - sysctl: + checkName: "IP forwarding" + outcomes: + - fail: + when: 'net.ipv4.ip_forward == 0' + message: "IP forwarding must be enabled. To enable it, edit /etc/sysctl.conf, add or uncomment the line 'net.ipv4.ip_forward=1', and run 'sudo sysctl -p'." + - pass: + when: 'net.ipv4.ip_forward > 0' + message: "IP forwarding is enabled."