mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-13 04:49:36 +00:00
runtime: Fix non constant Errorf formatting
As part of the go 1.24.6 bump there are errors about the incorrect use of a errorf, so switch to the non-formatting version, or add the format string as appropriate Signed-off-by: stevenhorsman <steven@uk.ibm.com>
This commit is contained in:
committed by
Fabiano Fidêncio
parent
381da9e603
commit
8cbb1a4357
@@ -96,14 +96,14 @@ func (mounter *SafeMountFormater) SafeFormatWithFstype(source string, fstype str
|
||||
if output, err := doSafeCommand(mkfsCmd, args...); err != nil {
|
||||
detailedErr := fmt.Sprintf("format disk %q failed: type:(%q) errcode:(%v) output:(%v) ", source, fstype, err, string(output))
|
||||
klog.Error(detailedErr)
|
||||
return mountutils.NewMountError(mountutils.FormatFailed, detailedErr)
|
||||
return mountutils.NewMountError(mountutils.FormatFailed, "%s", detailedErr)
|
||||
}
|
||||
|
||||
klog.Infof("Disk successfully formatted (mkfs): %s - %s", fstype, source)
|
||||
} else {
|
||||
if fstype != existingFormat {
|
||||
// Do verify the disk formatted with expected fs type.
|
||||
return mountutils.NewMountError(mountutils.FilesystemMismatch, err.Error())
|
||||
return mountutils.NewMountError(mountutils.FilesystemMismatch, "%s", err.Error())
|
||||
}
|
||||
|
||||
if !readOnly {
|
||||
|
@@ -202,7 +202,7 @@ func CreateDirectBlockDevice(volID, capacityInBytesStr, storagePath string) (*st
|
||||
// create raw disk
|
||||
if _, err = diskfs.Create(devicePath, capacityInBytes, diskfs.Raw, diskfs.SectorSizeDefault); err != nil {
|
||||
errMsg := fmt.Errorf("diskfs create disk failed: %v", err)
|
||||
klog.Errorf(errMsg.Error())
|
||||
klog.Error(errMsg.Error())
|
||||
|
||||
return nil, errMsg
|
||||
}
|
||||
|
Reference in New Issue
Block a user