Crazy sekai overturns the small pond

This commit is contained in:
世界
2024-10-21 23:38:34 +08:00
parent 253b41936e
commit 59342bd152
139 changed files with 2866 additions and 1555 deletions

View File

@@ -11,7 +11,6 @@ import (
F "github.com/sagernet/sing/common/format"
"github.com/sagernet/sing/common/rw"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/client"
"github.com/docker/docker/pkg/stdcopy"
@@ -85,10 +84,10 @@ func startDockerContainer(t *testing.T, options DockerOptions) {
cleanContainer(dockerContainer.ID)
})
require.NoError(t, dockerClient.ContainerStart(context.Background(), dockerContainer.ID, types.ContainerStartOptions{}))
require.NoError(t, dockerClient.ContainerStart(context.Background(), dockerContainer.ID, container.StartOptions{}))
if writeStdin {
stdinAttach, err := dockerClient.ContainerAttach(context.Background(), dockerContainer.ID, types.ContainerAttachOptions{
stdinAttach, err := dockerClient.ContainerAttach(context.Background(), dockerContainer.ID, container.AttachOptions{
Stdin: writeStdin,
Stream: true,
})
@@ -98,7 +97,7 @@ func startDockerContainer(t *testing.T, options DockerOptions) {
stdinAttach.Close()
}
if debug.Enabled {
attach, err := dockerClient.ContainerAttach(context.Background(), dockerContainer.ID, types.ContainerAttachOptions{
attach, err := dockerClient.ContainerAttach(context.Background(), dockerContainer.ID, container.AttachOptions{
Stdout: true,
Stderr: true,
Logs: true,
@@ -118,5 +117,5 @@ func cleanContainer(id string) error {
return err
}
defer dockerClient.Close()
return dockerClient.ContainerRemove(context.Background(), id, types.ContainerRemoveOptions{Force: true})
return dockerClient.ContainerRemove(context.Background(), id, container.RemoveOptions{Force: true})
}