From 5473ba95d729b9583c2c5a159a8be61a3a242949 Mon Sep 17 00:00:00 2001 From: Qi Wang Date: Tue, 2 Jun 2020 18:01:57 -0400 Subject: Turn on remote rm_test --cidfile Turn on remote rm_test --cidfile Signed-off-by: Qi Wang --- pkg/domain/infra/tunnel/containers.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'pkg/domain') diff --git a/pkg/domain/infra/tunnel/containers.go b/pkg/domain/infra/tunnel/containers.go index af9d94293..97b98eec2 100644 --- a/pkg/domain/infra/tunnel/containers.go +++ b/pkg/domain/infra/tunnel/containers.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "io" + "io/ioutil" "os" "strconv" "strings" @@ -162,6 +163,14 @@ func (ic *ContainerEngine) ContainerRm(ctx context.Context, namesOrIds []string, var ( reports []*entities.RmReport ) + for _, cidFile := range options.CIDFiles { + content, err := ioutil.ReadFile(cidFile) + if err != nil { + return nil, errors.Wrapf(err, "error reading CIDFile %s", cidFile) + } + id := strings.Split(string(content), "\n")[0] + namesOrIds = append(namesOrIds, id) + } ctrs, err := getContainersByContext(ic.ClientCxt, options.All, namesOrIds) if err != nil { return nil, err -- cgit v1.2.3-54-g00ecf