diff --git a/cmd/podman/common/completion.go b/cmd/podman/common/completion.go index e4cbc7c00c..fb1c41d2e3 100644 --- a/cmd/podman/common/completion.go +++ b/cmd/podman/common/completion.go @@ -980,8 +980,8 @@ func AutocompleteTopCmd(cmd *cobra.Command, args []string, toComplete string) ([ } return getContainers(cmd, toComplete, completeDefault) } - descriptors, err := util.GetContainerPidInformationDescriptors() - if err != nil { + descriptors, err := util.GetContainerPidInformationDescriptors() //nolint:staticcheck,nolintlint // false-positives on windows because this always errors there + if err != nil { //nolint:staticcheck,nolintlint cobra.CompErrorln(err.Error()) return nil, cobra.ShellCompDirectiveNoFileComp } diff --git a/cmd/podman/containers/top.go b/cmd/podman/containers/top.go index 7ec186995e..dfe243f8da 100644 --- a/cmd/podman/containers/top.go +++ b/cmd/podman/containers/top.go @@ -61,8 +61,8 @@ func init() { topFlags(topCommand.Flags()) validate.AddLatestFlag(topCommand, &topOptions.Latest) - descriptors, err := util.GetContainerPidInformationDescriptors() - if err == nil { + descriptors, err := util.GetContainerPidInformationDescriptors() //nolint:staticcheck,nolintlint // false-positives on windows because this always errors there + if err == nil { //nolint:staticcheck,nolintlint topDescription = fmt.Sprintf("%s\n\n Format Descriptors:\n %s", topDescription, strings.Join(descriptors, ",")) topCommand.Long = topDescription } @@ -77,8 +77,8 @@ func init() { func top(cmd *cobra.Command, args []string) error { if topOptions.ListDescriptors { - descriptors, err := util.GetContainerPidInformationDescriptors() - if err != nil { + descriptors, err := util.GetContainerPidInformationDescriptors() //nolint:staticcheck,nolintlint // false-positives on windows because this always errors there + if err != nil { //nolint:staticcheck,nolintlint return err } fmt.Println(strings.Join(descriptors, "\n")) diff --git a/cmd/podman/pods/top.go b/cmd/podman/pods/top.go index 29d223a7ba..ce46afab5f 100644 --- a/cmd/podman/pods/top.go +++ b/cmd/podman/pods/top.go @@ -42,8 +42,8 @@ func init() { Parent: podCmd, }) - descriptors, err := util.GetContainerPidInformationDescriptors() - if err == nil { + descriptors, err := util.GetContainerPidInformationDescriptors() //nolint:staticcheck,nolintlint // false-positives on windows because this always errors there + if err == nil { //nolint:staticcheck,nolintlint topDescription = fmt.Sprintf("%s\n\n Format Descriptors:\n %s", topDescription, strings.Join(descriptors, ",")) topCommand.Long = topDescription } @@ -57,8 +57,8 @@ func init() { func top(_ *cobra.Command, args []string) error { if topOptions.ListDescriptors { - descriptors, err := util.GetContainerPidInformationDescriptors() - if err != nil { + descriptors, err := util.GetContainerPidInformationDescriptors() //nolint:staticcheck,nolintlint // false-positives on windows because this always errors there + if err != nil { //nolint:staticcheck,nolintlint return err } fmt.Println(strings.Join(descriptors, "\n")) diff --git a/libpod/container_internal.go b/libpod/container_internal.go index d417c24522..e039cd0a81 100644 --- a/libpod/container_internal.go +++ b/libpod/container_internal.go @@ -1738,13 +1738,13 @@ func (c *Container) mountStorage() (_ string, deferredErr error) { return "", err } - pid, cleanupFunc, err := idmap.CreateUsernsProcess(util.RuntimeSpecToIDtools(uidMappings), util.RuntimeSpecToIDtools(gidMappings)) - if err != nil { + pid, cleanupFunc, err := idmap.CreateUsernsProcess(util.RuntimeSpecToIDtools(uidMappings), util.RuntimeSpecToIDtools(gidMappings)) //nolint:staticcheck,nolintlint // false-positives on freebsd because this always errors there + if err != nil { //nolint:staticcheck,nolintlint return "", err } defer cleanupFunc() - if err := idmap.CreateIDMappedMount(c.config.Rootfs, c.config.Rootfs, pid); err != nil { + if err := idmap.CreateIDMappedMount(c.config.Rootfs, c.config.Rootfs, pid); err != nil { //nolint:staticcheck,nolintlint // false-positives on freebsd because this always errors there return "", fmt.Errorf("failed to create idmapped mount: %w", err) } defer func() { diff --git a/libpod/container_internal_common.go b/libpod/container_internal_common.go index ed5d4dd240..461dc2096f 100644 --- a/libpod/container_internal_common.go +++ b/libpod/container_internal_common.go @@ -1327,7 +1327,7 @@ func (c *Container) exportCheckpoint(options ContainerCheckpointOptions) error { } func (c *Container) checkpointRestoreSupported(version int) error { - if err := criu.CheckForCriu(version); err != nil { + if err := criu.CheckForCriu(version); err != nil { //nolint:staticcheck,nolintlint // false-positives on freebsd because this always errors there return err } if !c.ociRuntime.SupportsCheckpoint() { diff --git a/libpod/runtime.go b/libpod/runtime.go index 735799a7a3..92f15cf365 100644 --- a/libpod/runtime.go +++ b/libpod/runtime.go @@ -253,12 +253,12 @@ func getLockManager(runtime *Runtime) (lock.Manager, error) { lockPath = fmt.Sprintf("%s_%d", define.DefaultRootlessSHMLockPath, rootless.GetRootlessUID()) } // Set up the lock manager - manager, err = lock.OpenSHMLockManager(lockPath, runtime.config.Engine.NumLocks) - if err != nil { + manager, err = lock.OpenSHMLockManager(lockPath, runtime.config.Engine.NumLocks) //nolint:staticcheck,nolintlint // false-positives on freebsd because this always errors there + if err != nil { //nolint:staticcheck,nolintlint switch { case errors.Is(err, os.ErrNotExist): - manager, err = lock.NewSHMLockManager(lockPath, runtime.config.Engine.NumLocks) - if err != nil { + manager, err = lock.NewSHMLockManager(lockPath, runtime.config.Engine.NumLocks) //nolint:staticcheck,nolintlint // false-positives on freebsd because this always errors there + if err != nil { //nolint:staticcheck,nolintlint return nil, fmt.Errorf("failed to get new shm lock manager: %w", err) } case errors.Is(err, syscall.ERANGE) && runtime.doRenumber: @@ -271,8 +271,8 @@ func getLockManager(runtime *Runtime) (lock.Manager, error) { return nil, fmt.Errorf("removing libpod locks file %s: %w", lockPath, err) } - manager, err = lock.NewSHMLockManager(lockPath, runtime.config.Engine.NumLocks) - if err != nil { + manager, err = lock.NewSHMLockManager(lockPath, runtime.config.Engine.NumLocks) //nolint:staticcheck,nolintlint // false-positives on freebsd because this always errors there + if err != nil { //nolint:staticcheck,nolintlint return nil, err } default: diff --git a/pkg/checkpoint/checkpoint_restore.go b/pkg/checkpoint/checkpoint_restore.go index 7b4d6d0d3f..d4f2697dc8 100644 --- a/pkg/checkpoint/checkpoint_restore.go +++ b/pkg/checkpoint/checkpoint_restore.go @@ -95,7 +95,7 @@ func CRImportCheckpoint(ctx context.Context, runtime *libpod.Runtime, restoreOpt if restoreOptions.Pod != "" { // Restoring into a Pod requires much newer versions of CRIU - if err := criu.CheckForCriu(criu.PodCriuVersion); err != nil { + if err := criu.CheckForCriu(criu.PodCriuVersion); err != nil { //nolint:staticcheck,nolintlint // false-positives on freebsd because this always errors there return nil, fmt.Errorf("restoring containers into pod: %w", err) } // The runtime also has to support it