diff --git a/libpod/container_internal_test.go b/libpod/container_internal_test.go index 0f9e213ecc..adbb8c031f 100644 --- a/libpod/container_internal_test.go +++ b/libpod/container_internal_test.go @@ -1,4 +1,4 @@ -//go:build !remote +//go:build !remote && (linux || freebsd) package libpod @@ -7,7 +7,6 @@ import ( "fmt" "os" "path/filepath" - "runtime" "strings" "testing" @@ -18,7 +17,8 @@ import ( ) // hookPath is the path to an example hook executable. -var hookPath string +// This would need to be updated for Windows. +const hookPath = "/bin/sh" func TestParseOptionIDs(t *testing.T) { idMap := []idtools.IDMap{ @@ -205,11 +205,3 @@ func TestPostDeleteHooks(t *testing.T) { } assert.Equal(t, strings.TrimSuffix(string(content), "\n"), dir) } - -func init() { - if runtime.GOOS != "windows" { - hookPath = "/bin/sh" - } else { - panic("we need a reliable executable path on Windows") - } -} diff --git a/libpod/container_log_unsupported.go b/libpod/container_log_unsupported.go index 6b1a18dd9b..7d7a7dad42 100644 --- a/libpod/container_log_unsupported.go +++ b/libpod/container_log_unsupported.go @@ -1,4 +1,4 @@ -//go:build !remote && (!linux || !systemd) +//go:build !remote && ((linux && !systemd) || freebsd) package libpod diff --git a/libpod/container_top_unsupported.go b/libpod/container_top_unsupported.go index 1c47b69d52..d2471116a1 100644 --- a/libpod/container_top_unsupported.go +++ b/libpod/container_top_unsupported.go @@ -1,4 +1,4 @@ -//go:build !remote && !(linux && cgo) && !freebsd +//go:build !remote && linux && !cgo package libpod diff --git a/libpod/healthcheck_unsupported.go b/libpod/healthcheck_unsupported.go index 8cb7959c40..b9bcb766b7 100644 --- a/libpod/healthcheck_unsupported.go +++ b/libpod/healthcheck_unsupported.go @@ -1,4 +1,4 @@ -//go:build !remote && !linux +//go:build !remote && freebsd package libpod diff --git a/libpod/runtime_migrate_unsupported.go b/libpod/runtime_migrate_unsupported.go deleted file mode 100644 index 6355ab4ecb..0000000000 --- a/libpod/runtime_migrate_unsupported.go +++ /dev/null @@ -1,11 +0,0 @@ -//go:build !remote && !linux && !freebsd - -package libpod - -import ( - "errors" -) - -func (r *Runtime) stopPauseProcess() error { - return errors.New("not implemented (*Runtime) stopPauseProcess") -} diff --git a/pkg/domain/infra/abi/terminal/terminal_unsupported.go b/pkg/domain/infra/abi/terminal/terminal_unsupported.go deleted file mode 100644 index 08a3bcf4d9..0000000000 --- a/pkg/domain/infra/abi/terminal/terminal_unsupported.go +++ /dev/null @@ -1,24 +0,0 @@ -//go:build !linux && !freebsd && !remote - -package terminal - -import ( - "context" - "errors" - "os" - - "github.com/containers/podman/v6/libpod" - "github.com/containers/podman/v6/libpod/define" -) - -// ExecAttachCtr execs and attaches to a container -func ExecAttachCtr(ctx context.Context, ctr *libpod.Container, execConfig *libpod.ExecConfig, streams *define.AttachStreams) (int, error) { - return -1, errors.New("not implemented ExecAttachCtr") -} - -// StartAttachCtr starts and (if required) attaches to a container -// if you change the signature of this function from os.File to io.Writer, it will trigger a downstream -// error. we may need to just lint disable this one. -func StartAttachCtr(ctx context.Context, ctr *libpod.Container, stdout, stderr, stdin *os.File, detachKeys string, sigProxy bool, startContainer bool) error { //nolint: interfacer - return errors.New("not implemented StartAttachCtr") -}