Skip to content

Check net.ipv4.ip_forward in validate-cks-node - #14773

Open
bhouse-nexthop wants to merge 1 commit into
apache:4.22from
bhouse-nexthop:cks-validate-node-ip-forward
Open

bhouse-nexthop wants to merge 1 commit into
apache:4.22from
bhouse-nexthop:cks-validate-node-ip-forward

Conversation

@bhouse-nexthop

@bhouse-nexthop bhouse-nexthop commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Fixes #14772

validate-cks-node now also checks net.ipv4.ip_forward, which kubeadm join preflight requires.

Before After
ip_forward=0, packages OK exit 0, join fails later in kubeadm preflight message + exit 1, add rejected up front
ip_forward=0, packages missing packages reported both reported in one run
ip_forward=1 unchanged unchanged
  • Each check adds its message to a FAILURES list; the script prints them all and exits 1 if there are any. A new check is one more if block.

  • The caller's log line now says the node failed validation, not that it lacks dependencies.

  • Reads /proc/sys/net/ipv4/ip_forward rather than calling sysctl, which is not on a non-root user's PATH on Debian.

  • Checks the live value. A value set at runtime but not persisted will pass here and still be lost on the reboot that follows.

Touches the same script as #14756 (missing-package array). The two merge cleanly; at most a trivial conflict depending on merge order.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Bug Severity

  • Minor

How Has This Been Tested?

Ran the script in bash with dpkg stubbed and the /proc path pointed at a temp file:

dpkg ip_forward Exit Output
installed 1 0 0
installed 0 1 ip_forward message
installed file missing 1 ip_forward message
missing 1 1 package list
missing 0 1 package list + ip_forward message

bash -n clean.

@codecov

codecov Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 18.33%. Comparing base (b56bbc2) to head (b92a9d1).
⚠️ Report is 2 commits behind head on 4.22.

Files with missing lines Patch % Lines
...ster/actionworkers/KubernetesClusterAddWorker.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               4.22   #14773   +/-   ##
=========================================
  Coverage     18.32%   18.33%           
- Complexity    16644    16655   +11     
=========================================
  Files          5939     5939           
  Lines        537787   537799   +12     
  Branches      65932    65935    +3     
=========================================
+ Hits          98544    98580   +36     
+ Misses       428033   428008   -25     
- Partials      11210    11211    +1     
Flag Coverage Δ
uitests 4.08% <ø> (ø)
unittests 19.42% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

- validate-cks-node now fails when /proc/sys/net/ipv4/ip_forward is not 1
- kubeadm join preflight requires it; without it an added external node
  passes validation, is rebooted into the join userdata and then fails
  kubeadm preflight with a less obvious error
- each check adds its message to a FAILURES list; the script prints them
  all and exits 1 if there are any, so a new check is one more `if` block
- missing packages and ip_forward are reported together in one run
- the caller's log line says the node failed validation, not that it
  lacks dependencies, since the reason may not be a package
- reads /proc rather than calling sysctl, which is not on a non-root
  user's PATH on Debian

Signed-off-by: Brad House <bhouse@nexthop.ai>
@bhouse-nexthop
bhouse-nexthop force-pushed the cks-validate-node-ip-forward branch from 70ee63a to b92a9d1 Compare November 24, 2026 17:06
bhouse-nexthop added a commit to bhouse-nexthop/cloudstack that referenced this pull request Nov 24, 2026
Follow-up to "Check net.ipv4.ip_forward in validate-cks-node", for its
amended upstream version (apache#14773).

validate-cks-node now collects each failed check, missing packages and
ip_forward alike, and prints all of them before exiting 1. The
ip_forward failure says to set it under /etc/sysctl.d/, so it survives
the reboot that follows. The add-node log says the node failed
validation instead of listing only missing dependencies.

Signed-off-by: Brad House <bhouse@nexthop.ai>
bhouse-nexthop added a commit to bhouse-nexthop/cloudstack that referenced this pull request Nov 24, 2026
Follow-up to "Check net.ipv4.ip_forward in validate-cks-node", for its
amended upstream version (apache#14773).

validate-cks-node now collects each failed check, missing packages and
ip_forward alike, and prints all of them before exiting 1. The
ip_forward failure says to set it under /etc/sysctl.d/, so it survives
the reboot that follows. The add-node log says the node failed
validation instead of listing only missing dependencies.

Signed-off-by: Brad House <bhouse@nexthop.ai>

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants