From c17daf2b09402ec02910fa2f63a5dda64b97fcbb Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Wed, 14 Aug 2024 13:14:02 +0200 Subject: [PATCH 1/6] update golangci-lint to 1.60.1 Fixes new spotted issues around printf() formats and using os.Setenv() in tests. Signed-off-by: Paul Holzinger --- Makefile | 2 +- cmd/podman/containers/create.go | 2 +- libpod/container_top_linux.go | 2 +- pkg/annotations/validate.go | 3 ++- pkg/autoupdate/autoupdate.go | 2 +- pkg/machine/ignition/ignition.go | 2 +- pkg/specgen/generate/config_linux.go | 2 +- pkg/specgen/generate/pod_create.go | 2 +- pkg/systemd/activation_test.go | 10 +++++----- pkg/systemd/quadlet/quadlet.go | 4 ++-- 10 files changed, 16 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 84d2b0bcb4..bf61d5b6f8 100644 --- a/Makefile +++ b/Makefile @@ -62,7 +62,7 @@ BUILDTAGS += ${EXTRA_BUILDTAGS} # N/B: This value is managed by Renovate, manual changes are # possible, as long as they don't disturb the formatting # (i.e. DO NOT ADD A 'v' prefix!) -GOLANGCI_LINT_VERSION := 1.59.1 +GOLANGCI_LINT_VERSION := 1.60.1 PYTHON ?= $(shell command -v python3 python|head -n1) PKG_MANAGER ?= $(shell command -v dnf yum|head -n1) # ~/.local/bin is not in PATH on all systems diff --git a/cmd/podman/containers/create.go b/cmd/podman/containers/create.go index 5edeb2afac..15e714b342 100644 --- a/cmd/podman/containers/create.go +++ b/cmd/podman/containers/create.go @@ -314,7 +314,7 @@ func CreateInit(c *cobra.Command, vals entities.ContainerCreateOptions, isInfra vals.ShmSizeSystemd = c.Flag("shm-size-systemd").Value.String() } if (c.Flag("dns").Changed || c.Flag("dns-option").Changed || c.Flag("dns-search").Changed) && vals.Net != nil && (vals.Net.Network.NSMode == specgen.NoNetwork || vals.Net.Network.IsContainer()) { - return vals, fmt.Errorf("conflicting options: dns and the network mode: " + string(vals.Net.Network.NSMode)) + return vals, errors.New("conflicting options: dns and the network mode: " + string(vals.Net.Network.NSMode)) } noHosts, err := c.Flags().GetBool("no-hosts") if err != nil { diff --git a/libpod/container_top_linux.go b/libpod/container_top_linux.go index 0b85a5a705..bc8ed2511b 100644 --- a/libpod/container_top_linux.go +++ b/libpod/container_top_linux.go @@ -411,7 +411,7 @@ func (c *Container) execPSinContainer(args []string) ([]string, error) { if logrus.GetLevel() >= logrus.DebugLevel { // If we're running in debug mode or higher, we might want to have a // look at stderr which includes debug logs from conmon. - logrus.Debugf(errBuf.String()) + logrus.Debug(errBuf.String()) } if err := <-outErrChan; err != nil { diff --git a/pkg/annotations/validate.go b/pkg/annotations/validate.go index 4ddeea30ed..1e9c3bf866 100644 --- a/pkg/annotations/validate.go +++ b/pkg/annotations/validate.go @@ -1,6 +1,7 @@ package annotations import ( + "errors" "fmt" "regexp" "strings" @@ -41,7 +42,7 @@ func isDNS1123Subdomain(value string) error { } if !dns1123SubdomainRegexp.MatchString(value) { - return fmt.Errorf(regexErrorMsg(dns1123SubdomainErrorMsg, dns1123SubdomainFmt, "example.com")) + return errors.New(regexErrorMsg(dns1123SubdomainErrorMsg, dns1123SubdomainFmt, "example.com")) } return nil diff --git a/pkg/autoupdate/autoupdate.go b/pkg/autoupdate/autoupdate.go index df6627e378..f82090399f 100644 --- a/pkg/autoupdate/autoupdate.go +++ b/pkg/autoupdate/autoupdate.go @@ -131,7 +131,7 @@ func AutoUpdate(ctx context.Context, runtime *libpod.Runtime, options entities.A // Connect to DBUS. conn, err := systemd.ConnectToDBUS() if err != nil { - logrus.Errorf(err.Error()) + logrus.Error(err.Error()) allErrors = append(allErrors, err) return nil, allErrors } diff --git a/pkg/machine/ignition/ignition.go b/pkg/machine/ignition/ignition.go index 58e7b622f1..62bf7a872f 100644 --- a/pkg/machine/ignition/ignition.go +++ b/pkg/machine/ignition/ignition.go @@ -303,7 +303,7 @@ func getFiles(usrName string, uid int, rootful bool, vmtype define.VMType, _ boo lingerExample.Add("Service", "ExecStart", "/usr/bin/sleep infinity") lingerExampleFile, err := lingerExample.ToString() if err != nil { - logrus.Warnf(err.Error()) + logrus.Warn(err.Error()) } containers := `[containers] diff --git a/pkg/specgen/generate/config_linux.go b/pkg/specgen/generate/config_linux.go index ddca2b151c..5954b78c22 100644 --- a/pkg/specgen/generate/config_linux.go +++ b/pkg/specgen/generate/config_linux.go @@ -176,7 +176,7 @@ func shouldMask(mask string, unmask []string) bool { for _, m1 := range strings.Split(m, ":") { match, err := filepath.Match(m1, mask) if err != nil { - logrus.Errorf(err.Error()) + logrus.Error(err.Error()) } if match { return false diff --git a/pkg/specgen/generate/pod_create.go b/pkg/specgen/generate/pod_create.go index 79348aec8b..c4c8dc4511 100644 --- a/pkg/specgen/generate/pod_create.go +++ b/pkg/specgen/generate/pod_create.go @@ -268,7 +268,7 @@ func MapSpec(p *specgen.PodSpecGenerator) (*specgen.SpecGenerator, error) { spec.ConmonPidFile = p.InfraConmonPidFile } - if p.Sysctl != nil && len(p.Sysctl) > 0 { + if len(p.Sysctl) > 0 { spec.Sysctl = p.Sysctl } diff --git a/pkg/systemd/activation_test.go b/pkg/systemd/activation_test.go index 687472206f..0a411bcaa0 100644 --- a/pkg/systemd/activation_test.go +++ b/pkg/systemd/activation_test.go @@ -14,19 +14,19 @@ func TestSocketActivated(t *testing.T) { assert.False(SocketActivated()) // different pid - assert.NoError(os.Setenv("LISTEN_PID", "1")) + t.Setenv("LISTEN_PID", "1") assert.False(SocketActivated()) // same pid no fds - assert.NoError(os.Setenv("LISTEN_PID", strconv.Itoa(os.Getpid()))) - assert.NoError(os.Setenv("LISTEN_FDS", "0")) + t.Setenv("LISTEN_PID", strconv.Itoa(os.Getpid())) + t.Setenv("LISTEN_FDS", "0") assert.False(SocketActivated()) // same pid some fds - assert.NoError(os.Setenv("LISTEN_FDS", "1")) + t.Setenv("LISTEN_FDS", "1") assert.True(SocketActivated()) // FDNAME is ok too (but not required) - assert.NoError(os.Setenv("LISTEN_FDNAMES", "/meshuggah/rocks")) + t.Setenv("LISTEN_FDNAMES", "/meshuggah/rocks") assert.True(SocketActivated()) } diff --git a/pkg/systemd/quadlet/quadlet.go b/pkg/systemd/quadlet/quadlet.go index 2762f7d06a..2509259d3d 100644 --- a/pkg/systemd/quadlet/quadlet.go +++ b/pkg/systemd/quadlet/quadlet.go @@ -1775,7 +1775,7 @@ func handleUserRemap(unitFile *parser.UnitFile, groupName string, podman *Podman autoOpts = append(autoOpts, fmt.Sprintf("size=%v", uidSize)) } - podman.addf("--userns=" + usernsOpts("auto", autoOpts)) + podman.add("--userns=" + usernsOpts("auto", autoOpts)) case "keep-id": if !isUser { return fmt.Errorf("RemapUsers=keep-id is unsupported for system units") @@ -1795,7 +1795,7 @@ func handleUserRemap(unitFile *parser.UnitFile, groupName string, podman *Podman keepidOpts = append(keepidOpts, "gid="+gidMaps[0]) } - podman.addf("--userns=" + usernsOpts("keep-id", keepidOpts)) + podman.add("--userns=" + usernsOpts("keep-id", keepidOpts)) default: return fmt.Errorf("unsupported RemapUsers option '%s'", remapUsers) From 942f789a888f97dc73f52dc4a02dc580c71c4351 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Thu, 15 Aug 2024 13:15:59 +0200 Subject: [PATCH 2/6] set !remote build tags where needed The new golangci-lint version 1.60.1 has problems with typecheck when linting remote files. We have certain pakcages that should never be inlcuded in remote but the typecheck tries to compile all of them but this never works and it seems to ignore the exclude files we gave it. To fix this the proper way is to mark all packages we only use locally with !remote tags. This is a bit ugly but more correct. I also moved the DecodeChanges() code around as it is called from the client so the handles package which should only be remote doesn't really fit anyway. Signed-off-by: Paul Holzinger --- cmd/podman-testing/create.go | 2 ++ cmd/podman-testing/data.go | 2 ++ cmd/podman-testing/layer.go | 2 ++ cmd/podman-testing/main.go | 2 ++ cmd/podman-testing/remove.go | 2 ++ cmd/podman-testing/store_supported.go | 1 - cmd/podman-testing/store_unsupported.go | 16 ------------ cmd/podman/containers/commit.go | 4 --- internal/domain/entities/engine_testing.go | 2 ++ internal/domain/entities/testing.go | 2 ++ internal/domain/infra/abi/testing.go | 2 ++ internal/domain/infra/abi/testing_test.go | 2 ++ internal/domain/infra/runtime_tunnel.go | 25 ------------------- internal/domain/infra/tunnel/testing.go | 2 ++ internal/domain/infra/tunnel/testing_test.go | 2 ++ pkg/api/handlers/compat/auth.go | 2 ++ pkg/api/handlers/compat/changes.go | 2 ++ pkg/api/handlers/compat/containers.go | 2 ++ pkg/api/handlers/compat/containers_archive.go | 2 ++ pkg/api/handlers/compat/containers_attach.go | 2 ++ pkg/api/handlers/compat/containers_create.go | 2 ++ pkg/api/handlers/compat/containers_export.go | 2 ++ pkg/api/handlers/compat/containers_logs.go | 2 ++ pkg/api/handlers/compat/containers_pause.go | 2 ++ pkg/api/handlers/compat/containers_prune.go | 2 ++ pkg/api/handlers/compat/containers_restart.go | 2 ++ pkg/api/handlers/compat/containers_start.go | 2 ++ .../compat/containers_stats_freebsd.go | 2 ++ .../handlers/compat/containers_stats_linux.go | 2 ++ pkg/api/handlers/compat/containers_stop.go | 2 ++ pkg/api/handlers/compat/containers_top.go | 2 ++ pkg/api/handlers/compat/containers_unpause.go | 2 ++ pkg/api/handlers/compat/events.go | 2 ++ pkg/api/handlers/compat/exec.go | 2 ++ pkg/api/handlers/compat/images.go | 4 ++- pkg/api/handlers/compat/images_build.go | 2 ++ pkg/api/handlers/compat/images_history.go | 2 ++ pkg/api/handlers/compat/images_prune.go | 2 ++ pkg/api/handlers/compat/images_push.go | 2 ++ pkg/api/handlers/compat/images_remove.go | 2 ++ pkg/api/handlers/compat/images_save.go | 2 ++ pkg/api/handlers/compat/images_search.go | 2 ++ pkg/api/handlers/compat/images_tag.go | 2 ++ pkg/api/handlers/compat/info.go | 2 ++ pkg/api/handlers/compat/networks.go | 2 ++ pkg/api/handlers/compat/ping.go | 2 ++ pkg/api/handlers/compat/resize.go | 2 ++ pkg/api/handlers/compat/secrets.go | 2 ++ pkg/api/handlers/compat/system.go | 2 ++ pkg/api/handlers/compat/types.go | 2 ++ pkg/api/handlers/compat/unsupported.go | 2 ++ pkg/api/handlers/compat/version.go | 2 ++ pkg/api/handlers/compat/volumes.go | 2 ++ pkg/api/handlers/decoder.go | 2 ++ pkg/api/handlers/libpod/containers.go | 2 ++ pkg/api/handlers/libpod/containers_create.go | 2 ++ pkg/api/handlers/libpod/containers_stats.go | 2 ++ pkg/api/handlers/libpod/generate.go | 2 ++ pkg/api/handlers/libpod/healthcheck.go | 2 ++ pkg/api/handlers/libpod/images.go | 4 ++- pkg/api/handlers/libpod/images_pull.go | 2 ++ pkg/api/handlers/libpod/images_push.go | 2 ++ pkg/api/handlers/libpod/info.go | 2 ++ pkg/api/handlers/libpod/kube.go | 2 ++ pkg/api/handlers/libpod/manifests.go | 2 ++ pkg/api/handlers/libpod/networks.go | 2 ++ pkg/api/handlers/libpod/play.go | 2 ++ pkg/api/handlers/libpod/pods.go | 2 ++ pkg/api/handlers/libpod/secrets.go | 2 ++ pkg/api/handlers/libpod/swagger_spec.go | 2 ++ pkg/api/handlers/libpod/system.go | 2 ++ pkg/api/handlers/libpod/volumes.go | 2 ++ pkg/api/handlers/swagger/doc.go | 2 ++ pkg/api/handlers/swagger/errors.go | 2 ++ pkg/api/handlers/swagger/models.go | 2 ++ pkg/api/handlers/swagger/responses.go | 2 ++ pkg/api/handlers/utils/apiutil/apiutil.go | 2 ++ .../handlers/utils/apiutil/apiutil_test.go | 2 ++ pkg/api/handlers/utils/containers.go | 2 ++ pkg/api/handlers/utils/errors.go | 2 ++ pkg/api/handlers/utils/handler.go | 2 ++ pkg/api/handlers/utils/handler_test.go | 2 ++ pkg/api/handlers/utils/images.go | 2 ++ pkg/api/server/doc.go | 2 ++ pkg/api/server/handler_api.go | 2 ++ pkg/api/server/handler_logging.go | 2 ++ pkg/api/server/handler_panic.go | 2 ++ pkg/api/server/handler_rid.go | 2 ++ pkg/api/server/idle/tracker.go | 2 ++ pkg/api/server/listener_api.go | 2 ++ pkg/api/server/register_archive.go | 2 ++ pkg/api/server/register_auth.go | 2 ++ pkg/api/server/register_containers.go | 2 ++ pkg/api/server/register_distribution.go | 2 ++ pkg/api/server/register_events.go | 2 ++ pkg/api/server/register_exec.go | 2 ++ pkg/api/server/register_generate.go | 2 ++ pkg/api/server/register_healthcheck.go | 2 ++ pkg/api/server/register_images.go | 2 ++ pkg/api/server/register_info.go | 2 ++ pkg/api/server/register_kube.go | 2 ++ pkg/api/server/register_manifest.go | 2 ++ pkg/api/server/register_monitor.go | 2 ++ pkg/api/server/register_networks.go | 2 ++ pkg/api/server/register_ping.go | 2 ++ pkg/api/server/register_plugins.go | 2 ++ pkg/api/server/register_pods.go | 2 ++ pkg/api/server/register_secrets.go | 2 ++ pkg/api/server/register_swagger.go | 2 ++ pkg/api/server/register_swarm.go | 2 ++ pkg/api/server/register_system.go | 2 ++ pkg/api/server/register_version.go | 2 ++ pkg/api/server/register_volumes.go | 2 ++ pkg/api/server/server.go | 2 ++ pkg/api/types/types.go | 2 ++ pkg/domain/infra/abi/apply.go | 2 ++ pkg/domain/infra/abi/archive.go | 2 ++ pkg/domain/infra/abi/auto-update.go | 2 ++ pkg/domain/infra/abi/config.go | 2 ++ pkg/domain/infra/abi/config_test.go | 2 ++ pkg/domain/infra/abi/containers.go | 5 ++-- pkg/domain/infra/abi/containers_freebsd.go | 2 ++ pkg/domain/infra/abi/containers_linux.go | 2 ++ pkg/domain/infra/abi/containers_runlabel.go | 2 ++ .../infra/abi/containers_runlabel_test.go | 2 ++ pkg/domain/infra/abi/containers_stat.go | 2 ++ pkg/domain/infra/abi/events.go | 2 ++ pkg/domain/infra/abi/generate.go | 2 ++ pkg/domain/infra/abi/healthcheck.go | 2 ++ pkg/domain/infra/abi/images.go | 2 ++ pkg/domain/infra/abi/images_list.go | 2 ++ pkg/domain/infra/abi/images_test.go | 2 ++ .../infra/abi/internal/expansion/expand.go | 2 ++ .../abi/internal/expansion/expand_test.go | 2 ++ pkg/domain/infra/abi/manifest.go | 2 ++ pkg/domain/infra/abi/network.go | 2 ++ pkg/domain/infra/abi/parse/parse.go | 2 ++ pkg/domain/infra/abi/play.go | 2 ++ pkg/domain/infra/abi/play_test.go | 2 ++ pkg/domain/infra/abi/play_utils.go | 2 ++ pkg/domain/infra/abi/play_utils_test.go | 2 ++ pkg/domain/infra/abi/pods.go | 2 ++ pkg/domain/infra/abi/pods_stats.go | 2 ++ pkg/domain/infra/abi/runtime.go | 2 ++ pkg/domain/infra/abi/secrets.go | 2 ++ pkg/domain/infra/abi/secrets_test.go | 2 ++ pkg/domain/infra/abi/system.go | 2 ++ pkg/domain/infra/abi/system_freebsd.go | 2 ++ pkg/domain/infra/abi/system_linux.go | 2 ++ .../infra/abi/terminal/sigproxy_commn.go | 2 +- pkg/domain/infra/abi/terminal/terminal.go | 2 ++ .../infra/abi/terminal/terminal_common.go | 2 +- .../abi/terminal/terminal_unsupported.go | 2 +- pkg/domain/infra/abi/trust.go | 2 ++ pkg/domain/infra/abi/volumes.go | 2 ++ pkg/domain/infra/tunnel/containers.go | 2 +- pkg/{api/handlers => util}/changes.go | 2 +- pkg/{api/handlers => util}/changes_test.go | 2 +- 158 files changed, 305 insertions(+), 56 deletions(-) delete mode 100644 cmd/podman-testing/store_unsupported.go delete mode 100644 internal/domain/infra/runtime_tunnel.go rename pkg/{api/handlers => util}/changes.go (98%) rename pkg/{api/handlers => util}/changes_test.go (98%) diff --git a/cmd/podman-testing/create.go b/cmd/podman-testing/create.go index 1bdd14c5f9..99cb291771 100644 --- a/cmd/podman-testing/create.go +++ b/cmd/podman-testing/create.go @@ -1,3 +1,5 @@ +//go:build !remote + package main import ( diff --git a/cmd/podman-testing/data.go b/cmd/podman-testing/data.go index 6fe2099c00..81333cba3f 100644 --- a/cmd/podman-testing/data.go +++ b/cmd/podman-testing/data.go @@ -1,3 +1,5 @@ +//go:build !remote + package main import ( diff --git a/cmd/podman-testing/layer.go b/cmd/podman-testing/layer.go index ae4de28ca1..2b21ae2f6d 100644 --- a/cmd/podman-testing/layer.go +++ b/cmd/podman-testing/layer.go @@ -1,3 +1,5 @@ +//go:build !remote + package main import ( diff --git a/cmd/podman-testing/main.go b/cmd/podman-testing/main.go index ccc1ff7454..e883a6b84e 100644 --- a/cmd/podman-testing/main.go +++ b/cmd/podman-testing/main.go @@ -1,3 +1,5 @@ +//go:build !remote + package main import ( diff --git a/cmd/podman-testing/remove.go b/cmd/podman-testing/remove.go index 59dadfd2d0..90efefa587 100644 --- a/cmd/podman-testing/remove.go +++ b/cmd/podman-testing/remove.go @@ -1,3 +1,5 @@ +//go:build !remote + package main import ( diff --git a/cmd/podman-testing/store_supported.go b/cmd/podman-testing/store_supported.go index b8e2fac5a7..8931930e13 100644 --- a/cmd/podman-testing/store_supported.go +++ b/cmd/podman-testing/store_supported.go @@ -1,5 +1,4 @@ //go:build linux && !remote -// +build linux,!remote package main diff --git a/cmd/podman-testing/store_unsupported.go b/cmd/podman-testing/store_unsupported.go deleted file mode 100644 index de79ed88b0..0000000000 --- a/cmd/podman-testing/store_unsupported.go +++ /dev/null @@ -1,16 +0,0 @@ -//go:build !linux || remote -// +build !linux remote - -package main - -import "github.com/containers/podman/v5/pkg/domain/entities" - -const engineMode = entities.TunnelMode - -func storeBefore() error { - return nil -} - -func storeAfter() error { - return nil -} diff --git a/cmd/podman/containers/commit.go b/cmd/podman/containers/commit.go index b0cf44fe6d..40e816f650 100644 --- a/cmd/podman/containers/commit.go +++ b/cmd/podman/containers/commit.go @@ -9,7 +9,6 @@ import ( "github.com/containers/common/pkg/completion" "github.com/containers/podman/v5/cmd/podman/common" "github.com/containers/podman/v5/cmd/podman/registry" - "github.com/containers/podman/v5/pkg/api/handlers" "github.com/containers/podman/v5/pkg/domain/entities" "github.com/spf13/cobra" ) @@ -105,9 +104,6 @@ func commit(cmd *cobra.Command, args []string) error { if !commitOptions.Quiet { commitOptions.Writer = os.Stderr } - if len(commitOptions.Changes) > 0 { - commitOptions.Changes = handlers.DecodeChanges(commitOptions.Changes) - } if len(configFile) > 0 { cfg, err := os.ReadFile(configFile) if err != nil { diff --git a/internal/domain/entities/engine_testing.go b/internal/domain/entities/engine_testing.go index 9ad9ee18bb..28c78a46a5 100644 --- a/internal/domain/entities/engine_testing.go +++ b/internal/domain/entities/engine_testing.go @@ -1,3 +1,5 @@ +//go:build !remote + package entities import ( diff --git a/internal/domain/entities/testing.go b/internal/domain/entities/testing.go index 754c4927e7..caba5e61ef 100644 --- a/internal/domain/entities/testing.go +++ b/internal/domain/entities/testing.go @@ -1,3 +1,5 @@ +//go:build !remote + package entities type CreateStorageLayerOptions struct { diff --git a/internal/domain/infra/abi/testing.go b/internal/domain/infra/abi/testing.go index 4cf49d0801..f617656dbd 100644 --- a/internal/domain/infra/abi/testing.go +++ b/internal/domain/infra/abi/testing.go @@ -1,3 +1,5 @@ +//go:build !remote + package abi import ( diff --git a/internal/domain/infra/abi/testing_test.go b/internal/domain/infra/abi/testing_test.go index 75c6f4f542..dbad5489d6 100644 --- a/internal/domain/infra/abi/testing_test.go +++ b/internal/domain/infra/abi/testing_test.go @@ -1,3 +1,5 @@ +//go:build !remote + package abi import "github.com/containers/podman/v5/internal/domain/entities" diff --git a/internal/domain/infra/runtime_tunnel.go b/internal/domain/infra/runtime_tunnel.go deleted file mode 100644 index 5bade4eddc..0000000000 --- a/internal/domain/infra/runtime_tunnel.go +++ /dev/null @@ -1,25 +0,0 @@ -//go:build remote - -package infra - -import ( - "context" - "fmt" - - ientities "github.com/containers/podman/v5/internal/domain/entities" - "github.com/containers/podman/v5/internal/domain/infra/tunnel" - "github.com/containers/podman/v5/pkg/bindings" - "github.com/containers/podman/v5/pkg/domain/entities" -) - -// NewTestingEngine factory provides a libpod runtime for testing-specific operations -func NewTestingEngine(facts *entities.PodmanConfig) (ientities.TestingEngine, error) { - switch facts.EngineMode { - case entities.ABIMode: - return nil, fmt.Errorf("direct image runtime not supported") - case entities.TunnelMode: - ctx, err := bindings.NewConnectionWithIdentity(context.Background(), facts.URI, facts.Identity, facts.MachineMode) - return &tunnel.TestingEngine{ClientCtx: ctx}, err - } - return nil, fmt.Errorf("runtime mode '%v' is not supported", facts.EngineMode) -} diff --git a/internal/domain/infra/tunnel/testing.go b/internal/domain/infra/tunnel/testing.go index 8efc6c3727..66d62633ad 100644 --- a/internal/domain/infra/tunnel/testing.go +++ b/internal/domain/infra/tunnel/testing.go @@ -1,3 +1,5 @@ +//go:build !remote + package tunnel import ( diff --git a/internal/domain/infra/tunnel/testing_test.go b/internal/domain/infra/tunnel/testing_test.go index d8cfa120f4..f803e77a1a 100644 --- a/internal/domain/infra/tunnel/testing_test.go +++ b/internal/domain/infra/tunnel/testing_test.go @@ -1,3 +1,5 @@ +//go:build !remote + package tunnel import "github.com/containers/podman/v5/internal/domain/entities" diff --git a/pkg/api/handlers/compat/auth.go b/pkg/api/handlers/compat/auth.go index 9364d4c6d9..162f7d6520 100644 --- a/pkg/api/handlers/compat/auth.go +++ b/pkg/api/handlers/compat/auth.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/changes.go b/pkg/api/handlers/compat/changes.go index 5b74ae07c3..cfcb0990f6 100644 --- a/pkg/api/handlers/compat/changes.go +++ b/pkg/api/handlers/compat/changes.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/containers.go b/pkg/api/handlers/compat/containers.go index dfaf6fbe73..bd883bf6f2 100644 --- a/pkg/api/handlers/compat/containers.go +++ b/pkg/api/handlers/compat/containers.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/containers_archive.go b/pkg/api/handlers/compat/containers_archive.go index 044ec6455e..8849641525 100644 --- a/pkg/api/handlers/compat/containers_archive.go +++ b/pkg/api/handlers/compat/containers_archive.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/containers_attach.go b/pkg/api/handlers/compat/containers_attach.go index 6d7295cdf2..301be134b1 100644 --- a/pkg/api/handlers/compat/containers_attach.go +++ b/pkg/api/handlers/compat/containers_attach.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/containers_create.go b/pkg/api/handlers/compat/containers_create.go index cef33d37dd..404c117bb6 100644 --- a/pkg/api/handlers/compat/containers_create.go +++ b/pkg/api/handlers/compat/containers_create.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/containers_export.go b/pkg/api/handlers/compat/containers_export.go index a95406ab7a..9cc4fd9f99 100644 --- a/pkg/api/handlers/compat/containers_export.go +++ b/pkg/api/handlers/compat/containers_export.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/containers_logs.go b/pkg/api/handlers/compat/containers_logs.go index 3f5f75406c..b1440ff9dd 100644 --- a/pkg/api/handlers/compat/containers_logs.go +++ b/pkg/api/handlers/compat/containers_logs.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/containers_pause.go b/pkg/api/handlers/compat/containers_pause.go index acd06ae420..b002d6bac8 100644 --- a/pkg/api/handlers/compat/containers_pause.go +++ b/pkg/api/handlers/compat/containers_pause.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/containers_prune.go b/pkg/api/handlers/compat/containers_prune.go index 30b38403b0..fe2de39358 100644 --- a/pkg/api/handlers/compat/containers_prune.go +++ b/pkg/api/handlers/compat/containers_prune.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/containers_restart.go b/pkg/api/handlers/compat/containers_restart.go index 3681993dde..91e8573f5f 100644 --- a/pkg/api/handlers/compat/containers_restart.go +++ b/pkg/api/handlers/compat/containers_restart.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/containers_start.go b/pkg/api/handlers/compat/containers_start.go index 813f5e1f1d..ef4d7c5f82 100644 --- a/pkg/api/handlers/compat/containers_start.go +++ b/pkg/api/handlers/compat/containers_start.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/containers_stats_freebsd.go b/pkg/api/handlers/compat/containers_stats_freebsd.go index 06490bbe90..ad48739fb9 100644 --- a/pkg/api/handlers/compat/containers_stats_freebsd.go +++ b/pkg/api/handlers/compat/containers_stats_freebsd.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/containers_stats_linux.go b/pkg/api/handlers/compat/containers_stats_linux.go index 6c4d5f2fbf..ccb48dc3b4 100644 --- a/pkg/api/handlers/compat/containers_stats_linux.go +++ b/pkg/api/handlers/compat/containers_stats_linux.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/containers_stop.go b/pkg/api/handlers/compat/containers_stop.go index b801508335..208c33f043 100644 --- a/pkg/api/handlers/compat/containers_stop.go +++ b/pkg/api/handlers/compat/containers_stop.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/containers_top.go b/pkg/api/handlers/compat/containers_top.go index ea72919dfc..9653906277 100644 --- a/pkg/api/handlers/compat/containers_top.go +++ b/pkg/api/handlers/compat/containers_top.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/containers_unpause.go b/pkg/api/handlers/compat/containers_unpause.go index 7533c5a905..70205d258e 100644 --- a/pkg/api/handlers/compat/containers_unpause.go +++ b/pkg/api/handlers/compat/containers_unpause.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/events.go b/pkg/api/handlers/compat/events.go index 4ab12eb022..e449aa0cab 100644 --- a/pkg/api/handlers/compat/events.go +++ b/pkg/api/handlers/compat/events.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/exec.go b/pkg/api/handlers/compat/exec.go index 88ccffa9f4..e7f29d727a 100644 --- a/pkg/api/handlers/compat/exec.go +++ b/pkg/api/handlers/compat/exec.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/images.go b/pkg/api/handlers/compat/images.go index 8dde5f1f61..a7e2701cb1 100644 --- a/pkg/api/handlers/compat/images.go +++ b/pkg/api/handlers/compat/images.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( @@ -137,7 +139,7 @@ func CommitContainer(w http.ResponseWriter, r *http.Request) { options.Author = query.Author options.Pause = query.Pause options.Squash = query.Squash - options.Changes = handlers.DecodeChanges(query.Changes) + options.Changes = util.DecodeChanges(query.Changes) if r.Body != nil { defer r.Body.Close() if options.CommitOptions.OverrideConfig, err = abi.DecodeOverrideConfig(r.Body); err != nil { diff --git a/pkg/api/handlers/compat/images_build.go b/pkg/api/handlers/compat/images_build.go index 920882edcf..5d59b7abb0 100644 --- a/pkg/api/handlers/compat/images_build.go +++ b/pkg/api/handlers/compat/images_build.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/images_history.go b/pkg/api/handlers/compat/images_history.go index 4ed97cdbe8..4d55ff4a6b 100644 --- a/pkg/api/handlers/compat/images_history.go +++ b/pkg/api/handlers/compat/images_history.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/images_prune.go b/pkg/api/handlers/compat/images_prune.go index 8cc303a6e2..35dbe290e0 100644 --- a/pkg/api/handlers/compat/images_prune.go +++ b/pkg/api/handlers/compat/images_prune.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/images_push.go b/pkg/api/handlers/compat/images_push.go index 1710006c67..319dc98a27 100644 --- a/pkg/api/handlers/compat/images_push.go +++ b/pkg/api/handlers/compat/images_push.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/images_remove.go b/pkg/api/handlers/compat/images_remove.go index 957a87c5ad..5dd7a56958 100644 --- a/pkg/api/handlers/compat/images_remove.go +++ b/pkg/api/handlers/compat/images_remove.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/images_save.go b/pkg/api/handlers/compat/images_save.go index 6314756f6b..c3022348a8 100644 --- a/pkg/api/handlers/compat/images_save.go +++ b/pkg/api/handlers/compat/images_save.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/images_search.go b/pkg/api/handlers/compat/images_search.go index d918929f6d..93f2c47870 100644 --- a/pkg/api/handlers/compat/images_search.go +++ b/pkg/api/handlers/compat/images_search.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/images_tag.go b/pkg/api/handlers/compat/images_tag.go index d210b70764..9e5dc09d0c 100644 --- a/pkg/api/handlers/compat/images_tag.go +++ b/pkg/api/handlers/compat/images_tag.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/info.go b/pkg/api/handlers/compat/info.go index d4c2f5f649..1f6e249b74 100644 --- a/pkg/api/handlers/compat/info.go +++ b/pkg/api/handlers/compat/info.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/networks.go b/pkg/api/handlers/compat/networks.go index 598645bfc0..4d31cfd2e9 100644 --- a/pkg/api/handlers/compat/networks.go +++ b/pkg/api/handlers/compat/networks.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/ping.go b/pkg/api/handlers/compat/ping.go index 94d2099cdd..2601788143 100644 --- a/pkg/api/handlers/compat/ping.go +++ b/pkg/api/handlers/compat/ping.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/resize.go b/pkg/api/handlers/compat/resize.go index 8d13d9b70c..19ce87929c 100644 --- a/pkg/api/handlers/compat/resize.go +++ b/pkg/api/handlers/compat/resize.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/secrets.go b/pkg/api/handlers/compat/secrets.go index 13f7508ca2..bf1cdca0f3 100644 --- a/pkg/api/handlers/compat/secrets.go +++ b/pkg/api/handlers/compat/secrets.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/system.go b/pkg/api/handlers/compat/system.go index d53e9c3012..e22920cbc1 100644 --- a/pkg/api/handlers/compat/system.go +++ b/pkg/api/handlers/compat/system.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/types.go b/pkg/api/handlers/compat/types.go index 3c42190932..2402fe7b45 100644 --- a/pkg/api/handlers/compat/types.go +++ b/pkg/api/handlers/compat/types.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/unsupported.go b/pkg/api/handlers/compat/unsupported.go index 31afb85bad..476502fe06 100644 --- a/pkg/api/handlers/compat/unsupported.go +++ b/pkg/api/handlers/compat/unsupported.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/version.go b/pkg/api/handlers/compat/version.go index 4b0af7bf79..e1c40007e7 100644 --- a/pkg/api/handlers/compat/version.go +++ b/pkg/api/handlers/compat/version.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/compat/volumes.go b/pkg/api/handlers/compat/volumes.go index 4bb0a16807..943190841b 100644 --- a/pkg/api/handlers/compat/volumes.go +++ b/pkg/api/handlers/compat/volumes.go @@ -1,3 +1,5 @@ +//go:build !remote + package compat import ( diff --git a/pkg/api/handlers/decoder.go b/pkg/api/handlers/decoder.go index 4750fa1c54..6904f4f21e 100644 --- a/pkg/api/handlers/decoder.go +++ b/pkg/api/handlers/decoder.go @@ -1,3 +1,5 @@ +//go:build !remote + package handlers import ( diff --git a/pkg/api/handlers/libpod/containers.go b/pkg/api/handlers/libpod/containers.go index 0dabd649bb..726c30b2e7 100644 --- a/pkg/api/handlers/libpod/containers.go +++ b/pkg/api/handlers/libpod/containers.go @@ -1,3 +1,5 @@ +//go:build !remote + package libpod import ( diff --git a/pkg/api/handlers/libpod/containers_create.go b/pkg/api/handlers/libpod/containers_create.go index 1df0bb2a40..1a12942226 100644 --- a/pkg/api/handlers/libpod/containers_create.go +++ b/pkg/api/handlers/libpod/containers_create.go @@ -1,3 +1,5 @@ +//go:build !remote + package libpod import ( diff --git a/pkg/api/handlers/libpod/containers_stats.go b/pkg/api/handlers/libpod/containers_stats.go index 2ed2006c91..d595e3d607 100644 --- a/pkg/api/handlers/libpod/containers_stats.go +++ b/pkg/api/handlers/libpod/containers_stats.go @@ -1,3 +1,5 @@ +//go:build !remote + package libpod import ( diff --git a/pkg/api/handlers/libpod/generate.go b/pkg/api/handlers/libpod/generate.go index 9c9ea458a9..5751369376 100644 --- a/pkg/api/handlers/libpod/generate.go +++ b/pkg/api/handlers/libpod/generate.go @@ -1,3 +1,5 @@ +//go:build !remote + package libpod import ( diff --git a/pkg/api/handlers/libpod/healthcheck.go b/pkg/api/handlers/libpod/healthcheck.go index e5e9214051..c5ccdbac38 100644 --- a/pkg/api/handlers/libpod/healthcheck.go +++ b/pkg/api/handlers/libpod/healthcheck.go @@ -1,3 +1,5 @@ +//go:build !remote + package libpod import ( diff --git a/pkg/api/handlers/libpod/images.go b/pkg/api/handlers/libpod/images.go index aa12e5976b..91d2b7377a 100644 --- a/pkg/api/handlers/libpod/images.go +++ b/pkg/api/handlers/libpod/images.go @@ -1,3 +1,5 @@ +//go:build !remote + package libpod import ( @@ -499,7 +501,7 @@ func CommitContainer(w http.ResponseWriter, r *http.Request) { options.Author = query.Author options.Pause = query.Pause options.Squash = query.Squash - options.Changes = handlers.DecodeChanges(query.Changes) + options.Changes = util.DecodeChanges(query.Changes) ctr, err := runtime.LookupContainer(query.Container) if err != nil { utils.Error(w, http.StatusNotFound, err) diff --git a/pkg/api/handlers/libpod/images_pull.go b/pkg/api/handlers/libpod/images_pull.go index 7075b98b64..317e33d64e 100644 --- a/pkg/api/handlers/libpod/images_pull.go +++ b/pkg/api/handlers/libpod/images_pull.go @@ -1,3 +1,5 @@ +//go:build !remote + package libpod import ( diff --git a/pkg/api/handlers/libpod/images_push.go b/pkg/api/handlers/libpod/images_push.go index ce9d5d19e1..576f25cf64 100644 --- a/pkg/api/handlers/libpod/images_push.go +++ b/pkg/api/handlers/libpod/images_push.go @@ -1,3 +1,5 @@ +//go:build !remote + package libpod import ( diff --git a/pkg/api/handlers/libpod/info.go b/pkg/api/handlers/libpod/info.go index 536cd51d8f..546991699b 100644 --- a/pkg/api/handlers/libpod/info.go +++ b/pkg/api/handlers/libpod/info.go @@ -1,3 +1,5 @@ +//go:build !remote + package libpod import ( diff --git a/pkg/api/handlers/libpod/kube.go b/pkg/api/handlers/libpod/kube.go index 8d6d096ca1..7068074f3b 100644 --- a/pkg/api/handlers/libpod/kube.go +++ b/pkg/api/handlers/libpod/kube.go @@ -1,3 +1,5 @@ +//go:build !remote + package libpod import ( diff --git a/pkg/api/handlers/libpod/manifests.go b/pkg/api/handlers/libpod/manifests.go index df0b1ba733..d6db94dbd8 100644 --- a/pkg/api/handlers/libpod/manifests.go +++ b/pkg/api/handlers/libpod/manifests.go @@ -1,3 +1,5 @@ +//go:build !remote + package libpod import ( diff --git a/pkg/api/handlers/libpod/networks.go b/pkg/api/handlers/libpod/networks.go index e427cb94f6..1bbcfa9f5e 100644 --- a/pkg/api/handlers/libpod/networks.go +++ b/pkg/api/handlers/libpod/networks.go @@ -1,3 +1,5 @@ +//go:build !remote + package libpod import ( diff --git a/pkg/api/handlers/libpod/play.go b/pkg/api/handlers/libpod/play.go index 74830badbf..0e7625c5ff 100644 --- a/pkg/api/handlers/libpod/play.go +++ b/pkg/api/handlers/libpod/play.go @@ -1,3 +1,5 @@ +//go:build !remote + package libpod import ( diff --git a/pkg/api/handlers/libpod/pods.go b/pkg/api/handlers/libpod/pods.go index 1c2ee28505..68c089774e 100644 --- a/pkg/api/handlers/libpod/pods.go +++ b/pkg/api/handlers/libpod/pods.go @@ -1,3 +1,5 @@ +//go:build !remote + package libpod import ( diff --git a/pkg/api/handlers/libpod/secrets.go b/pkg/api/handlers/libpod/secrets.go index 56d27778c5..068ebecb76 100644 --- a/pkg/api/handlers/libpod/secrets.go +++ b/pkg/api/handlers/libpod/secrets.go @@ -1,3 +1,5 @@ +//go:build !remote + package libpod import ( diff --git a/pkg/api/handlers/libpod/swagger_spec.go b/pkg/api/handlers/libpod/swagger_spec.go index 3ba2cb4d35..bcfb407e38 100644 --- a/pkg/api/handlers/libpod/swagger_spec.go +++ b/pkg/api/handlers/libpod/swagger_spec.go @@ -1,3 +1,5 @@ +//go:build !remote + package libpod import ( diff --git a/pkg/api/handlers/libpod/system.go b/pkg/api/handlers/libpod/system.go index c6444fd901..a658d20d90 100644 --- a/pkg/api/handlers/libpod/system.go +++ b/pkg/api/handlers/libpod/system.go @@ -1,3 +1,5 @@ +//go:build !remote + package libpod import ( diff --git a/pkg/api/handlers/libpod/volumes.go b/pkg/api/handlers/libpod/volumes.go index b3b3ce27ae..986052e924 100644 --- a/pkg/api/handlers/libpod/volumes.go +++ b/pkg/api/handlers/libpod/volumes.go @@ -1,3 +1,5 @@ +//go:build !remote + package libpod import ( diff --git a/pkg/api/handlers/swagger/doc.go b/pkg/api/handlers/swagger/doc.go index 7e535ea298..8b1c557c6c 100644 --- a/pkg/api/handlers/swagger/doc.go +++ b/pkg/api/handlers/swagger/doc.go @@ -1,3 +1,5 @@ +//go:build !remote + // Package swagger defines the payloads used by the Podman API // // - errors.go: declares the errors used in the API. By embedding errors.ErrorModel, more meaningful diff --git a/pkg/api/handlers/swagger/errors.go b/pkg/api/handlers/swagger/errors.go index 176fa3c18c..2fac8b36fa 100644 --- a/pkg/api/handlers/swagger/errors.go +++ b/pkg/api/handlers/swagger/errors.go @@ -1,3 +1,5 @@ +//go:build !remote + //nolint:unused // these types are used to wire generated swagger to API code package swagger diff --git a/pkg/api/handlers/swagger/models.go b/pkg/api/handlers/swagger/models.go index d792c41072..56fd5d8b56 100644 --- a/pkg/api/handlers/swagger/models.go +++ b/pkg/api/handlers/swagger/models.go @@ -1,3 +1,5 @@ +//go:build !remote + //nolint:unused // these types are used to wire generated swagger to API code package swagger diff --git a/pkg/api/handlers/swagger/responses.go b/pkg/api/handlers/swagger/responses.go index 5c0192f919..f3fe133342 100644 --- a/pkg/api/handlers/swagger/responses.go +++ b/pkg/api/handlers/swagger/responses.go @@ -1,3 +1,5 @@ +//go:build !remote + //nolint:unused // these types are used to wire generated swagger to API code package swagger diff --git a/pkg/api/handlers/utils/apiutil/apiutil.go b/pkg/api/handlers/utils/apiutil/apiutil.go index 48f4dfba5d..f5fde780b4 100644 --- a/pkg/api/handlers/utils/apiutil/apiutil.go +++ b/pkg/api/handlers/utils/apiutil/apiutil.go @@ -1,3 +1,5 @@ +//go:build !remote + package apiutil import ( diff --git a/pkg/api/handlers/utils/apiutil/apiutil_test.go b/pkg/api/handlers/utils/apiutil/apiutil_test.go index 377c0ef84a..02a1194d06 100644 --- a/pkg/api/handlers/utils/apiutil/apiutil_test.go +++ b/pkg/api/handlers/utils/apiutil/apiutil_test.go @@ -1,3 +1,5 @@ +//go:build !remote + package apiutil import ( diff --git a/pkg/api/handlers/utils/containers.go b/pkg/api/handlers/utils/containers.go index 383505cabb..62af4b45d1 100644 --- a/pkg/api/handlers/utils/containers.go +++ b/pkg/api/handlers/utils/containers.go @@ -1,3 +1,5 @@ +//go:build !remote + package utils import ( diff --git a/pkg/api/handlers/utils/errors.go b/pkg/api/handlers/utils/errors.go index f659aa06cc..82255ac410 100644 --- a/pkg/api/handlers/utils/errors.go +++ b/pkg/api/handlers/utils/errors.go @@ -1,3 +1,5 @@ +//go:build !remote + package utils import ( diff --git a/pkg/api/handlers/utils/handler.go b/pkg/api/handlers/utils/handler.go index 49bbf4c0cf..dc425ce656 100644 --- a/pkg/api/handlers/utils/handler.go +++ b/pkg/api/handlers/utils/handler.go @@ -1,3 +1,5 @@ +//go:build !remote + package utils import ( diff --git a/pkg/api/handlers/utils/handler_test.go b/pkg/api/handlers/utils/handler_test.go index 099f4169b9..4df0f08042 100644 --- a/pkg/api/handlers/utils/handler_test.go +++ b/pkg/api/handlers/utils/handler_test.go @@ -1,3 +1,5 @@ +//go:build !remote + package utils import ( diff --git a/pkg/api/handlers/utils/images.go b/pkg/api/handlers/utils/images.go index c330e45e55..f97f493972 100644 --- a/pkg/api/handlers/utils/images.go +++ b/pkg/api/handlers/utils/images.go @@ -1,3 +1,5 @@ +//go:build !remote + package utils import ( diff --git a/pkg/api/server/doc.go b/pkg/api/server/doc.go index b7f31fffa9..63a9bc0a3a 100644 --- a/pkg/api/server/doc.go +++ b/pkg/api/server/doc.go @@ -1,3 +1,5 @@ +//go:build !remote + // Package server supports a RESTful API for the Libpod library // // This documentation describes the Podman v2.x+ RESTful API. It consists of a Docker-compatible diff --git a/pkg/api/server/handler_api.go b/pkg/api/server/handler_api.go index 7696db4eec..9a895f0814 100644 --- a/pkg/api/server/handler_api.go +++ b/pkg/api/server/handler_api.go @@ -1,3 +1,5 @@ +//go:build !remote + package server import ( diff --git a/pkg/api/server/handler_logging.go b/pkg/api/server/handler_logging.go index 2f62a28fd3..1fd75e233f 100644 --- a/pkg/api/server/handler_logging.go +++ b/pkg/api/server/handler_logging.go @@ -1,3 +1,5 @@ +//go:build !remote + package server import ( diff --git a/pkg/api/server/handler_panic.go b/pkg/api/server/handler_panic.go index 5bab6eff83..e654c0047a 100644 --- a/pkg/api/server/handler_panic.go +++ b/pkg/api/server/handler_panic.go @@ -1,3 +1,5 @@ +//go:build !remote + package server import ( diff --git a/pkg/api/server/handler_rid.go b/pkg/api/server/handler_rid.go index 7869cc1a14..1acd47823b 100644 --- a/pkg/api/server/handler_rid.go +++ b/pkg/api/server/handler_rid.go @@ -1,3 +1,5 @@ +//go:build !remote + package server import ( diff --git a/pkg/api/server/idle/tracker.go b/pkg/api/server/idle/tracker.go index fe815f6138..c192d13e11 100644 --- a/pkg/api/server/idle/tracker.go +++ b/pkg/api/server/idle/tracker.go @@ -1,3 +1,5 @@ +//go:build !remote + package idle import ( diff --git a/pkg/api/server/listener_api.go b/pkg/api/server/listener_api.go index 38abe27431..a657396922 100644 --- a/pkg/api/server/listener_api.go +++ b/pkg/api/server/listener_api.go @@ -1,3 +1,5 @@ +//go:build !remote + package server import ( diff --git a/pkg/api/server/register_archive.go b/pkg/api/server/register_archive.go index 6e031a074e..b21983a241 100644 --- a/pkg/api/server/register_archive.go +++ b/pkg/api/server/register_archive.go @@ -1,3 +1,5 @@ +//go:build !remote + package server import ( diff --git a/pkg/api/server/register_auth.go b/pkg/api/server/register_auth.go index 6fabd65fe0..d199f4cfae 100644 --- a/pkg/api/server/register_auth.go +++ b/pkg/api/server/register_auth.go @@ -1,3 +1,5 @@ +//go:build !remote + package server import ( diff --git a/pkg/api/server/register_containers.go b/pkg/api/server/register_containers.go index b3a603af95..cc1cc5e74d 100644 --- a/pkg/api/server/register_containers.go +++ b/pkg/api/server/register_containers.go @@ -1,3 +1,5 @@ +//go:build !remote + package server import ( diff --git a/pkg/api/server/register_distribution.go b/pkg/api/server/register_distribution.go index d85480d090..90607bb99f 100644 --- a/pkg/api/server/register_distribution.go +++ b/pkg/api/server/register_distribution.go @@ -1,3 +1,5 @@ +//go:build !remote + package server import ( diff --git a/pkg/api/server/register_events.go b/pkg/api/server/register_events.go index aa8b3d0d9a..5f8090fc8b 100644 --- a/pkg/api/server/register_events.go +++ b/pkg/api/server/register_events.go @@ -1,3 +1,5 @@ +//go:build !remote + package server import ( diff --git a/pkg/api/server/register_exec.go b/pkg/api/server/register_exec.go index 56228ae1aa..f1eaaeaf01 100644 --- a/pkg/api/server/register_exec.go +++ b/pkg/api/server/register_exec.go @@ -1,3 +1,5 @@ +//go:build !remote + package server import ( diff --git a/pkg/api/server/register_generate.go b/pkg/api/server/register_generate.go index 2d1d517cf8..c5299a5754 100644 --- a/pkg/api/server/register_generate.go +++ b/pkg/api/server/register_generate.go @@ -1,3 +1,5 @@ +//go:build !remote + package server import ( diff --git a/pkg/api/server/register_healthcheck.go b/pkg/api/server/register_healthcheck.go index b3643af6df..1535f984ce 100644 --- a/pkg/api/server/register_healthcheck.go +++ b/pkg/api/server/register_healthcheck.go @@ -1,3 +1,5 @@ +//go:build !remote + package server import ( diff --git a/pkg/api/server/register_images.go b/pkg/api/server/register_images.go index 68ab63cc1d..fa01634b5c 100644 --- a/pkg/api/server/register_images.go +++ b/pkg/api/server/register_images.go @@ -1,3 +1,5 @@ +//go:build !remote + package server import ( diff --git a/pkg/api/server/register_info.go b/pkg/api/server/register_info.go index 5f6a114326..6252ac57c2 100644 --- a/pkg/api/server/register_info.go +++ b/pkg/api/server/register_info.go @@ -1,3 +1,5 @@ +//go:build !remote + package server import ( diff --git a/pkg/api/server/register_kube.go b/pkg/api/server/register_kube.go index 5678746669..b50bafecab 100644 --- a/pkg/api/server/register_kube.go +++ b/pkg/api/server/register_kube.go @@ -1,3 +1,5 @@ +//go:build !remote + package server import ( diff --git a/pkg/api/server/register_manifest.go b/pkg/api/server/register_manifest.go index a7bd4efc11..a6de54d0b6 100644 --- a/pkg/api/server/register_manifest.go +++ b/pkg/api/server/register_manifest.go @@ -1,3 +1,5 @@ +//go:build !remote + package server import ( diff --git a/pkg/api/server/register_monitor.go b/pkg/api/server/register_monitor.go index b892442bd2..7bcfafa813 100644 --- a/pkg/api/server/register_monitor.go +++ b/pkg/api/server/register_monitor.go @@ -1,3 +1,5 @@ +//go:build !remote + package server import ( diff --git a/pkg/api/server/register_networks.go b/pkg/api/server/register_networks.go index 38075e93b5..c324b4c73b 100644 --- a/pkg/api/server/register_networks.go +++ b/pkg/api/server/register_networks.go @@ -1,3 +1,5 @@ +//go:build !remote + package server import ( diff --git a/pkg/api/server/register_ping.go b/pkg/api/server/register_ping.go index 041fbf301a..ee0098e9af 100644 --- a/pkg/api/server/register_ping.go +++ b/pkg/api/server/register_ping.go @@ -1,3 +1,5 @@ +//go:build !remote + package server import ( diff --git a/pkg/api/server/register_plugins.go b/pkg/api/server/register_plugins.go index 2e4aca8d4a..8ea03d7376 100644 --- a/pkg/api/server/register_plugins.go +++ b/pkg/api/server/register_plugins.go @@ -1,3 +1,5 @@ +//go:build !remote + package server import ( diff --git a/pkg/api/server/register_pods.go b/pkg/api/server/register_pods.go index 0eb7e79a80..842e1588fc 100644 --- a/pkg/api/server/register_pods.go +++ b/pkg/api/server/register_pods.go @@ -1,3 +1,5 @@ +//go:build !remote + package server import ( diff --git a/pkg/api/server/register_secrets.go b/pkg/api/server/register_secrets.go index deb0fc2492..0540abf356 100644 --- a/pkg/api/server/register_secrets.go +++ b/pkg/api/server/register_secrets.go @@ -1,3 +1,5 @@ +//go:build !remote + package server import ( diff --git a/pkg/api/server/register_swagger.go b/pkg/api/server/register_swagger.go index ceb9d87426..db5c6709e4 100644 --- a/pkg/api/server/register_swagger.go +++ b/pkg/api/server/register_swagger.go @@ -1,3 +1,5 @@ +//go:build !remote + package server import ( diff --git a/pkg/api/server/register_swarm.go b/pkg/api/server/register_swarm.go index 4dcb63cf32..af819ebb34 100644 --- a/pkg/api/server/register_swarm.go +++ b/pkg/api/server/register_swarm.go @@ -1,3 +1,5 @@ +//go:build !remote + package server import ( diff --git a/pkg/api/server/register_system.go b/pkg/api/server/register_system.go index 4010dfb0e0..91d31a86d3 100644 --- a/pkg/api/server/register_system.go +++ b/pkg/api/server/register_system.go @@ -1,3 +1,5 @@ +//go:build !remote + package server import ( diff --git a/pkg/api/server/register_version.go b/pkg/api/server/register_version.go index 1a62e51d83..1d1ca0eef0 100644 --- a/pkg/api/server/register_version.go +++ b/pkg/api/server/register_version.go @@ -1,3 +1,5 @@ +//go:build !remote + package server import ( diff --git a/pkg/api/server/register_volumes.go b/pkg/api/server/register_volumes.go index 7ad71e58cb..867325d24e 100644 --- a/pkg/api/server/register_volumes.go +++ b/pkg/api/server/register_volumes.go @@ -1,3 +1,5 @@ +//go:build !remote + package server import ( diff --git a/pkg/api/server/server.go b/pkg/api/server/server.go index 8c5b73872a..4c07390d0d 100644 --- a/pkg/api/server/server.go +++ b/pkg/api/server/server.go @@ -1,3 +1,5 @@ +//go:build !remote + package server import ( diff --git a/pkg/api/types/types.go b/pkg/api/types/types.go index a01ded0111..eb4d89e0f2 100644 --- a/pkg/api/types/types.go +++ b/pkg/api/types/types.go @@ -1,3 +1,5 @@ +//go:build !remote + package types type APIContextKey int diff --git a/pkg/domain/infra/abi/apply.go b/pkg/domain/infra/abi/apply.go index 9031546365..2c3986b4e1 100644 --- a/pkg/domain/infra/abi/apply.go +++ b/pkg/domain/infra/abi/apply.go @@ -1,3 +1,5 @@ +//go:build !remote + package abi import ( diff --git a/pkg/domain/infra/abi/archive.go b/pkg/domain/infra/abi/archive.go index 49dc9f3f04..711d54f93d 100644 --- a/pkg/domain/infra/abi/archive.go +++ b/pkg/domain/infra/abi/archive.go @@ -1,3 +1,5 @@ +//go:build !remote + package abi import ( diff --git a/pkg/domain/infra/abi/auto-update.go b/pkg/domain/infra/abi/auto-update.go index 57504e92a1..f8f14169da 100644 --- a/pkg/domain/infra/abi/auto-update.go +++ b/pkg/domain/infra/abi/auto-update.go @@ -1,3 +1,5 @@ +//go:build !remote + package abi import ( diff --git a/pkg/domain/infra/abi/config.go b/pkg/domain/infra/abi/config.go index ae564cf442..bc41498a8e 100644 --- a/pkg/domain/infra/abi/config.go +++ b/pkg/domain/infra/abi/config.go @@ -1,3 +1,5 @@ +//go:build !remote + package abi import ( diff --git a/pkg/domain/infra/abi/config_test.go b/pkg/domain/infra/abi/config_test.go index 4a9af42e43..6ac29276ca 100644 --- a/pkg/domain/infra/abi/config_test.go +++ b/pkg/domain/infra/abi/config_test.go @@ -1,3 +1,5 @@ +//go:build !remote + package abi import ( diff --git a/pkg/domain/infra/abi/containers.go b/pkg/domain/infra/abi/containers.go index 091d493a84..47389e9fdc 100644 --- a/pkg/domain/infra/abi/containers.go +++ b/pkg/domain/infra/abi/containers.go @@ -1,3 +1,5 @@ +//go:build !remote + package abi import ( @@ -18,7 +20,6 @@ import ( "github.com/containers/podman/v5/libpod" "github.com/containers/podman/v5/libpod/define" "github.com/containers/podman/v5/libpod/logs" - "github.com/containers/podman/v5/pkg/api/handlers" "github.com/containers/podman/v5/pkg/checkpoint" "github.com/containers/podman/v5/pkg/domain/entities" "github.com/containers/podman/v5/pkg/domain/entities/reports" @@ -586,7 +587,7 @@ func (ic *ContainerEngine) ContainerCommit(ctx context.Context, nameOrID string, sc := ic.Libpod.SystemContext() var changes []string if len(options.Changes) > 0 { - changes = handlers.DecodeChanges(options.Changes) + changes = util.DecodeChanges(options.Changes) } var overrideConfig *manifest.Schema2Config if len(options.Config) > 0 { diff --git a/pkg/domain/infra/abi/containers_freebsd.go b/pkg/domain/infra/abi/containers_freebsd.go index a095a87cb7..cb47418399 100644 --- a/pkg/domain/infra/abi/containers_freebsd.go +++ b/pkg/domain/infra/abi/containers_freebsd.go @@ -1,3 +1,5 @@ +//go:build !remote + package abi const processFileDescriptorsPath = "/dev/fd" diff --git a/pkg/domain/infra/abi/containers_linux.go b/pkg/domain/infra/abi/containers_linux.go index 10b3d33a49..927aaa611e 100644 --- a/pkg/domain/infra/abi/containers_linux.go +++ b/pkg/domain/infra/abi/containers_linux.go @@ -1,3 +1,5 @@ +//go:build !remote + package abi const processFileDescriptorsPath = "/proc/self/fd" diff --git a/pkg/domain/infra/abi/containers_runlabel.go b/pkg/domain/infra/abi/containers_runlabel.go index 2a4119996f..d27ea0ec7d 100644 --- a/pkg/domain/infra/abi/containers_runlabel.go +++ b/pkg/domain/infra/abi/containers_runlabel.go @@ -1,3 +1,5 @@ +//go:build !remote + package abi import ( diff --git a/pkg/domain/infra/abi/containers_runlabel_test.go b/pkg/domain/infra/abi/containers_runlabel_test.go index 10f9ae0040..3b12b54f7d 100644 --- a/pkg/domain/infra/abi/containers_runlabel_test.go +++ b/pkg/domain/infra/abi/containers_runlabel_test.go @@ -1,3 +1,5 @@ +//go:build !remote + package abi import ( diff --git a/pkg/domain/infra/abi/containers_stat.go b/pkg/domain/infra/abi/containers_stat.go index 99cde00350..aed498fe01 100644 --- a/pkg/domain/infra/abi/containers_stat.go +++ b/pkg/domain/infra/abi/containers_stat.go @@ -1,3 +1,5 @@ +//go:build !remote + package abi import ( diff --git a/pkg/domain/infra/abi/events.go b/pkg/domain/infra/abi/events.go index ffbd119f1c..ad2bf5313f 100644 --- a/pkg/domain/infra/abi/events.go +++ b/pkg/domain/infra/abi/events.go @@ -1,3 +1,5 @@ +//go:build !remote + package abi import ( diff --git a/pkg/domain/infra/abi/generate.go b/pkg/domain/infra/abi/generate.go index e424500fbd..d58fb03238 100644 --- a/pkg/domain/infra/abi/generate.go +++ b/pkg/domain/infra/abi/generate.go @@ -1,3 +1,5 @@ +//go:build !remote + package abi import ( diff --git a/pkg/domain/infra/abi/healthcheck.go b/pkg/domain/infra/abi/healthcheck.go index b464c88c4b..6c61dfa4fe 100644 --- a/pkg/domain/infra/abi/healthcheck.go +++ b/pkg/domain/infra/abi/healthcheck.go @@ -1,3 +1,5 @@ +//go:build !remote + package abi import ( diff --git a/pkg/domain/infra/abi/images.go b/pkg/domain/infra/abi/images.go index f61b54c227..dceea76445 100644 --- a/pkg/domain/infra/abi/images.go +++ b/pkg/domain/infra/abi/images.go @@ -1,3 +1,5 @@ +//go:build !remote + package abi import ( diff --git a/pkg/domain/infra/abi/images_list.go b/pkg/domain/infra/abi/images_list.go index 6f6d575711..9fa855035a 100644 --- a/pkg/domain/infra/abi/images_list.go +++ b/pkg/domain/infra/abi/images_list.go @@ -1,3 +1,5 @@ +//go:build !remote + package abi import ( diff --git a/pkg/domain/infra/abi/images_test.go b/pkg/domain/infra/abi/images_test.go index 3999de4578..f24a11cd0e 100644 --- a/pkg/domain/infra/abi/images_test.go +++ b/pkg/domain/infra/abi/images_test.go @@ -1,3 +1,5 @@ +//go:build !remote + package abi import ( diff --git a/pkg/domain/infra/abi/internal/expansion/expand.go b/pkg/domain/infra/abi/internal/expansion/expand.go index 6bf0ea8ce0..293679380a 100644 --- a/pkg/domain/infra/abi/internal/expansion/expand.go +++ b/pkg/domain/infra/abi/internal/expansion/expand.go @@ -1,3 +1,5 @@ +//go:build !remote + package expansion import ( diff --git a/pkg/domain/infra/abi/internal/expansion/expand_test.go b/pkg/domain/infra/abi/internal/expansion/expand_test.go index 45f32edfc6..e432ceee66 100644 --- a/pkg/domain/infra/abi/internal/expansion/expand_test.go +++ b/pkg/domain/infra/abi/internal/expansion/expand_test.go @@ -1,3 +1,5 @@ +//go:build !remote + package expansion import ( diff --git a/pkg/domain/infra/abi/manifest.go b/pkg/domain/infra/abi/manifest.go index d7f1054b19..253e173474 100644 --- a/pkg/domain/infra/abi/manifest.go +++ b/pkg/domain/infra/abi/manifest.go @@ -1,3 +1,5 @@ +//go:build !remote + package abi import ( diff --git a/pkg/domain/infra/abi/network.go b/pkg/domain/infra/abi/network.go index c39b9c600b..5dc3963ba1 100644 --- a/pkg/domain/infra/abi/network.go +++ b/pkg/domain/infra/abi/network.go @@ -1,3 +1,5 @@ +//go:build !remote + package abi import ( diff --git a/pkg/domain/infra/abi/parse/parse.go b/pkg/domain/infra/abi/parse/parse.go index 571e52a951..268610716c 100644 --- a/pkg/domain/infra/abi/parse/parse.go +++ b/pkg/domain/infra/abi/parse/parse.go @@ -1,3 +1,5 @@ +//go:build !remote + package parse import ( diff --git a/pkg/domain/infra/abi/play.go b/pkg/domain/infra/abi/play.go index 6374f212ba..3fb5b5b6d9 100644 --- a/pkg/domain/infra/abi/play.go +++ b/pkg/domain/infra/abi/play.go @@ -1,3 +1,5 @@ +//go:build !remote + package abi import ( diff --git a/pkg/domain/infra/abi/play_test.go b/pkg/domain/infra/abi/play_test.go index 4661763e28..ef6207f127 100644 --- a/pkg/domain/infra/abi/play_test.go +++ b/pkg/domain/infra/abi/play_test.go @@ -1,3 +1,5 @@ +//go:build !remote + package abi import ( diff --git a/pkg/domain/infra/abi/play_utils.go b/pkg/domain/infra/abi/play_utils.go index 16d30acd16..7285d9c9b9 100644 --- a/pkg/domain/infra/abi/play_utils.go +++ b/pkg/domain/infra/abi/play_utils.go @@ -1,3 +1,5 @@ +//go:build !remote + package abi import "github.com/containers/podman/v5/libpod/define" diff --git a/pkg/domain/infra/abi/play_utils_test.go b/pkg/domain/infra/abi/play_utils_test.go index 8bc56e234b..fa4b6010c0 100644 --- a/pkg/domain/infra/abi/play_utils_test.go +++ b/pkg/domain/infra/abi/play_utils_test.go @@ -1,3 +1,5 @@ +//go:build !remote + package abi import ( diff --git a/pkg/domain/infra/abi/pods.go b/pkg/domain/infra/abi/pods.go index 8d44532023..d402421cc8 100644 --- a/pkg/domain/infra/abi/pods.go +++ b/pkg/domain/infra/abi/pods.go @@ -1,3 +1,5 @@ +//go:build !remote + package abi import ( diff --git a/pkg/domain/infra/abi/pods_stats.go b/pkg/domain/infra/abi/pods_stats.go index 26d070344e..3b76407f7d 100644 --- a/pkg/domain/infra/abi/pods_stats.go +++ b/pkg/domain/infra/abi/pods_stats.go @@ -1,3 +1,5 @@ +//go:build !remote + package abi import ( diff --git a/pkg/domain/infra/abi/runtime.go b/pkg/domain/infra/abi/runtime.go index bfa182f243..6e5f3240ef 100644 --- a/pkg/domain/infra/abi/runtime.go +++ b/pkg/domain/infra/abi/runtime.go @@ -1,3 +1,5 @@ +//go:build !remote + package abi import ( diff --git a/pkg/domain/infra/abi/secrets.go b/pkg/domain/infra/abi/secrets.go index 02fbc94269..5f5cfdc19b 100644 --- a/pkg/domain/infra/abi/secrets.go +++ b/pkg/domain/infra/abi/secrets.go @@ -1,3 +1,5 @@ +//go:build !remote + package abi import ( diff --git a/pkg/domain/infra/abi/secrets_test.go b/pkg/domain/infra/abi/secrets_test.go index 6b3a745e25..fb6157d9c5 100644 --- a/pkg/domain/infra/abi/secrets_test.go +++ b/pkg/domain/infra/abi/secrets_test.go @@ -1,3 +1,5 @@ +//go:build !remote + package abi import ( diff --git a/pkg/domain/infra/abi/system.go b/pkg/domain/infra/abi/system.go index 5da8aba326..440d81e48b 100644 --- a/pkg/domain/infra/abi/system.go +++ b/pkg/domain/infra/abi/system.go @@ -1,3 +1,5 @@ +//go:build !remote + package abi import ( diff --git a/pkg/domain/infra/abi/system_freebsd.go b/pkg/domain/infra/abi/system_freebsd.go index 1521a7e1a8..9f17df7828 100644 --- a/pkg/domain/infra/abi/system_freebsd.go +++ b/pkg/domain/infra/abi/system_freebsd.go @@ -1,3 +1,5 @@ +//go:build !remote + package abi import ( diff --git a/pkg/domain/infra/abi/system_linux.go b/pkg/domain/infra/abi/system_linux.go index 6dd99554cd..50e4632408 100644 --- a/pkg/domain/infra/abi/system_linux.go +++ b/pkg/domain/infra/abi/system_linux.go @@ -1,3 +1,5 @@ +//go:build !remote + package abi import ( diff --git a/pkg/domain/infra/abi/terminal/sigproxy_commn.go b/pkg/domain/infra/abi/terminal/sigproxy_commn.go index e4a601f93d..df9aee00ad 100644 --- a/pkg/domain/infra/abi/terminal/sigproxy_commn.go +++ b/pkg/domain/infra/abi/terminal/sigproxy_commn.go @@ -1,4 +1,4 @@ -//go:build linux || freebsd +//go:build (linux || freebsd) && !remote package terminal diff --git a/pkg/domain/infra/abi/terminal/terminal.go b/pkg/domain/infra/abi/terminal/terminal.go index c7b75c6c29..954997c095 100644 --- a/pkg/domain/infra/abi/terminal/terminal.go +++ b/pkg/domain/infra/abi/terminal/terminal.go @@ -1,3 +1,5 @@ +//go:build !remote + package terminal import ( diff --git a/pkg/domain/infra/abi/terminal/terminal_common.go b/pkg/domain/infra/abi/terminal/terminal_common.go index 5ca0d8d2c4..065ac3012d 100644 --- a/pkg/domain/infra/abi/terminal/terminal_common.go +++ b/pkg/domain/infra/abi/terminal/terminal_common.go @@ -1,4 +1,4 @@ -//go:build linux || freebsd +//go:build (linux || freebsd) && !remote package terminal diff --git a/pkg/domain/infra/abi/terminal/terminal_unsupported.go b/pkg/domain/infra/abi/terminal/terminal_unsupported.go index a1b5ac37d1..b67c738751 100644 --- a/pkg/domain/infra/abi/terminal/terminal_unsupported.go +++ b/pkg/domain/infra/abi/terminal/terminal_unsupported.go @@ -1,4 +1,4 @@ -//go:build !linux && !freebsd +//go:build !linux && !freebsd && !remote package terminal diff --git a/pkg/domain/infra/abi/trust.go b/pkg/domain/infra/abi/trust.go index e23ed4bd57..5b617b1154 100644 --- a/pkg/domain/infra/abi/trust.go +++ b/pkg/domain/infra/abi/trust.go @@ -1,3 +1,5 @@ +//go:build !remote + package abi import ( diff --git a/pkg/domain/infra/abi/volumes.go b/pkg/domain/infra/abi/volumes.go index d99ab0f992..7ecc29324f 100644 --- a/pkg/domain/infra/abi/volumes.go +++ b/pkg/domain/infra/abi/volumes.go @@ -1,3 +1,5 @@ +//go:build !remote + package abi import ( diff --git a/pkg/domain/infra/tunnel/containers.go b/pkg/domain/infra/tunnel/containers.go index 9c81fb2197..6e8c6fea44 100644 --- a/pkg/domain/infra/tunnel/containers.go +++ b/pkg/domain/infra/tunnel/containers.go @@ -350,7 +350,7 @@ func (ic *ContainerEngine) ContainerCommit(ctx context.Context, nameOrID string, } var changes []string if len(opts.Changes) > 0 { - changes = handlers.DecodeChanges(opts.Changes) + changes = util.DecodeChanges(opts.Changes) } var configReader io.Reader if len(opts.Config) > 0 { diff --git a/pkg/api/handlers/changes.go b/pkg/util/changes.go similarity index 98% rename from pkg/api/handlers/changes.go rename to pkg/util/changes.go index 58e3a739ad..86f418c335 100644 --- a/pkg/api/handlers/changes.go +++ b/pkg/util/changes.go @@ -1,4 +1,4 @@ -package handlers +package util import ( "strings" diff --git a/pkg/api/handlers/changes_test.go b/pkg/util/changes_test.go similarity index 98% rename from pkg/api/handlers/changes_test.go rename to pkg/util/changes_test.go index 03ff1523e7..2b635c5d64 100644 --- a/pkg/api/handlers/changes_test.go +++ b/pkg/util/changes_test.go @@ -1,4 +1,4 @@ -package handlers +package util import ( "testing" From 6c0d94328fd53d7f46048e1d5be32dd05f958f89 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Thu, 15 Aug 2024 13:22:59 +0200 Subject: [PATCH 3/6] golangci-lint: remove most skip dirs Now that we have propert !remote tags set everywhere we can just rely on that and do not need to skip any dirs. Also on linux do not lint three times, one remote run is enough. We still have to skip the test dir for windows/macos though or we need to add linux build tags there everywhere as well. This seems simpler. Signed-off-by: Paul Holzinger --- hack/golangci-lint.sh | 6 +++--- libpod/events/logfile_test.go | 2 ++ pkg/bindings/test/resource_test.go | 2 ++ test/e2e/run_networking_test.go | 2 ++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/hack/golangci-lint.sh b/hack/golangci-lint.sh index 8803b68bd3..70a371ad86 100755 --- a/hack/golangci-lint.sh +++ b/hack/golangci-lint.sh @@ -18,11 +18,11 @@ BUILD_TAGS_TUNNEL="$BUILD_TAGS_DEFAULT,remote" BUILD_TAGS_REMOTE="remote,containers_image_openpgp" SKIP_DIRS_ABI="" -SKIP_DIRS_TUNNEL="pkg/api,pkg/domain/infra/abi,internal/domain/infra/abi" -SKIP_DIRS_REMOTE="libpod/events,pkg/api,pkg/domain/infra/abi,internal/domain/infra/abi,pkg/machine/qemu,pkg/trust,test" +SKIP_DIRS_TUNNEL="" +SKIP_DIRS_REMOTE="libpod/events,test" declare -a to_lint -to_lint=(ABI TUNNEL REMOTE) +to_lint=(ABI TUNNEL) # Special-case, for Darwin and Windows only "remote" linting is possible and required. if [[ "$GOOS" == "windows" ]] || [[ "$GOOS" == "darwin" ]]; then diff --git a/libpod/events/logfile_test.go b/libpod/events/logfile_test.go index 0fb344177c..f391ef2277 100644 --- a/libpod/events/logfile_test.go +++ b/libpod/events/logfile_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package events import ( diff --git a/pkg/bindings/test/resource_test.go b/pkg/bindings/test/resource_test.go index 3a2421c8a3..1afca1d788 100644 --- a/pkg/bindings/test/resource_test.go +++ b/pkg/bindings/test/resource_test.go @@ -1,3 +1,5 @@ +//go:build linux + package bindings_test import ( diff --git a/test/e2e/run_networking_test.go b/test/e2e/run_networking_test.go index 813de9f737..010c8f17c6 100644 --- a/test/e2e/run_networking_test.go +++ b/test/e2e/run_networking_test.go @@ -1,3 +1,5 @@ +//go:build linux + package integration import ( From cd2a4c7cac7c67f946eb986db2d7a516f3203cfe Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Thu, 15 Aug 2024 14:59:22 +0200 Subject: [PATCH 4/6] test/e2e: remove kernel version check We need something newer than 4.14 anyway now for most Podman functions. This is breaking liniting on windows as the function doesn't work there. Signed-off-by: Paul Holzinger --- test/e2e/run_privileged_test.go | 7 -- test/utils/common_function_test.go | 12 --- test/utils/utils.go | 22 ----- .../storage/pkg/parsers/kernel/kernel.go | 90 ------------------- .../pkg/parsers/kernel/kernel_darwin.go | 57 ------------ .../storage/pkg/parsers/kernel/kernel_unix.go | 20 ----- .../pkg/parsers/kernel/kernel_windows.go | 70 --------------- vendor/modules.txt | 1 - 8 files changed, 279 deletions(-) delete mode 100644 vendor/github.com/containers/storage/pkg/parsers/kernel/kernel.go delete mode 100644 vendor/github.com/containers/storage/pkg/parsers/kernel/kernel_darwin.go delete mode 100644 vendor/github.com/containers/storage/pkg/parsers/kernel/kernel_unix.go delete mode 100644 vendor/github.com/containers/storage/pkg/parsers/kernel/kernel_windows.go diff --git a/test/e2e/run_privileged_test.go b/test/e2e/run_privileged_test.go index 5e6c5fb51d..2a30138c09 100644 --- a/test/e2e/run_privileged_test.go +++ b/test/e2e/run_privileged_test.go @@ -137,13 +137,6 @@ var _ = Describe("Podman privileged container tests", func() { }) It("run no-new-privileges test", func() { - // Check if our kernel is new enough - k, err := IsKernelNewerThan("4.14") - Expect(err).ToNot(HaveOccurred()) - if !k { - Skip("Kernel is not new enough to test this feature") - } - cap := SystemExec("grep", []string{"NoNewPrivs", "/proc/self/status"}) if cap.ExitCode() != 0 { Skip("Can't determine NoNewPrivs") diff --git a/test/utils/common_function_test.go b/test/utils/common_function_test.go index 6d6c49dcb7..988e83b1b2 100644 --- a/test/utils/common_function_test.go +++ b/test/utils/common_function_test.go @@ -56,18 +56,6 @@ var _ = Describe("Common functions test", func() { Entry("Item empty with and without \"", "/tmp/os-release.test", "", "\"\"", false), ) - DescribeTable("Test IsKernelNewerThan", - func(kv string, expect, isNil bool) { - newer, err := IsKernelNewerThan(kv) - Expect(newer).To(Equal(expect), "Version compare results is not as expect.") - Expect(err == nil).To(Equal(isNil), "Error is not as expect.") - }, - Entry("Invalid kernel version: 0", "0", false, false), - Entry("Older kernel version:0.0", "0.0", true, true), - Entry("Newer kernel version: 100.17.14", "100.17.14", false, true), - Entry("Invalid kernel version: I am not a kernel version", "I am not a kernel version", false, false), - ) - DescribeTable("Test TestIsCommandAvailable", func(cmd string, expect bool) { cmdExist := IsCommandAvailable(cmd) diff --git a/test/utils/utils.go b/test/utils/utils.go index 5c0ca23648..da4fa57865 100644 --- a/test/utils/utils.go +++ b/test/utils/utils.go @@ -19,7 +19,6 @@ import ( "github.com/sirupsen/logrus" - "github.com/containers/storage/pkg/parsers/kernel" . "github.com/onsi/ginkgo/v2" //nolint:revive,stylecheck . "github.com/onsi/gomega" //nolint:revive,stylecheck . "github.com/onsi/gomega/gexec" //nolint:revive,stylecheck @@ -455,27 +454,6 @@ func GetHostDistributionInfo() HostOS { return host } -// IsKernelNewerThan compares the current kernel version to one provided. If -// the kernel is equal to or greater, returns true -func IsKernelNewerThan(version string) (bool, error) { - inputVersion, err := kernel.ParseRelease(version) - if err != nil { - return false, err - } - kv, err := kernel.GetKernelVersion() - if err != nil { - return false, err - } - - // CompareKernelVersion compares two kernel.VersionInfo structs. - // Returns -1 if a < b, 0 if a == b, 1 it a > b - result := kernel.CompareKernelVersion(*kv, *inputVersion) - if result >= 0 { - return true, nil - } - return false, nil -} - // IsCommandAvailable check if command exist func IsCommandAvailable(command string) bool { check := exec.Command("bash", "-c", strings.Join([]string{"command -v", command}, " ")) diff --git a/vendor/github.com/containers/storage/pkg/parsers/kernel/kernel.go b/vendor/github.com/containers/storage/pkg/parsers/kernel/kernel.go deleted file mode 100644 index 5cee2693ad..0000000000 --- a/vendor/github.com/containers/storage/pkg/parsers/kernel/kernel.go +++ /dev/null @@ -1,90 +0,0 @@ -//go:build !windows -// +build !windows - -// Package kernel provides helper function to get, parse and compare kernel -// versions for different platforms. -package kernel - -import ( - "errors" - "fmt" - - "github.com/sirupsen/logrus" -) - -// VersionInfo holds information about the kernel. -type VersionInfo struct { - Kernel int // Version of the kernel (e.g. 4.1.2-generic -> 4) - Major int // Major part of the kernel version (e.g. 4.1.2-generic -> 1) - Minor int // Minor part of the kernel version (e.g. 4.1.2-generic -> 2) - Flavor string // Flavor of the kernel version (e.g. 4.1.2-generic -> generic) -} - -func (k *VersionInfo) String() string { - return fmt.Sprintf("%d.%d.%d%s", k.Kernel, k.Major, k.Minor, k.Flavor) -} - -// CompareKernelVersion compares two kernel.VersionInfo structs. -// Returns -1 if a < b, 0 if a == b, 1 it a > b -func CompareKernelVersion(a, b VersionInfo) int { - if a.Kernel < b.Kernel { - return -1 - } else if a.Kernel > b.Kernel { - return 1 - } - - if a.Major < b.Major { - return -1 - } else if a.Major > b.Major { - return 1 - } - - if a.Minor < b.Minor { - return -1 - } else if a.Minor > b.Minor { - return 1 - } - - return 0 -} - -// CheckKernelVersion checks if current kernel is newer than (or equal to) -// the given version. -func CheckKernelVersion(k, major, minor int) bool { - if v, err := GetKernelVersion(); err != nil { - logrus.Warnf("Error getting kernel version: %s", err) - } else { - if CompareKernelVersion(*v, VersionInfo{Kernel: k, Major: major, Minor: minor}) < 0 { - return false - } - } - return true -} - -// ParseRelease parses a string and creates a VersionInfo based on it. -func ParseRelease(release string) (*VersionInfo, error) { - var ( - kernel, major, minor, parsed int - flavor, partial string - ) - - // Ignore error from Sscanf to allow an empty flavor. Instead, just - // make sure we got all the version numbers. - parsed, _ = fmt.Sscanf(release, "%d.%d%s", &kernel, &major, &partial) - if parsed < 2 { - return nil, errors.New("Can't parse kernel version " + release) - } - - // sometimes we have 3.12.25-gentoo, but sometimes we just have 3.12-1-amd64 - parsed, _ = fmt.Sscanf(partial, ".%d%s", &minor, &flavor) - if parsed < 1 { - flavor = partial - } - - return &VersionInfo{ - Kernel: kernel, - Major: major, - Minor: minor, - Flavor: flavor, - }, nil -} diff --git a/vendor/github.com/containers/storage/pkg/parsers/kernel/kernel_darwin.go b/vendor/github.com/containers/storage/pkg/parsers/kernel/kernel_darwin.go deleted file mode 100644 index 645790da64..0000000000 --- a/vendor/github.com/containers/storage/pkg/parsers/kernel/kernel_darwin.go +++ /dev/null @@ -1,57 +0,0 @@ -//go:build darwin -// +build darwin - -// Package kernel provides helper function to get, parse and compare kernel -// versions for different platforms. -package kernel - -import ( - "fmt" - "os/exec" - "strings" - - "github.com/mattn/go-shellwords" -) - -// GetKernelVersion gets the current kernel version. -func GetKernelVersion() (*VersionInfo, error) { - release, err := getRelease() - if err != nil { - return nil, err - } - - return ParseRelease(release) -} - -// getRelease uses `system_profiler SPSoftwareDataType` to get OSX kernel version -func getRelease() (string, error) { - cmd := exec.Command("system_profiler", "SPSoftwareDataType") - osName, err := cmd.Output() - if err != nil { - return "", err - } - - var release string - data := strings.Split(string(osName), "\n") - for _, line := range data { - if strings.Contains(line, "Kernel Version") { - // It has the format like ' Kernel Version: Darwin 14.5.0' - content := strings.SplitN(line, ":", 2) - if len(content) != 2 { - return "", fmt.Errorf("kernel version is invalid") - } - - prettyNames, err := shellwords.Parse(content[1]) - if err != nil { - return "", fmt.Errorf("kernel version is invalid: %w", err) - } - - if len(prettyNames) != 2 { - return "", fmt.Errorf("kernel version needs to be 'Darwin x.x.x' ") - } - release = prettyNames[1] - } - } - - return release, nil -} diff --git a/vendor/github.com/containers/storage/pkg/parsers/kernel/kernel_unix.go b/vendor/github.com/containers/storage/pkg/parsers/kernel/kernel_unix.go deleted file mode 100644 index 48a8b12cf1..0000000000 --- a/vendor/github.com/containers/storage/pkg/parsers/kernel/kernel_unix.go +++ /dev/null @@ -1,20 +0,0 @@ -//go:build unix && !darwin - -// Package kernel provides helper function to get, parse and compare kernel -// versions for different platforms. -package kernel - -import ( - "golang.org/x/sys/unix" -) - -// GetKernelVersion gets the current kernel version. -func GetKernelVersion() (*VersionInfo, error) { - uts := &unix.Utsname{} - - if err := unix.Uname(uts); err != nil { - return nil, err - } - - return ParseRelease(unix.ByteSliceToString(uts.Release[:])) -} diff --git a/vendor/github.com/containers/storage/pkg/parsers/kernel/kernel_windows.go b/vendor/github.com/containers/storage/pkg/parsers/kernel/kernel_windows.go deleted file mode 100644 index 4b7fdee830..0000000000 --- a/vendor/github.com/containers/storage/pkg/parsers/kernel/kernel_windows.go +++ /dev/null @@ -1,70 +0,0 @@ -//go:build windows -// +build windows - -package kernel - -import ( - "fmt" - "unsafe" - - "golang.org/x/sys/windows" -) - -// VersionInfo holds information about the kernel. -type VersionInfo struct { - kvi string // Version of the kernel (e.g. 6.1.7601.17592 -> 6) - major int // Major part of the kernel version (e.g. 6.1.7601.17592 -> 1) - minor int // Minor part of the kernel version (e.g. 6.1.7601.17592 -> 7601) - build int // Build number of the kernel version (e.g. 6.1.7601.17592 -> 17592) -} - -func (k *VersionInfo) String() string { - return fmt.Sprintf("%d.%d %d (%s)", k.major, k.minor, k.build, k.kvi) -} - -// GetKernelVersion gets the current kernel version. -func GetKernelVersion() (*VersionInfo, error) { - var ( - h windows.Handle - dwVersion uint32 - err error - ) - - KVI := &VersionInfo{"Unknown", 0, 0, 0} - - if err = windows.RegOpenKeyEx(windows.HKEY_LOCAL_MACHINE, - windows.StringToUTF16Ptr(`SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\`), - 0, - windows.KEY_READ, - &h); err != nil { - return KVI, err - } - defer windows.RegCloseKey(h) - - var buf [1 << 10]uint16 - var typ uint32 - n := uint32(len(buf) * 2) // api expects array of bytes, not uint16 - - if err = windows.RegQueryValueEx(h, - windows.StringToUTF16Ptr("BuildLabEx"), - nil, - &typ, - (*byte)(unsafe.Pointer(&buf[0])), - &n); err != nil { - return KVI, err - } - - KVI.kvi = windows.UTF16ToString(buf[:]) - - // Important - docker.exe MUST be manifested for this API to return - // the correct information. - if dwVersion, err = windows.GetVersion(); err != nil { - return KVI, err - } - - KVI.major = int(dwVersion & 0xFF) - KVI.minor = int((dwVersion & 0xFF00) >> 8) - KVI.build = int((dwVersion & 0xFFFF0000) >> 16) - - return KVI, nil -} diff --git a/vendor/modules.txt b/vendor/modules.txt index 83520fc0e2..9836fb6755 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -389,7 +389,6 @@ github.com/containers/storage/pkg/longpath github.com/containers/storage/pkg/loopback github.com/containers/storage/pkg/mount github.com/containers/storage/pkg/parsers -github.com/containers/storage/pkg/parsers/kernel github.com/containers/storage/pkg/pools github.com/containers/storage/pkg/promise github.com/containers/storage/pkg/reexec From 666d8391576686eaba32c2bd05e48a5212affa17 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Thu, 15 Aug 2024 15:12:37 +0200 Subject: [PATCH 5/6] golangci-lint: make windows linting happy It qemu cannot be compiled anyway so make sure we do not try to compile parts where the typechecker complains about on windows. Also all the e2e test files are only used on linux as well. pkg/machine/wsl also reports some error but to many for me to fix them now. One minor problem was fixed in pkg/machine/machine_windows.go. Signed-off-by: Paul Holzinger --- hack/golangci-lint.sh | 2 +- pkg/machine/machine_windows.go | 4 ++-- pkg/machine/qemu/config.go | 2 +- test/e2e/attach_test.go | 2 ++ test/e2e/build_test.go | 2 ++ test/e2e/checkpoint_image_test.go | 2 ++ test/e2e/checkpoint_test.go | 2 ++ test/e2e/cleanup_test.go | 2 ++ test/e2e/commit_test.go | 2 ++ test/e2e/common_test.go | 2 ++ test/e2e/config.go | 2 ++ test/e2e/config_amd64.go | 2 ++ test/e2e/config_arm64.go | 2 ++ test/e2e/config_ppc64le.go | 2 ++ test/e2e/container_clone_test.go | 2 ++ test/e2e/container_create_volume_test.go | 2 ++ test/e2e/container_iface_name_test.go | 2 ++ test/e2e/container_inspect_test.go | 2 ++ test/e2e/containers_conf_test.go | 2 ++ test/e2e/cp_test.go | 2 ++ test/e2e/create_staticip_test.go | 2 ++ test/e2e/create_staticmac_test.go | 2 ++ test/e2e/create_test.go | 2 ++ test/e2e/diff_test.go | 2 ++ test/e2e/events_test.go | 2 ++ test/e2e/exec_test.go | 2 ++ test/e2e/exists_test.go | 2 ++ test/e2e/export_test.go | 2 ++ test/e2e/farm_test.go | 2 ++ test/e2e/generate_kube_test.go | 2 ++ test/e2e/generate_spec_test.go | 2 ++ test/e2e/generate_systemd_test.go | 2 ++ test/e2e/healthcheck_run_test.go | 2 ++ test/e2e/history_test.go | 2 ++ test/e2e/image_scp_test.go | 2 ++ test/e2e/image_sign_test.go | 2 ++ test/e2e/images_test.go | 2 ++ test/e2e/import_test.go | 2 ++ test/e2e/info_test.go | 2 ++ test/e2e/init_test.go | 2 ++ test/e2e/inspect_test.go | 2 ++ test/e2e/kill_test.go | 2 ++ test/e2e/libpod_suite_remote_test.go | 2 +- test/e2e/libpod_suite_test.go | 2 +- test/e2e/load_test.go | 2 ++ test/e2e/login_logout_test.go | 2 ++ test/e2e/logs_test.go | 2 ++ test/e2e/manifest_test.go | 2 ++ test/e2e/mount_rootless_test.go | 2 ++ test/e2e/mount_test.go | 2 ++ test/e2e/negative_test.go | 2 ++ test/e2e/network_connect_disconnect_test.go | 2 ++ test/e2e/network_create_test.go | 2 ++ test/e2e/network_test.go | 2 ++ test/e2e/pause_test.go | 2 ++ test/e2e/play_build_test.go | 2 +- test/e2e/play_kube_test.go | 2 ++ test/e2e/pod_clone_test.go | 2 ++ test/e2e/pod_create_test.go | 2 ++ test/e2e/pod_infra_container_test.go | 2 ++ test/e2e/pod_initcontainers_test.go | 2 ++ test/e2e/pod_inspect_test.go | 2 ++ test/e2e/pod_kill_test.go | 2 ++ test/e2e/pod_pause_test.go | 2 ++ test/e2e/pod_pod_namespaces_test.go | 2 ++ test/e2e/pod_prune_test.go | 2 ++ test/e2e/pod_ps_test.go | 2 ++ test/e2e/pod_restart_test.go | 2 ++ test/e2e/pod_rm_test.go | 2 ++ test/e2e/pod_start_test.go | 2 ++ test/e2e/pod_stats_test.go | 2 ++ test/e2e/pod_stop_test.go | 2 ++ test/e2e/pod_top_test.go | 2 ++ test/e2e/port_test.go | 2 ++ test/e2e/prune_test.go | 2 ++ test/e2e/ps_test.go | 2 ++ test/e2e/pull_test.go | 2 ++ test/e2e/push_test.go | 2 ++ test/e2e/quadlet_test.go | 2 ++ test/e2e/rename_test.go | 2 ++ test/e2e/restart_test.go | 2 ++ test/e2e/rm_test.go | 2 ++ test/e2e/rmi_test.go | 2 ++ test/e2e/run_aardvark_test.go | 2 ++ test/e2e/run_apparmor_test.go | 2 +- test/e2e/run_cgroup_parent_test.go | 2 ++ test/e2e/run_cleanup_test.go | 2 ++ test/e2e/run_cpu_test.go | 2 ++ test/e2e/run_device_test.go | 2 ++ test/e2e/run_dns_test.go | 2 ++ test/e2e/run_entrypoint_test.go | 2 ++ test/e2e/run_env_test.go | 2 ++ test/e2e/run_exit_test.go | 2 ++ test/e2e/run_memory_test.go | 2 ++ test/e2e/run_ns_test.go | 2 ++ test/e2e/run_passwd_test.go | 2 ++ test/e2e/run_privileged_test.go | 2 ++ test/e2e/run_restart_test.go | 2 ++ test/e2e/run_seccomp_test.go | 2 ++ test/e2e/run_security_labels_test.go | 2 ++ test/e2e/run_selinux_test.go | 2 ++ test/e2e/run_signal_test.go | 2 ++ test/e2e/run_staticip_test.go | 2 ++ test/e2e/run_test.go | 2 ++ test/e2e/run_transient_test.go | 2 ++ test/e2e/run_userns_test.go | 2 ++ test/e2e/run_volume_test.go | 2 ++ test/e2e/run_working_dir_test.go | 2 ++ test/e2e/runlabel_test.go | 2 ++ test/e2e/save_test.go | 2 ++ test/e2e/search_test.go | 2 ++ test/e2e/secret_test.go | 2 ++ test/e2e/start_test.go | 2 ++ test/e2e/stats_test.go | 2 ++ test/e2e/stop_test.go | 2 ++ test/e2e/system_connection_test.go | 2 ++ test/e2e/system_df_test.go | 2 ++ test/e2e/system_dial_stdio_test.go | 2 ++ test/e2e/system_reset_test.go | 2 ++ test/e2e/systemd_activate_test.go | 2 ++ test/e2e/systemd_test.go | 2 ++ test/e2e/tag_test.go | 2 ++ test/e2e/toolbox_test.go | 2 ++ test/e2e/top_test.go | 2 ++ test/e2e/tree_test.go | 2 ++ test/e2e/trust_test.go | 2 ++ test/e2e/unshare_test.go | 2 ++ test/e2e/untag_test.go | 2 ++ test/e2e/update_test.go | 2 ++ test/e2e/version_test.go | 2 ++ test/e2e/volume_create_test.go | 2 ++ test/e2e/volume_exists_test.go | 2 ++ test/e2e/volume_inspect_test.go | 2 ++ test/e2e/volume_ls_test.go | 2 ++ test/e2e/volume_plugin_test.go | 2 ++ test/e2e/volume_prune_test.go | 2 ++ test/e2e/volume_rm_test.go | 2 ++ test/e2e/wait_test.go | 2 ++ 138 files changed, 270 insertions(+), 8 deletions(-) diff --git a/hack/golangci-lint.sh b/hack/golangci-lint.sh index 70a371ad86..17d1e00758 100755 --- a/hack/golangci-lint.sh +++ b/hack/golangci-lint.sh @@ -19,7 +19,7 @@ BUILD_TAGS_REMOTE="remote,containers_image_openpgp" SKIP_DIRS_ABI="" SKIP_DIRS_TUNNEL="" -SKIP_DIRS_REMOTE="libpod/events,test" +SKIP_DIRS_REMOTE="libpod/events,pkg/machine/qemu,pkg/machine/wsl,test" declare -a to_lint to_lint=(ABI TUNNEL) diff --git a/pkg/machine/machine_windows.go b/pkg/machine/machine_windows.go index 7d39795bc5..d6c23e64f8 100644 --- a/pkg/machine/machine_windows.go +++ b/pkg/machine/machine_windows.go @@ -207,8 +207,8 @@ func readWinProxyTid(name string, vmtype define.VMType) (uint32, uint32, string, } var pid, tid uint32 - fmt.Sscanf(string(contents), "%d:%d", &pid, &tid) - return pid, tid, tidFile, nil + _, err = fmt.Sscanf(string(contents), "%d:%d", &pid, &tid) + return pid, tid, tidFile, err } func waitTimeout(proc *os.Process, timeout time.Duration) bool { diff --git a/pkg/machine/qemu/config.go b/pkg/machine/qemu/config.go index 760df18ead..7d86bb6349 100644 --- a/pkg/machine/qemu/config.go +++ b/pkg/machine/qemu/config.go @@ -1,4 +1,4 @@ -//go:build !darwin +//go:build !darwin && !windows package qemu diff --git a/test/e2e/attach_test.go b/test/e2e/attach_test.go index 1f22559023..c8570da187 100644 --- a/test/e2e/attach_test.go +++ b/test/e2e/attach_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/build_test.go b/test/e2e/build_test.go index d2d50d49c6..20462d457a 100644 --- a/test/e2e/build_test.go +++ b/test/e2e/build_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/checkpoint_image_test.go b/test/e2e/checkpoint_image_test.go index 093c873092..2481e2226e 100644 --- a/test/e2e/checkpoint_image_test.go +++ b/test/e2e/checkpoint_image_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/checkpoint_test.go b/test/e2e/checkpoint_test.go index 58198fe37e..8b2f13e55e 100644 --- a/test/e2e/checkpoint_test.go +++ b/test/e2e/checkpoint_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/cleanup_test.go b/test/e2e/cleanup_test.go index aa48fab3c3..6fe96028c9 100644 --- a/test/e2e/cleanup_test.go +++ b/test/e2e/cleanup_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/commit_test.go b/test/e2e/commit_test.go index 4ab55303b7..45c2bea13d 100644 --- a/test/e2e/commit_test.go +++ b/test/e2e/commit_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/common_test.go b/test/e2e/common_test.go index 865af505e9..2c36c43e08 100644 --- a/test/e2e/common_test.go +++ b/test/e2e/common_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/config.go b/test/e2e/config.go index 6cadae2a14..af9364502d 100644 --- a/test/e2e/config.go +++ b/test/e2e/config.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration var ( diff --git a/test/e2e/config_amd64.go b/test/e2e/config_amd64.go index f5c1b69198..b00d7bfc5b 100644 --- a/test/e2e/config_amd64.go +++ b/test/e2e/config_amd64.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration var ( diff --git a/test/e2e/config_arm64.go b/test/e2e/config_arm64.go index 1bf29d7816..785c772c25 100644 --- a/test/e2e/config_arm64.go +++ b/test/e2e/config_arm64.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration var ( diff --git a/test/e2e/config_ppc64le.go b/test/e2e/config_ppc64le.go index d89bf1d4f7..1b7b5e2961 100644 --- a/test/e2e/config_ppc64le.go +++ b/test/e2e/config_ppc64le.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration var ( diff --git a/test/e2e/container_clone_test.go b/test/e2e/container_clone_test.go index 343be45164..1f5677b51a 100644 --- a/test/e2e/container_clone_test.go +++ b/test/e2e/container_clone_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/container_create_volume_test.go b/test/e2e/container_create_volume_test.go index 493d08ab39..e7cc8aa36a 100644 --- a/test/e2e/container_create_volume_test.go +++ b/test/e2e/container_create_volume_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/container_iface_name_test.go b/test/e2e/container_iface_name_test.go index a0030b94e8..74d5d91e15 100644 --- a/test/e2e/container_iface_name_test.go +++ b/test/e2e/container_iface_name_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/container_inspect_test.go b/test/e2e/container_inspect_test.go index 2a3861ff86..8e26eb0f25 100644 --- a/test/e2e/container_inspect_test.go +++ b/test/e2e/container_inspect_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/containers_conf_test.go b/test/e2e/containers_conf_test.go index 129c889bcf..469558b718 100644 --- a/test/e2e/containers_conf_test.go +++ b/test/e2e/containers_conf_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/cp_test.go b/test/e2e/cp_test.go index 4a2c7a5108..f71963a811 100644 --- a/test/e2e/cp_test.go +++ b/test/e2e/cp_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/create_staticip_test.go b/test/e2e/create_staticip_test.go index fba85cbf72..32a72b7880 100644 --- a/test/e2e/create_staticip_test.go +++ b/test/e2e/create_staticip_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/create_staticmac_test.go b/test/e2e/create_staticmac_test.go index d020e16530..9d9e3457df 100644 --- a/test/e2e/create_staticmac_test.go +++ b/test/e2e/create_staticmac_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/create_test.go b/test/e2e/create_test.go index 646ff679d9..ca59962f96 100644 --- a/test/e2e/create_test.go +++ b/test/e2e/create_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/diff_test.go b/test/e2e/diff_test.go index 7507f35def..a9c20fadc8 100644 --- a/test/e2e/diff_test.go +++ b/test/e2e/diff_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/events_test.go b/test/e2e/events_test.go index 63ca8f239c..c16df55398 100644 --- a/test/e2e/events_test.go +++ b/test/e2e/events_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/exec_test.go b/test/e2e/exec_test.go index dcb7ff23f8..2b5b411d5b 100644 --- a/test/e2e/exec_test.go +++ b/test/e2e/exec_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/exists_test.go b/test/e2e/exists_test.go index 3da48b8088..579bacda0e 100644 --- a/test/e2e/exists_test.go +++ b/test/e2e/exists_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/export_test.go b/test/e2e/export_test.go index efebd9f8ed..18ae177e0a 100644 --- a/test/e2e/export_test.go +++ b/test/e2e/export_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/farm_test.go b/test/e2e/farm_test.go index ede6d2d94d..556746990f 100644 --- a/test/e2e/farm_test.go +++ b/test/e2e/farm_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/generate_kube_test.go b/test/e2e/generate_kube_test.go index bb8800a8db..9603af245a 100644 --- a/test/e2e/generate_kube_test.go +++ b/test/e2e/generate_kube_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/generate_spec_test.go b/test/e2e/generate_spec_test.go index b4641ae57c..981f912e46 100644 --- a/test/e2e/generate_spec_test.go +++ b/test/e2e/generate_spec_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/generate_systemd_test.go b/test/e2e/generate_systemd_test.go index 81483223f5..c1c5844352 100644 --- a/test/e2e/generate_systemd_test.go +++ b/test/e2e/generate_systemd_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/healthcheck_run_test.go b/test/e2e/healthcheck_run_test.go index de71a38ca0..5a9e444eef 100644 --- a/test/e2e/healthcheck_run_test.go +++ b/test/e2e/healthcheck_run_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/history_test.go b/test/e2e/history_test.go index b5251c1c09..a69a59103f 100644 --- a/test/e2e/history_test.go +++ b/test/e2e/history_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/image_scp_test.go b/test/e2e/image_scp_test.go index e19da2d09e..917363fd70 100644 --- a/test/e2e/image_scp_test.go +++ b/test/e2e/image_scp_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/image_sign_test.go b/test/e2e/image_sign_test.go index 026a2e40e7..5940aaf4a2 100644 --- a/test/e2e/image_sign_test.go +++ b/test/e2e/image_sign_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/images_test.go b/test/e2e/images_test.go index ddde5a27bc..7d6a12a77c 100644 --- a/test/e2e/images_test.go +++ b/test/e2e/images_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/import_test.go b/test/e2e/import_test.go index fb85182e8f..eac9596a33 100644 --- a/test/e2e/import_test.go +++ b/test/e2e/import_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/info_test.go b/test/e2e/info_test.go index 6e5ae8722e..87c8902621 100644 --- a/test/e2e/info_test.go +++ b/test/e2e/info_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/init_test.go b/test/e2e/init_test.go index dae57b6c88..c8c544ad62 100644 --- a/test/e2e/init_test.go +++ b/test/e2e/init_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/inspect_test.go b/test/e2e/inspect_test.go index 72b3c8b5cc..be7809bd32 100644 --- a/test/e2e/inspect_test.go +++ b/test/e2e/inspect_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/kill_test.go b/test/e2e/kill_test.go index 981cf8d760..86e12857ee 100644 --- a/test/e2e/kill_test.go +++ b/test/e2e/kill_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/libpod_suite_remote_test.go b/test/e2e/libpod_suite_remote_test.go index 44a79eaf36..ceaa5851ea 100644 --- a/test/e2e/libpod_suite_remote_test.go +++ b/test/e2e/libpod_suite_remote_test.go @@ -1,4 +1,4 @@ -//go:build remote_testing +//go:build remote_testing && (linux || freebsd) package integration diff --git a/test/e2e/libpod_suite_test.go b/test/e2e/libpod_suite_test.go index 549777e796..3b11b3952b 100644 --- a/test/e2e/libpod_suite_test.go +++ b/test/e2e/libpod_suite_test.go @@ -1,4 +1,4 @@ -//go:build !remote_testing +//go:build !remote_testing && (linux || freebsd) package integration diff --git a/test/e2e/load_test.go b/test/e2e/load_test.go index 9cade0294e..edfad48fb0 100644 --- a/test/e2e/load_test.go +++ b/test/e2e/load_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/login_logout_test.go b/test/e2e/login_logout_test.go index f860f94436..d0b5bb940e 100644 --- a/test/e2e/login_logout_test.go +++ b/test/e2e/login_logout_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/logs_test.go b/test/e2e/logs_test.go index 16392fbbd9..1dc0eb2887 100644 --- a/test/e2e/logs_test.go +++ b/test/e2e/logs_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/manifest_test.go b/test/e2e/manifest_test.go index dba357c18b..22bf064b4e 100644 --- a/test/e2e/manifest_test.go +++ b/test/e2e/manifest_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/mount_rootless_test.go b/test/e2e/mount_rootless_test.go index 7e4af2eb68..9844f260f9 100644 --- a/test/e2e/mount_rootless_test.go +++ b/test/e2e/mount_rootless_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/mount_test.go b/test/e2e/mount_test.go index aba488528f..961e027f09 100644 --- a/test/e2e/mount_test.go +++ b/test/e2e/mount_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/negative_test.go b/test/e2e/negative_test.go index f6cae5352a..2c097bd6e4 100644 --- a/test/e2e/negative_test.go +++ b/test/e2e/negative_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/network_connect_disconnect_test.go b/test/e2e/network_connect_disconnect_test.go index 3764b44bc7..3b2059b244 100644 --- a/test/e2e/network_connect_disconnect_test.go +++ b/test/e2e/network_connect_disconnect_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/network_create_test.go b/test/e2e/network_create_test.go index 0ce6be1a52..b9fcec6431 100644 --- a/test/e2e/network_create_test.go +++ b/test/e2e/network_create_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/network_test.go b/test/e2e/network_test.go index 5072eeee0e..8ce85305cb 100644 --- a/test/e2e/network_test.go +++ b/test/e2e/network_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/pause_test.go b/test/e2e/pause_test.go index 0b474b3ad3..bf9132a49a 100644 --- a/test/e2e/pause_test.go +++ b/test/e2e/pause_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/play_build_test.go b/test/e2e/play_build_test.go index 80157104f5..a18f2dbb52 100644 --- a/test/e2e/play_build_test.go +++ b/test/e2e/play_build_test.go @@ -1,4 +1,4 @@ -//go:build !remote_testing +//go:build !remote_testing && (linux || freebsd) // build for play kube is not supported on remote yet. diff --git a/test/e2e/play_kube_test.go b/test/e2e/play_kube_test.go index c903f73978..a813bbe27d 100644 --- a/test/e2e/play_kube_test.go +++ b/test/e2e/play_kube_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/pod_clone_test.go b/test/e2e/pod_clone_test.go index fb240c279b..a2ddd46ac4 100644 --- a/test/e2e/pod_clone_test.go +++ b/test/e2e/pod_clone_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/pod_create_test.go b/test/e2e/pod_create_test.go index af7545fdda..12fc929310 100644 --- a/test/e2e/pod_create_test.go +++ b/test/e2e/pod_create_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/pod_infra_container_test.go b/test/e2e/pod_infra_container_test.go index adc0303b7d..83aff3680b 100644 --- a/test/e2e/pod_infra_container_test.go +++ b/test/e2e/pod_infra_container_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/pod_initcontainers_test.go b/test/e2e/pod_initcontainers_test.go index 5aa291ed6f..a8458e8ea0 100644 --- a/test/e2e/pod_initcontainers_test.go +++ b/test/e2e/pod_initcontainers_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/pod_inspect_test.go b/test/e2e/pod_inspect_test.go index 8a17a59f2d..e946811187 100644 --- a/test/e2e/pod_inspect_test.go +++ b/test/e2e/pod_inspect_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/pod_kill_test.go b/test/e2e/pod_kill_test.go index 7aa1c88cb1..7ae98d6e62 100644 --- a/test/e2e/pod_kill_test.go +++ b/test/e2e/pod_kill_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/pod_pause_test.go b/test/e2e/pod_pause_test.go index b4e7c05a84..3e673dcc7f 100644 --- a/test/e2e/pod_pause_test.go +++ b/test/e2e/pod_pause_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/pod_pod_namespaces_test.go b/test/e2e/pod_pod_namespaces_test.go index a1597bca61..21409f5055 100644 --- a/test/e2e/pod_pod_namespaces_test.go +++ b/test/e2e/pod_pod_namespaces_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/pod_prune_test.go b/test/e2e/pod_prune_test.go index 851dccabb5..cb772a397e 100644 --- a/test/e2e/pod_prune_test.go +++ b/test/e2e/pod_prune_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/pod_ps_test.go b/test/e2e/pod_ps_test.go index e347fd5757..0fb18d3038 100644 --- a/test/e2e/pod_ps_test.go +++ b/test/e2e/pod_ps_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/pod_restart_test.go b/test/e2e/pod_restart_test.go index 8a07533872..568147a27a 100644 --- a/test/e2e/pod_restart_test.go +++ b/test/e2e/pod_restart_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/pod_rm_test.go b/test/e2e/pod_rm_test.go index cc00d68f98..a847a53414 100644 --- a/test/e2e/pod_rm_test.go +++ b/test/e2e/pod_rm_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/pod_start_test.go b/test/e2e/pod_start_test.go index 640ff48462..9ec7bb59b4 100644 --- a/test/e2e/pod_start_test.go +++ b/test/e2e/pod_start_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/pod_stats_test.go b/test/e2e/pod_stats_test.go index 6dd760d1bb..f2259b9136 100644 --- a/test/e2e/pod_stats_test.go +++ b/test/e2e/pod_stats_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/pod_stop_test.go b/test/e2e/pod_stop_test.go index d68621d3f2..ab9f79482a 100644 --- a/test/e2e/pod_stop_test.go +++ b/test/e2e/pod_stop_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/pod_top_test.go b/test/e2e/pod_top_test.go index e104902e57..b42b50720f 100644 --- a/test/e2e/pod_top_test.go +++ b/test/e2e/pod_top_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/port_test.go b/test/e2e/port_test.go index 591fd9eebf..5f2a71ac0b 100644 --- a/test/e2e/port_test.go +++ b/test/e2e/port_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/prune_test.go b/test/e2e/prune_test.go index 7943d7cfde..dd893fc9b9 100644 --- a/test/e2e/prune_test.go +++ b/test/e2e/prune_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/ps_test.go b/test/e2e/ps_test.go index 280f1b7af6..c79e1e55e1 100644 --- a/test/e2e/ps_test.go +++ b/test/e2e/ps_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/pull_test.go b/test/e2e/pull_test.go index 5dc663e49a..e96de6709e 100644 --- a/test/e2e/pull_test.go +++ b/test/e2e/pull_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/push_test.go b/test/e2e/push_test.go index 0837b94aad..d18e87ae0b 100644 --- a/test/e2e/push_test.go +++ b/test/e2e/push_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/quadlet_test.go b/test/e2e/quadlet_test.go index e93b20eb6f..d3d9ad1a7d 100644 --- a/test/e2e/quadlet_test.go +++ b/test/e2e/quadlet_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/rename_test.go b/test/e2e/rename_test.go index 27698e937c..abd34abf12 100644 --- a/test/e2e/rename_test.go +++ b/test/e2e/rename_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/restart_test.go b/test/e2e/restart_test.go index 53872b1818..21090a337a 100644 --- a/test/e2e/restart_test.go +++ b/test/e2e/restart_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/rm_test.go b/test/e2e/rm_test.go index 7a734c9285..8b4cc4d06c 100644 --- a/test/e2e/rm_test.go +++ b/test/e2e/rm_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/rmi_test.go b/test/e2e/rmi_test.go index bc5d2d1fa2..b4ed4bad11 100644 --- a/test/e2e/rmi_test.go +++ b/test/e2e/rmi_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/run_aardvark_test.go b/test/e2e/run_aardvark_test.go index 4283639a98..6f99743eff 100644 --- a/test/e2e/run_aardvark_test.go +++ b/test/e2e/run_aardvark_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/run_apparmor_test.go b/test/e2e/run_apparmor_test.go index 152efec8f6..5f44473a9b 100644 --- a/test/e2e/run_apparmor_test.go +++ b/test/e2e/run_apparmor_test.go @@ -1,4 +1,4 @@ -//go:build !remote_testing +//go:build !remote_testing && (linux || freebsd) package integration diff --git a/test/e2e/run_cgroup_parent_test.go b/test/e2e/run_cgroup_parent_test.go index f590087ff0..8ebcf86126 100644 --- a/test/e2e/run_cgroup_parent_test.go +++ b/test/e2e/run_cgroup_parent_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/run_cleanup_test.go b/test/e2e/run_cleanup_test.go index b484f586be..4629ddee00 100644 --- a/test/e2e/run_cleanup_test.go +++ b/test/e2e/run_cleanup_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/run_cpu_test.go b/test/e2e/run_cpu_test.go index 13e5586baa..956e99f5aa 100644 --- a/test/e2e/run_cpu_test.go +++ b/test/e2e/run_cpu_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/run_device_test.go b/test/e2e/run_device_test.go index ef6fe8b486..230eaa6635 100644 --- a/test/e2e/run_device_test.go +++ b/test/e2e/run_device_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/run_dns_test.go b/test/e2e/run_dns_test.go index 126c17a741..21b347d677 100644 --- a/test/e2e/run_dns_test.go +++ b/test/e2e/run_dns_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/run_entrypoint_test.go b/test/e2e/run_entrypoint_test.go index 687847c1f3..6fe07cf9ef 100644 --- a/test/e2e/run_entrypoint_test.go +++ b/test/e2e/run_entrypoint_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/run_env_test.go b/test/e2e/run_env_test.go index bc459b7475..f7a2851fd0 100644 --- a/test/e2e/run_env_test.go +++ b/test/e2e/run_env_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/run_exit_test.go b/test/e2e/run_exit_test.go index b300567ce5..412bd6df11 100644 --- a/test/e2e/run_exit_test.go +++ b/test/e2e/run_exit_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/run_memory_test.go b/test/e2e/run_memory_test.go index e535e6bba7..77cc748c58 100644 --- a/test/e2e/run_memory_test.go +++ b/test/e2e/run_memory_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/run_ns_test.go b/test/e2e/run_ns_test.go index 80f463a941..3cae4592ab 100644 --- a/test/e2e/run_ns_test.go +++ b/test/e2e/run_ns_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/run_passwd_test.go b/test/e2e/run_passwd_test.go index 3ce00b0bdc..8381ca1bdb 100644 --- a/test/e2e/run_passwd_test.go +++ b/test/e2e/run_passwd_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/run_privileged_test.go b/test/e2e/run_privileged_test.go index 2a30138c09..f3d571ebe6 100644 --- a/test/e2e/run_privileged_test.go +++ b/test/e2e/run_privileged_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/run_restart_test.go b/test/e2e/run_restart_test.go index 1fcaf9b191..f4a62a3b95 100644 --- a/test/e2e/run_restart_test.go +++ b/test/e2e/run_restart_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/run_seccomp_test.go b/test/e2e/run_seccomp_test.go index c55a8033e2..82a7a42831 100644 --- a/test/e2e/run_seccomp_test.go +++ b/test/e2e/run_seccomp_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/run_security_labels_test.go b/test/e2e/run_security_labels_test.go index 380beb8e92..1d13460673 100644 --- a/test/e2e/run_security_labels_test.go +++ b/test/e2e/run_security_labels_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/run_selinux_test.go b/test/e2e/run_selinux_test.go index 50ac5b58ca..dad1eb4e4f 100644 --- a/test/e2e/run_selinux_test.go +++ b/test/e2e/run_selinux_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/run_signal_test.go b/test/e2e/run_signal_test.go index 8f81186aa8..2f1cb18ef1 100644 --- a/test/e2e/run_signal_test.go +++ b/test/e2e/run_signal_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/run_staticip_test.go b/test/e2e/run_staticip_test.go index 9fda9f4a4e..fd727dac08 100644 --- a/test/e2e/run_staticip_test.go +++ b/test/e2e/run_staticip_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go index f80ce2f403..1cb033f713 100644 --- a/test/e2e/run_test.go +++ b/test/e2e/run_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/run_transient_test.go b/test/e2e/run_transient_test.go index 990024cf14..46a9643e49 100644 --- a/test/e2e/run_transient_test.go +++ b/test/e2e/run_transient_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/run_userns_test.go b/test/e2e/run_userns_test.go index a5940524b9..29e5323498 100644 --- a/test/e2e/run_userns_test.go +++ b/test/e2e/run_userns_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/run_volume_test.go b/test/e2e/run_volume_test.go index f8dc22b1ed..4a4a7078e1 100644 --- a/test/e2e/run_volume_test.go +++ b/test/e2e/run_volume_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/run_working_dir_test.go b/test/e2e/run_working_dir_test.go index bc5deaff64..b002af7885 100644 --- a/test/e2e/run_working_dir_test.go +++ b/test/e2e/run_working_dir_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/runlabel_test.go b/test/e2e/runlabel_test.go index db1a6d0929..c2eac029e8 100644 --- a/test/e2e/runlabel_test.go +++ b/test/e2e/runlabel_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/save_test.go b/test/e2e/save_test.go index 7e7cdcb406..b4dbecc54c 100644 --- a/test/e2e/save_test.go +++ b/test/e2e/save_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/search_test.go b/test/e2e/search_test.go index 16bbe87a52..4d9f296d0a 100644 --- a/test/e2e/search_test.go +++ b/test/e2e/search_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/secret_test.go b/test/e2e/secret_test.go index 71d5fc34bf..bf373eeebe 100644 --- a/test/e2e/secret_test.go +++ b/test/e2e/secret_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/start_test.go b/test/e2e/start_test.go index 773de2ffb5..0be4403580 100644 --- a/test/e2e/start_test.go +++ b/test/e2e/start_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/stats_test.go b/test/e2e/stats_test.go index 3f0d4a8f16..4a4fc460c0 100644 --- a/test/e2e/stats_test.go +++ b/test/e2e/stats_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/stop_test.go b/test/e2e/stop_test.go index 74b2b63d2c..5cd14d119b 100644 --- a/test/e2e/stop_test.go +++ b/test/e2e/stop_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/system_connection_test.go b/test/e2e/system_connection_test.go index 5757c83d36..adf8d1f131 100644 --- a/test/e2e/system_connection_test.go +++ b/test/e2e/system_connection_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/system_df_test.go b/test/e2e/system_df_test.go index 45945f605b..dd1d715fd2 100644 --- a/test/e2e/system_df_test.go +++ b/test/e2e/system_df_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/system_dial_stdio_test.go b/test/e2e/system_dial_stdio_test.go index 35dfd5efee..7c278f2d96 100644 --- a/test/e2e/system_dial_stdio_test.go +++ b/test/e2e/system_dial_stdio_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/system_reset_test.go b/test/e2e/system_reset_test.go index 0e641e99e2..679c4ccb3e 100644 --- a/test/e2e/system_reset_test.go +++ b/test/e2e/system_reset_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/systemd_activate_test.go b/test/e2e/systemd_activate_test.go index 51344964c3..72f539a3ed 100644 --- a/test/e2e/systemd_activate_test.go +++ b/test/e2e/systemd_activate_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/systemd_test.go b/test/e2e/systemd_test.go index 2b835b3059..99e454799c 100644 --- a/test/e2e/systemd_test.go +++ b/test/e2e/systemd_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/tag_test.go b/test/e2e/tag_test.go index 47b931e9bb..81c692b0f1 100644 --- a/test/e2e/tag_test.go +++ b/test/e2e/tag_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/toolbox_test.go b/test/e2e/toolbox_test.go index 73b1b54ab8..b24650b56c 100644 --- a/test/e2e/toolbox_test.go +++ b/test/e2e/toolbox_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration /* diff --git a/test/e2e/top_test.go b/test/e2e/top_test.go index 262b62111a..2fbac24a97 100644 --- a/test/e2e/top_test.go +++ b/test/e2e/top_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/tree_test.go b/test/e2e/tree_test.go index 86d07f978f..03aa72e06d 100644 --- a/test/e2e/tree_test.go +++ b/test/e2e/tree_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/trust_test.go b/test/e2e/trust_test.go index db4bf25464..7f565044f9 100644 --- a/test/e2e/trust_test.go +++ b/test/e2e/trust_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/unshare_test.go b/test/e2e/unshare_test.go index 9fc5c6d79a..1d5e6cf23c 100644 --- a/test/e2e/unshare_test.go +++ b/test/e2e/unshare_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/untag_test.go b/test/e2e/untag_test.go index 0e7ba94aae..5aa8cf91ec 100644 --- a/test/e2e/untag_test.go +++ b/test/e2e/untag_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/update_test.go b/test/e2e/update_test.go index 27c091da17..04a8532209 100644 --- a/test/e2e/update_test.go +++ b/test/e2e/update_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/version_test.go b/test/e2e/version_test.go index ea17b01b95..d14a672825 100644 --- a/test/e2e/version_test.go +++ b/test/e2e/version_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/volume_create_test.go b/test/e2e/volume_create_test.go index 71b042a9d5..7ea3e893bd 100644 --- a/test/e2e/volume_create_test.go +++ b/test/e2e/volume_create_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/volume_exists_test.go b/test/e2e/volume_exists_test.go index d0709048db..1a19f51699 100644 --- a/test/e2e/volume_exists_test.go +++ b/test/e2e/volume_exists_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/volume_inspect_test.go b/test/e2e/volume_inspect_test.go index f5866ccbc6..c78f2429c9 100644 --- a/test/e2e/volume_inspect_test.go +++ b/test/e2e/volume_inspect_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/volume_ls_test.go b/test/e2e/volume_ls_test.go index ecd31550b0..d9454c015d 100644 --- a/test/e2e/volume_ls_test.go +++ b/test/e2e/volume_ls_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/volume_plugin_test.go b/test/e2e/volume_plugin_test.go index 939e3a5e3c..6ca55b5546 100644 --- a/test/e2e/volume_plugin_test.go +++ b/test/e2e/volume_plugin_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/volume_prune_test.go b/test/e2e/volume_prune_test.go index aeeffe933a..d8add183f7 100644 --- a/test/e2e/volume_prune_test.go +++ b/test/e2e/volume_prune_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/volume_rm_test.go b/test/e2e/volume_rm_test.go index 59f611f131..8009a748bb 100644 --- a/test/e2e/volume_rm_test.go +++ b/test/e2e/volume_rm_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( diff --git a/test/e2e/wait_test.go b/test/e2e/wait_test.go index 205c4d33dd..a2f3a13175 100644 --- a/test/e2e/wait_test.go +++ b/test/e2e/wait_test.go @@ -1,3 +1,5 @@ +//go:build linux || freebsd + package integration import ( From 84a85319e1f0683bc532397062122d09c57227df Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Thu, 15 Aug 2024 15:22:53 +0200 Subject: [PATCH 6/6] golangci-lint: make darwin linting happy Fix one minor issue with vfkit error handling. First checking if err != nil OR errors.Is() is pointless as the err != is already true. Second nilerr complains because we return nil when we hit an error branch, in this case this is correct because an error means VM is stopped. Signed-off-by: Paul Holzinger --- pkg/machine/apple/vfkit/helper.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/machine/apple/vfkit/helper.go b/pkg/machine/apple/vfkit/helper.go index f971129b16..47a3c98bf6 100644 --- a/pkg/machine/apple/vfkit/helper.go +++ b/pkg/machine/apple/vfkit/helper.go @@ -102,7 +102,8 @@ func (vf *Helper) Stop(force, wait bool) error { // Wait up to 90s then hard force off for i := 0; i < 180; i++ { _, err := vf.getRawState() - if err != nil || errors.Is(err, unix.ECONNREFUSED) { + if err != nil { + //nolint:nilerr // error means vfkit is gone so machine is stopped return nil } time.Sleep(waitDuration)