harvester / upgrade-helpers

4 stars 11 forks source link

feat(image): add script for user to purge unneeded images #6

Closed starbops closed 1 year ago

starbops commented 1 year ago

Related issue: harvester/harvester#2132

Test Plan

  1. Provision a single-node Harvester cluster in v1.1.2
  2. Upgrade the cluster to v1.2.0-rc3, and wait for it to finish
  3. Check the disk usage of image store partition, /usr/local, on the node
  4. Execute the script on the node wiht ./harv-purge-images.sh v1.1.2 v1.2.0-rc3
  5. Re-check the disk usage again, it should be lower
starbops commented 1 year ago

Works great!

./harv-purge-images.sh v1.1.1 v1.1.2 My only suggestion would be to run shellcheck on this script and consider some of its suggestions, but aside from that, LGTM.

Followed the suggestions from shellcheck's result. Thanks!

starbops commented 1 year ago

The script looks good me, and would prefer to show the free space of /usr/local/ either before or after the clean up, thanks.

There are already df -h /usr/local in the original script. But I move the "before" one right before the prompting, so users can see it more easily. PTAL, thanks!