Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ private boolean validateNodeCompatibility(IpAddress publicIp, long nodeId, int n
Pair<Boolean, String> result = SshHelper.sshExecute(publicIp.getAddress().addr(), nodeSshPort, getControlNodeLoginUser(),
pkFile, null, command, 10000, 10000, 10 * 60 * 1000);
if (Boolean.FALSE.equals(result.first())) {
logger.error(String.format("Node with ID: %s cannot be added as a worker node as it does not have " +
"the following dependencies: %s ", nodeId, result.second()));
logger.error(String.format("Node with ID: %s cannot be added as a worker node, it failed validation: %s",
nodeId, result.second()));
return false;
}
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ OS=`awk -F= '/^NAME/{print $2}' /etc/os-release`
REQUIRED_PACKAGES=(cloud-init cloud-guest-utils conntrack apt-transport-https ca-certificates curl gnupg gnupg-agent \
software-properties-common gnupg lsb-release python3-json-pointer python3-jsonschema cloud-init containerd.io)
declare -a MISSING_PACKAGES
declare -a FAILURES
if [[ $OS == *"Ubuntu"* || $OS == *"Debian"* ]]; then
for package in ${REQUIRED_PACKAGES[@]}; do
dpkg -s $package >/dev/null 2>&1
Expand All @@ -36,10 +37,16 @@ else
done
fi

echo ${#MISSING_PACKAGES[@]}
if (( ${#MISSING_PACKAGES[@]} )); then
echo "Following packages are missing in the node template: ${MISSING_PACKAGES[@]}"
FAILURES+=("Following packages are missing in the node template: ${MISSING_PACKAGES[*]}")
fi

if [[ $(cat /proc/sys/net/ipv4/ip_forward 2>/dev/null) != "1" ]]; then
FAILURES+=("net.ipv4.ip_forward is not set to 1 on the node; set it in /etc/sysctl.d/ so it survives the reboot that follows")
fi

if (( ${#FAILURES[@]} )); then
printf '%s\n' "${FAILURES[@]}"
exit 1
else
echo 0
fi
echo 0
Loading