feat: 新增 proc nohup 后台运行、docker save/load 内置实现,移除 Podman 支持
- proc.nohup:后台运行命令并将 stdout/stderr 追加写入日志, Unix 下新会话、Windows 下 DETACHED_PROCESS 脱离终端 - docker.save:等价 docker save <镜像> -o <镜像名>.tar,文件名按 仓库名+标签生成(alpine:3.20 → alpine_3.20.tar),传镜像 ID 时 先解析出对应名称;docker.load 改为归档文件作位置参数 - 移除 Podman 支持,所有容器命令只走 docker
This commit is contained in:
@@ -39,26 +39,18 @@ func TestResolveBuiltin(t *testing.T) {
|
||||
wantIdx int
|
||||
}{
|
||||
{
|
||||
name: "centos with podman and docker prefers podman",
|
||||
id: "docker.clearsafe",
|
||||
info: env("linux", "amd64", "centos", []string{"rhel", "fedora"}, "docker", "podman"),
|
||||
wantArgv: []string{"podman", "system", "prune", "-f"},
|
||||
wantScore: 2,
|
||||
wantIdx: 0,
|
||||
},
|
||||
{
|
||||
name: "centos with docker only",
|
||||
name: "centos with docker",
|
||||
id: "docker.clearsafe",
|
||||
info: env("linux", "amd64", "centos", []string{"rhel", "fedora"}, "docker"),
|
||||
wantArgv: []string{"docker", "system", "prune", "-f"},
|
||||
wantScore: 2,
|
||||
wantIdx: 1,
|
||||
wantIdx: 0,
|
||||
},
|
||||
{
|
||||
name: "generic linux with podman and docker prefers podman",
|
||||
name: "generic linux with docker",
|
||||
id: "docker.clearsafe",
|
||||
info: env("linux", "amd64", "ubuntu", []string{"debian"}, "docker", "podman"),
|
||||
wantArgv: []string{"podman", "system", "prune", "-f"},
|
||||
info: env("linux", "amd64", "ubuntu", []string{"debian"}, "docker"),
|
||||
wantArgv: []string{"docker", "system", "prune", "-f"},
|
||||
wantScore: 2,
|
||||
wantIdx: 0,
|
||||
},
|
||||
@@ -68,7 +60,7 @@ func TestResolveBuiltin(t *testing.T) {
|
||||
info: env("linux", "amd64", "rocky", []string{"rhel", "centos"}, "docker"),
|
||||
wantArgv: []string{"docker", "system", "prune", "-f"},
|
||||
wantScore: 2,
|
||||
wantIdx: 1,
|
||||
wantIdx: 0,
|
||||
},
|
||||
{
|
||||
name: "darwin docker",
|
||||
@@ -76,7 +68,7 @@ func TestResolveBuiltin(t *testing.T) {
|
||||
info: env("darwin", "arm64", "", nil, "docker"),
|
||||
wantArgv: []string{"docker", "system", "prune", "-f"},
|
||||
wantScore: 2,
|
||||
wantIdx: 2,
|
||||
wantIdx: 1,
|
||||
},
|
||||
{
|
||||
name: "windows docker",
|
||||
@@ -84,7 +76,7 @@ func TestResolveBuiltin(t *testing.T) {
|
||||
info: env("windows", "amd64", "", nil, "docker"),
|
||||
wantArgv: []string{"docker", "system", "prune", "-f"},
|
||||
wantScore: 2,
|
||||
wantIdx: 3,
|
||||
wantIdx: 2,
|
||||
},
|
||||
{
|
||||
name: "centos refreshes with dnf exactly",
|
||||
@@ -277,7 +269,7 @@ func TestEvaluateRejects(t *testing.T) {
|
||||
{"arch", registry.Match{Arch: "arm64"}, "arch=arm64"},
|
||||
{"distro", registry.Match{Distro: "debian"}, "distro=debian"},
|
||||
{"distro like", registry.Match{DistroLike: []string{"debian"}}, "ID_LIKE"},
|
||||
{"runtime", registry.Match{Runtime: "podman"}, "podman"},
|
||||
{"runtime", registry.Match{Runtime: "cri-o"}, "cri-o"},
|
||||
}
|
||||
|
||||
for _, tc := range cases {
|
||||
|
||||
Reference in New Issue
Block a user