Skip to content

Commit d461695

Browse files
authored
Merge pull request #110 from iranzo/mellanoxcheckfix
fix: checks on mellanox failed on some hosts, switch to ethtool
2 parents 195cc0d + d79a6de commit d461695

File tree

2 files changed

+3
-46
lines changed

2 files changed

+3
-46
lines changed

checks/mellanox-firmware-version

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ if oc auth can-i debug node >/dev/null 2>&1; then
2020
for node in $(oc get nodes -o go-template='{{range .items}}{{$node := .}}{{range .status.conditions}}{{if eq .type "Ready"}}{{if eq .status "True"}}node/{{$node.metadata.name}}{{"\n"}}{{end}}{{end}}{{end}}{{end}}'); do
2121
# shellcheck disable=SC1083
2222
ocdebugorwait # Pause for no OC debug running
23-
if ! FIRMWAREVERS=$(oc debug --image="${OCDEBUGIMAGE}" "${node}" -- chroot /host sh -c "for id in ${IDS}; do for device in \$(lspci -D -d "\${id}" | awk '{ print \$1 }'); do echo -n \"\${device},\"; grep -aoP '(?<=FFV)[0-9,.]{8}' /sys/bus/pci/devices/\${device}/vpd;done;done" 2>/dev/null); then
23+
if ! FIRMWAREVERS=$(oc debug --image="${OCDEBUGIMAGE}" "${node}" -- chroot /host sh -c "for id in ${IDS}; do for device in \$(lspci -D -d "\${id}" | awk '{ print \$1 }'); do echo -n \"\${device},\" ; ethtool -i \$(ls /sys/bus/pci/devices/\${device}/net/)|grep firmware-version|cut -d: -f2-|xargs echo|awk '{ print \$1 }';done;done" 2>/dev/null); then
2424
msg "${ORANGE}Error running oc debug in ${node}${NOCOLOR}"
2525
else
2626
if [ -n "${FIRMWAREVERS}" ]; then
2727
for result in ${FIRMWAREVERS}; do
2828
dev=$(echo ${result} | awk -F, '{print $1}')
2929
fw=$(echo ${result} | awk -F, '{print $2}' | awk -F. '{print $1"."$2}')
3030
if [[ $(expr ${fw} \< ${MIN_VERS}) -eq 1 ]]; then
31-
msg "Firmware for Mellanox card ${RED}${dev}${NOCOLOR} on ${RED}${node}${NOCOLOR} is below the minimum recommended version. Please upgrade to at least ${GREEN}${MIN_VERS}${NOCOLOR}."
31+
msg "Firmware for Mellanox card ${RED}${dev}${NOCOLOR} (${fw}) on ${RED}${node}${NOCOLOR} is below the minimum recommended version. Please upgrade to at least ${GREEN}${MIN_VERS}${NOCOLOR}."
3232
errors=$(("${errors}" + 1))
3333
fw_errors=$(("${fw_errors}" + 1))
3434
if [ ! -z "${ERRORFILE}" ]; then
@@ -49,4 +49,4 @@ else
4949
msg "Couldn't debug nodes, check permissions"
5050
exit ${OCSKIP}
5151
fi
52-
exit ${OCUNKNOWNN}
52+
exit ${OCUNKNOWN}

info/mellanox-firmware-version

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)