Make mkfs -f/-F flag selection more explicit

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2025-12-17 15:11:09 -07:00
parent c674728c09
commit 8bf2e115a9
2 changed files with 3 additions and 3 deletions

View File

@@ -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

View File

@@ -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 }}