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

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