diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b0dbd03..4228de84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,7 +37,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Removed - Remove unused Netdev `Prefix` field. -- Fixed mkfs overlay overwrite/force-flag behavior. #2028. ### Fixed @@ -46,6 +45,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Fix ImageDelete API not returning error when checking if image is used by nodes/profiles - Fix warewulf-dracut to not run the wwinit module if root is not set to `root=wwclient*` - Fix `wwctl image import --update` #2066 +- Fix filesystem overwrite/force behavior in mkfs overlay. #2028 ### Dependencies diff --git a/overlays/mkfs/rootfs/warewulf/wwinit.d/20-mkfs.sh.ww b/overlays/mkfs/rootfs/warewulf/wwinit.d/20-mkfs.sh.ww index 1f468100..147de24b 100644 --- a/overlays/mkfs/rootfs/warewulf/wwinit.d/20-mkfs.sh.ww +++ b/overlays/mkfs/rootfs/warewulf/wwinit.d/20-mkfs.sh.ww @@ -59,9 +59,9 @@ if command -v mkfs >/dev/null ; then : info "warewulf: mkfs: formatting {{ $fs.device }}" {{- $forceFlag := "" }} {{- if $fs.overwrite }} - {{- if eq $fs.type "ext4" }} + {{- if regexMatch "^ext[234]$" $fs.type }} {{- $forceFlag = "-F" }} - {{- else }} + {{- else if regexMatch "^(xfs|btrfs)$" $fs.type }} {{- $forceFlag = "-f" }} {{- end }} {{- end }}