File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 44: ${ENTRYPOINT_DEBUG:= false}
55: ${DTK_OCP_NIC_SHARED_DIR:=/ mnt/ shared-nvidia-nic-driver-toolkit}
66
7- DTK_OCP_NIC_SHARED_DIR=$DTK_OCP_NIC_SHARED_DIR /$( uname -r)
7+ # Sanitize kernel version to match Kubernetes NFD label format used by network-operator for volume paths
8+ # NFD replaces all non-alphanumeric characters (except -._) with underscore, then trims leading/trailing -._
9+ DTK_KVER=$( uname -r | sed ' s/[^-A-Za-z0-9_.]/_/g' | sed ' s/^[-_.]*//;s/[-_.]*$//' )
10+ DTK_OCP_NIC_SHARED_DIR=$DTK_OCP_NIC_SHARED_DIR /$DTK_KVER
811DTK_OCP_START_COMPILE_FLAG=" "
912DTK_OCP_DONE_COMPILE_FLAG=" "
1013DTK_OCP_COMPILED_DRIVER_VER=" "
Original file line number Diff line number Diff line change @@ -1360,7 +1360,10 @@ IS_OS_SLES=true; [[ "$(grep -i sles /etc/os-release -c)" == "0" ]] && IS_OS_SLES
13601360RHEL_MAJOR_VERSION=0
13611361OPENSHIFT_VERSION=" "
13621362
1363- DTK_OCP_NIC_SHARED_DIR=${DTK_OCP_NIC_SHARED_DIR} /${FULL_KVER}
1363+ # Sanitize kernel version to match Kubernetes NFD label format used by network-operator for volume paths
1364+ # NFD replaces all non-alphanumeric characters (except -._) with underscore, then trims leading/trailing -._
1365+ DTK_KVER=$( echo " ${FULL_KVER} " | sed ' s/[^-A-Za-z0-9_.]/_/g' | sed ' s/^[-_.]*//;s/[-_.]*$//' )
1366+ DTK_OCP_NIC_SHARED_DIR=${DTK_OCP_NIC_SHARED_DIR} /${DTK_KVER}
13641367DTK_OCP_BUILD_SCRIPT=" /root/dtk_nic_driver_build.sh"
13651368DTK_OCP_START_COMPILE_FLAG=${DTK_OCP_NIC_SHARED_DIR} /dtk_start_compile
13661369DTK_OCP_DONE_COMPILE_FLAG_PREFIX=${DTK_OCP_NIC_SHARED_DIR} /dtk_done_compile_
You can’t perform that action at this time.
0 commit comments