Skip to content

Commit

Permalink
fix: collecting information about ram with empty slots (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
kvaps authored Jan 19, 2024
1 parent a19babc commit d3f7604
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion talos-bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ node_list_file=$(mktemp)
fi
manufacturer=$(talosctl -n "${node}" get cpu -i -o jsonpath='{.spec.manufacturer}' | head -n1)
cpu=$(talosctl -n "${node}" get cpu -i -o jsonpath='{.spec.threadCount}' -i | awk '{sum+=$1;} END{print sum "-core";}')
ram=$(talosctl -n "${node}" get ram -o jsonpath='{.spec.sizeMiB}' -i | awk '{sum+=$1;} END{print sum/1024 "GB";}')
ram=$(talosctl -n "${node}" get ram -o json -i | awk '/"sizeMiB":/ {sub(",", ""); sum+=$2} END{print sum/1024 "GB"}')
disks=$(talosctl -n "${node}" disks -i | awk -F' +' 'NR>1 {print $1 ":" $9}' | awk -F/ '$2 == "dev" {print $3}' | awk 'gsub(" ", "", $0)' | awk '$1=$1' RS="," OFS=",")
echo "\"${name}\"" "\"${mac}, ${cpu} ${manufacturer:-CPU}, RAM: ${ram}, Disks: [${disks}]\""
done
Expand Down

0 comments on commit d3f7604

Please sign in to comment.