Merge pull request #1563 from anderbubble/error-format

Format errors in logs as strings
This commit is contained in:
Christian Goll
2024-11-25 11:27:46 +01:00
committed by GitHub
4 changed files with 4 additions and 3 deletions

View File

@@ -105,6 +105,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix issue that initrd fails at downloading runtime overlay with permission denied error,
when warewulf secure option in warewulf.conf is enabled. #806
- Allow iPXE to continue booting without runtime overlay. #806
- Format errors in logs as strings. #1563
## v4.5.8, 2024-10-01

View File

@@ -48,7 +48,7 @@ func runContainedCmd(cmd *cobra.Command, containerName string, args []string) (e
}
defer func() {
if err := os.RemoveAll(runDir); err != nil {
wwlog.Error("error removing run directory: %w", err)
wwlog.Error("error removing run directory: %s", err)
}
}()

View File

@@ -398,7 +398,7 @@ func ContainerRename(crp *wwapiv1.ContainerRenameParameter) (err error) {
err = container.DeleteImage(crp.ContainerName)
if err != nil {
wwlog.Warn("Could not remove image files for %s: %w", crp.ContainerName, err)
wwlog.Warn("Could not remove image files for %s: %s", crp.ContainerName, err)
}
if crp.Build {

View File

@@ -528,7 +528,7 @@ func (this *NetDev) Upgrade(addDefaults bool) (upgraded *node.NetDev) {
if this.IpCIDR != "" {
cidrIP, cidrIPNet, err := net.ParseCIDR(this.IpCIDR)
if err != nil {
wwlog.Error("%v is not a valid CIDR address: %w", this.IpCIDR, err)
wwlog.Error("%v is not a valid CIDR address: %s", this.IpCIDR, err)
} else {
if upgraded.Ipaddr == nil {
upgraded.Ipaddr = cidrIP