Skip to content

Commit

Permalink
Additional path for CIS kernel params file
Browse files Browse the repository at this point in the history
The default path using the script installer writes this to
/opt/rke2/share/rke2/rke2-cis-sysctl.conf (on Leap/SLEMicro at least)
  • Loading branch information
hardys committed Aug 15, 2024
1 parent efdd6d2 commit bcf5f15
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/rke2/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ fi
YUM_BASED_PARAM_FILE_FOUND=false
TAR_BASED_PARAM_FILE_FOUND=false
INSTALLER_BASED_PARAM_FILE_FOUND=false
# Using RKE2 generated kernel parameters
if [ -f /usr/share/rke2/rke2-cis-sysctl.conf ]; then
Expand All @@ -67,7 +68,12 @@ if [ -f /usr/local/share/rke2/rke2-cis-sysctl.conf ]; then
cp -f /usr/local/share/rke2/rke2-cis-sysctl.conf /etc/sysctl.d/90-rke2-cis.conf
fi
if [ "$YUM_BASED_PARAM_FILE_FOUND" = false ] && [ "$TAR_BASED_PARAM_FILE_FOUND" = false ]; then
if [ -f /opt/rke2/share/rke2/rke2-cis-sysctl.conf ]; then
INSTALLER_BASED_PARAM_FILE_FOUND=true
cp -f /opt/rke2/share/rke2/rke2-cis-sysctl.conf /etc/sysctl.d/90-rke2-cis.conf
fi
if [ "$YUM_BASED_PARAM_FILE_FOUND" = false ] && [ "$TAR_BASED_PARAM_FILE_FOUND" = false ] && [ "$INSTALLER_BASED_PARAM_FILE_FOUND" = false ]; then
echo "No kernel parameters file found"
exit 1
fi
Expand Down

0 comments on commit bcf5f15

Please sign in to comment.