Skip to content

Commit

Permalink
refactor: Cleaned if else
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasmetzner committed Oct 22, 2024
1 parent f34cea5 commit bbecbe1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions internal/volumes/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,9 @@ func (s *LinuxMountService) Publish(targetPath string, devicePath string, opts M

if opts.FormatOptions != "" {
formatOptions = strings.Split(opts.FormatOptions, " ")
} else {
if opts.FSType == "xfs" {
formatOptions = append(formatOptions, "-c")
formatOptions = append(formatOptions, fmt.Sprintf("options=%s", XFSDefaultConfigPath))
}
} else if opts.FSType == "xfs" {
formatOptions = append(formatOptions, "-c")
formatOptions = append(formatOptions, fmt.Sprintf("options=%s", XFSDefaultConfigPath))
}

return s.mounter.FormatAndMountSensitiveWithFormatOptions(devicePath, targetPath, opts.FSType, mountOptions, nil, formatOptions)
Expand Down

0 comments on commit bbecbe1

Please sign in to comment.