Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit 12f1b3c

Browse files
authored
Merge pull request moby#42616 from thaJeztah/migrate_pkg_signal
replace pkg/signal with moby/sys/signal v0.5.0
2 parents 9674540 + 28409ca commit 12f1b3c

22 files changed

+78
-143
lines changed

api/server/router/container/container_routes.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
containerpkg "github.com/docker/docker/container"
2020
"github.com/docker/docker/errdefs"
2121
"github.com/docker/docker/pkg/ioutils"
22-
"github.com/docker/docker/pkg/signal"
22+
"github.com/moby/sys/signal"
2323
specs "github.com/opencontainers/image-spec/specs-go/v1"
2424
"github.com/pkg/errors"
2525
"github.com/sirupsen/logrus"

builder/dockerfile/dispatchers.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ import (
2121
"github.com/docker/docker/errdefs"
2222
"github.com/docker/docker/image"
2323
"github.com/docker/docker/pkg/jsonmessage"
24-
"github.com/docker/docker/pkg/signal"
2524
"github.com/docker/docker/pkg/system"
2625
"github.com/docker/go-connections/nat"
2726
"github.com/moby/buildkit/frontend/dockerfile/instructions"
2827
"github.com/moby/buildkit/frontend/dockerfile/parser"
2928
"github.com/moby/buildkit/frontend/dockerfile/shell"
29+
"github.com/moby/sys/signal"
3030
specs "github.com/opencontainers/image-spec/specs-go/v1"
3131
"github.com/pkg/errors"
3232
)

container/container.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ import (
3131
"github.com/docker/docker/pkg/containerfs"
3232
"github.com/docker/docker/pkg/idtools"
3333
"github.com/docker/docker/pkg/ioutils"
34-
"github.com/docker/docker/pkg/signal"
3534
"github.com/docker/docker/pkg/system"
3635
"github.com/docker/docker/restartmanager"
3736
"github.com/docker/docker/volume"
3837
volumemounts "github.com/docker/docker/volume/mounts"
3938
units "github.com/docker/go-units"
4039
agentexec "github.com/docker/swarmkit/agent/exec"
40+
"github.com/moby/sys/signal"
4141
"github.com/moby/sys/symlink"
4242
"github.com/pkg/errors"
4343
"github.com/sirupsen/logrus"

container/container_unit_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/docker/docker/api/types/container"
1111
swarmtypes "github.com/docker/docker/api/types/swarm"
1212
"github.com/docker/docker/daemon/logger/jsonfilelog"
13-
"github.com/docker/docker/pkg/signal"
13+
"github.com/moby/sys/signal"
1414
"gotest.tools/v3/assert"
1515
)
1616

daemon/container.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ import (
1515
"github.com/docker/docker/image"
1616
"github.com/docker/docker/oci/caps"
1717
"github.com/docker/docker/opts"
18-
"github.com/docker/docker/pkg/signal"
1918
"github.com/docker/docker/pkg/system"
2019
"github.com/docker/docker/pkg/truncindex"
2120
"github.com/docker/docker/runconfig"
2221
volumemounts "github.com/docker/docker/volume/mounts"
2322
"github.com/docker/go-connections/nat"
23+
"github.com/moby/sys/signal"
2424
"github.com/opencontainers/selinux/go-selinux"
2525
"github.com/pkg/errors"
2626
"github.com/sirupsen/logrus"

daemon/exec.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
"github.com/docker/docker/daemon/exec"
1616
"github.com/docker/docker/errdefs"
1717
"github.com/docker/docker/pkg/pools"
18-
"github.com/docker/docker/pkg/signal"
18+
"github.com/moby/sys/signal"
1919
"github.com/moby/term"
2020
specs "github.com/opencontainers/runtime-spec/specs-go"
2121
"github.com/pkg/errors"

daemon/kill.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
containerpkg "github.com/docker/docker/container"
1111
"github.com/docker/docker/errdefs"
1212
libcontainerdtypes "github.com/docker/docker/libcontainerd/types"
13-
"github.com/docker/docker/pkg/signal"
13+
"github.com/moby/sys/signal"
1414
"github.com/pkg/errors"
1515
"github.com/sirupsen/logrus"
1616
)

pkg/signal/README.md

-1
This file was deleted.

pkg/signal/signal_deprecated.go

+52-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,54 @@
1-
package signal
1+
// Package signal provides helper functions for dealing with signals across
2+
// various operating systems.
3+
package signal // import "github.com/docker/docker/pkg/signal"
24

3-
import "github.com/docker/docker/pkg/stack"
5+
import (
6+
"github.com/docker/docker/pkg/stack"
7+
msignal "github.com/moby/sys/signal"
8+
)
49

