diff --git a/pkg/client/cluster.go b/pkg/client/cluster.go index ea7a2765b..93d4d0765 100644 --- a/pkg/client/cluster.go +++ b/pkg/client/cluster.go @@ -546,7 +546,7 @@ func ClusterDelete(ctx context.Context, runtime k3drt.Runtime, cluster *k3d.Clus l.Log().Infof("Deleting cluster '%s'", cluster.Name) cluster, err := ClusterGet(ctx, runtime, cluster) if err != nil { - return fmt.Errorf("failed to get cluster %s: %w", cluster.Name, err) + return fmt.Errorf("failed to get cluster: %w", err) } l.Log().Debugf("Cluster Details: %+v", cluster) diff --git a/pkg/client/node.go b/pkg/client/node.go index 7b5f6b241..b6910ee51 100644 --- a/pkg/client/node.go +++ b/pkg/client/node.go @@ -465,24 +465,24 @@ func NodeCreate(ctx context.Context, runtime runtimes.Runtime, node *k3d.Node, c } else { memory, err := dockerunits.RAMInBytes(node.Memory) if err != nil { - return fmt.Errorf("Invalid memory limit format: %+v", err) + return fmt.Errorf("invalid memory limit format: %w", err) } // mount fake meminfo as readonly fakemempath, err := util.MakeFakeMeminfo(memory, node.Name) if err != nil { - return fmt.Errorf("Failed to create fake meminfo: %+v", err) + return fmt.Errorf("failed to create fake meminfo: %w", err) } node.Volumes = append(node.Volumes, fmt.Sprintf("%s:%s:ro", fakemempath, util.MemInfoPath)) // mount empty edac folder, but only if it exists exists, err := docker.CheckIfDirectoryExists(ctx, node.Image, util.EdacFolderPath) if err != nil { - return fmt.Errorf("Failed to check for the existence of edac folder: %+v", err) + return fmt.Errorf("failed to check for the existence of edac folder: %w", err) } if exists { l.Log().Debugln("Found edac folder") fakeedacpath, err := util.MakeFakeEdac(node.Name) if err != nil { - return fmt.Errorf("Failed to create fake edac: %+v", err) + return fmt.Errorf("failed to create fake edac: %w", err) } node.Volumes = append(node.Volumes, fmt.Sprintf("%s:%s:ro", fakeedacpath, util.EdacFolderPath)) } diff --git a/pkg/runtimes/docker/container.go b/pkg/runtimes/docker/container.go index 9e367c5ec..56e515ee9 100644 --- a/pkg/runtimes/docker/container.go +++ b/pkg/runtimes/docker/container.go @@ -231,6 +231,6 @@ func CheckIfDirectoryExists(ctx context.Context, image string, dir string) (bool shellCmd := fmt.Sprintf("[ -d \"%s\" ] && exit 0 || exit 1", dir) cmd := []string{"sh", "-c", shellCmd} exitCode, err := executeCheckInContainer(ctx, image, cmd) - l.Log().Tracef("check dir container returned %d exist code", exitCode) - return exitCode == 0, fmt.Errorf("error executing check command '%s' in container with image '%s': %w", cmd, image, err) + l.Log().Tracef("check dir container returned %d exit code", exitCode) + return exitCode == 0, err }