mirror of
https://github.com/moby/moby.git
synced 2026-06-24 08:48:23 +00:00
contrib/check-config: don't propagate optional feature failures to exit code
The Optional Features section called check_flags directly, so a missing optional kernel flag (USER_NS, SECCOMP, the ext3/ext4 filesystem options, etc.) sets EXITCODE=1 and the script exits non-zero, even when every "Generally Necessary" flag is present. This breaks CI checks that rely on the exit code to gate hosts where Docker is actually expected to run. Mirror the pattern already used for Storage Drivers (L385-411): save the running EXITCODE before the Optional Features section, run the optional checks with a fresh EXITCODE, then restore it before the Network Drivers section. A dedicated variable name (optional_features_exit) avoids a collision with the CODE variable already used inside the kernel-<5.8 MEMCG_SWAP branch (L267-272). Signed-off-by: Takumi Akasaka <takumiakasaka1231@gmail.com> Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
committed by
Sebastiaan van Stijn
parent
532e50b773
commit
a4c5b2be6f
@@ -244,6 +244,10 @@ fi
|
||||
|
||||
echo
|
||||
|
||||
# Save the results of the required features while running optional feature checks.
|
||||
required_features_result=${EXITCODE}
|
||||
EXITCODE=0
|
||||
|
||||
echo 'Optional Features:'
|
||||
{
|
||||
check_flags USER_NS
|
||||
@@ -353,6 +357,9 @@ if ! is_set EXT4_FS || ! is_set EXT4_FS_POSIX_ACL || ! is_set EXT4_FS_SECURITY;
|
||||
fi
|
||||
fi
|
||||
|
||||
# Restore results of the required features check.
|
||||
EXITCODE=${required_features_result}
|
||||
|
||||
echo '- Network Drivers:'
|
||||
echo " - \"$(wrap_color 'bridge' blue)\":"
|
||||
check_sysctl net.ipv4.ip_forward 1 | sed 's/^/ - /'
|
||||
|
||||
Reference in New Issue
Block a user