5-
// DumpStacks appends the runtime stack into file in dir and returns full path
6-
// to that file.
7-
// Deprecated: use github.com/docker/docker/pkg/stack.Dump instead.
8-
var DumpStacks = stack.DumpToFile
10+
var (
11+
// DumpStacks appends the runtime stack into file in dir and returns full path
12+
// to that file.
13+
// Deprecated: use github.com/docker/docker/pkg/stack.Dump instead.
14+
DumpStacks = stack.DumpToFile
15+
16+
// CatchAll catches all signals and relays them to the specified channel.
17+
// SIGURG is not handled, as it's used by the Go runtime to support
18+
// preemptable system calls.
19+
// Deprecated: use github.com/moby/sys/signal.CatchAll instead
20+
CatchAll = msignal.CatchAll
21+
22+
// StopCatch stops catching the signals and closes the specified channel.
23+
// Deprecated: use github.com/moby/sys/signal.StopCatch instead
24+
StopCatch = msignal.StopCatch
25+
26+
// ParseSignal translates a string to a valid syscall signal.
27+
// It returns an error if the signal map doesn't include the given signal.
28+
// Deprecated: use github.com/moby/sys/signal.ParseSignal instead
29+
ParseSignal = msignal.ParseSignal
30+
31+
// ValidSignalForPlatform returns true if a signal is valid on the platform
32+
// Deprecated: use github.com/moby/sys/signal.ValidSignalForPlatform instead
33+
ValidSignalForPlatform = msignal.ValidSignalForPlatform
34+
35+
// SignalMap is a map of signals for the current platform.
36+
// Deprecated: use github.com/moby/sys/signal.SignalMap instead
37+
SignalMap = msignal.SignalMap
38+
)
39+
40+
// Signals used in cli/command
41+
const (
42+
// SIGCHLD is a signal sent to a process when a child process terminates, is interrupted, or resumes after being interrupted.
43+
// Deprecated: use github.com/moby/sys/signal.SIGCHLD instead
44+
SIGCHLD = msignal.SIGCHLD
45+
// SIGWINCH is a signal sent to a process when its controlling terminal changes its size
46+
// Deprecated: use github.com/moby/sys/signal.SIGWINCH instead
47+
SIGWINCH = msignal.SIGWINCH
48+
// SIGPIPE is a signal sent to a process when a pipe is written to before the other end is open for reading
49+
// Deprecated: use github.com/moby/sys/signal.SIGPIPE instead
50+
SIGPIPE = msignal.SIGPIPE
51+
// DefaultStopSignal is the syscall signal used to stop a container in unix systems.
52+
// Deprecated: use github.com/moby/sys/signal.DefaultStopSignal instead
53+
DefaultStopSignal = msignal.DefaultStopSignal
54+
)

pkg/signal/signal_linux_test.go

-70
This file was deleted.

pkg/signal/signal_test.go

-45
This file was deleted.

vendor.conf

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ github.com/moby/locker 281af2d563954745bea9d1487c96
99
github.com/moby/term 3f7ff695adc6a35abc925370dd0a4dafb48ec64d
1010

1111
# Note that this dependency uses submodules, providing the github.com/moby/sys/mount,
12-
# github.com/moby/sys/mountinfo, and github.com/moby/sys/symlink modules. Our vendoring
13-
# tool (vndr) currently does not support submodules / vendoring sub-paths, so we vendor
14-
# the top-level moby/sys repository (which contains both) and pick the most recent tag,
15-
# which could be either `mountinfo/vX.Y.Z`, `mount/vX.Y.Z`, or `symlink/vX.Y.Z`.
16-
github.com/moby/sys b0f1fd7235275d01bd35cc4421e884e522395f45 # mountinfo/v0.4.1
12+
# github.com/moby/sys/mountinfo, github.com/moby/sys/signal, and github.com/moby/sys/symlink
13+
# modules. Our vendoring tool (vndr) currently does not support submodules / vendoring sub-paths,
14+
# so we vendor the top-level moby/sys repository (which contains both) and pick the most recent tag,
15+
# which could be either `mountinfo/vX.Y.Z`, `mount/vX.Y.Z`, `signal/vX.Y.Z`, or `symlink/vX.Y.Z`.
16+
github.com/moby/sys 9b0136d132d8e0d1c116a38d7ec9af70d3a59536 # signal/v0.5.0
1717

1818
github.com/creack/pty 2a38352e8b4d7ab6c336eef107e42a55e72e7fbc # v1.1.11
1919
github.com/sirupsen/logrus bdc0db8ead3853c56b7cd1ac2ba4e11b47d7da6b # v1.8.1

vendor/github.com/moby/sys/mount/go.mod

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/moby/sys/signal/go.mod

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/signal/signal.go renamed to vendor/github.com/moby/sys/signal/signal.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/signal/signal_darwin.go renamed to vendor/github.com/moby/sys/signal/signal_darwin.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/signal/signal_freebsd.go renamed to vendor/github.com/moby/sys/signal/signal_freebsd.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/signal/signal_linux.go renamed to vendor/github.com/moby/sys/signal/signal_linux.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/signal/signal_linux_mipsx.go renamed to vendor/github.com/moby/sys/signal/signal_linux_mipsx.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/signal/signal_unix.go renamed to vendor/github.com/moby/sys/signal/signal_unix.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/signal/signal_unsupported.go renamed to vendor/github.com/moby/sys/signal/signal_unsupported.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/signal/signal_windows.go renamed to vendor/github.com/moby/sys/signal/signal_windows.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)