@@ -23,7 +23,6 @@ import (
23
23
"strconv"
24
24
"strings"
25
25
26
- "github.com/chaosblade-io/chaosblade-exec-cri/exec/container"
27
26
"github.com/chaosblade-io/chaosblade-spec-go/util"
28
27
"github.com/sirupsen/logrus"
29
28
v1 "k8s.io/api/core/v1"
@@ -145,9 +144,6 @@ func getMatchedContainerMetaList(pods []v1.Pod, containerIdsValue, containerName
145
144
containerStatusErr = errors .New ("containerId is empty" )
146
145
} else {
147
146
containerRuntime , containerId = model .TruncateContainerObjectMetaUid (containerStatus .ContainerID )
148
- if containerRuntime == container .DockerRuntime {
149
- // containerId = containerId[:12]
150
- }
151
147
}
152
148
if containerStatus .State .Running == nil {
153
149
if containerStatusErr != nil {
@@ -161,7 +157,7 @@ func getMatchedContainerMetaList(pods []v1.Pod, containerIdsValue, containerName
161
157
if expectedContainerId == "" {
162
158
continue
163
159
}
164
- if strings .HasPrefix (containerId /*k8s中获取的*/ , expectedContainerId /*用户输入的,可能为全限定*/ ) {
160
+ if strings .HasPrefix (containerId , expectedContainerId ) {
165
161
if containerStatusErr != nil {
166
162
return containerObjectMetaList , spec .ResponseFailWithFlags (spec .ParameterInvalid ,
167
163
model .ContainerIdsFlag .Name , expectedContainerId ,
@@ -229,9 +225,6 @@ func getMatchedContainerMetaList(pods []v1.Pod, containerIdsValue, containerName
229
225
fmt .Sprintf ("container: %s %s" , containerStatuses [idx ].Name , containerStatusErr .Error ()))
230
226
}
231
227
containerRuntime , containerId := model .TruncateContainerObjectMetaUid (containerStatuses [idx ].ContainerID )
232
- if containerRuntime == container .DockerRuntime {
233
- // containerId = containerId[:12]
234
- }
235
228
containerObjectMetaList = append (containerObjectMetaList , model.ContainerObjectMeta {
236
229
ContainerRuntime : containerRuntime ,
237
230
ContainerId : containerId ,
0 commit comments