Skip to content

Commit

Permalink
second round of @karimra's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
steiler committed Jun 16, 2021
1 parent 9158e9e commit 839b164
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions clab/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -661,8 +661,7 @@ func (c *CLab) VerifyContainersUniqueness(ctx context.Context) error {
nctx, cancel := context.WithTimeout(ctx, c.timeout)
defer cancel()

labels := []*types.GenericFilter{}
containers, err := c.Runtime.ListContainers(nctx, labels)
containers, err := c.Runtime.ListContainers(nctx, nil)
if err != nil {
return fmt.Errorf("could not list containers: %v", err)
}
Expand Down
4 changes: 1 addition & 3 deletions runtime/containerd/containerd.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ func (c *ContainerdRuntime) StartContainer(ctx context.Context, containername st
func (c *ContainerdRuntime) StopContainer(ctx context.Context, containername string, dur *time.Duration) error {
ctask, err := c.getContainerTask(ctx, containername)
if err != nil {
log.Debugf("no task found for container %s", containername)
log.Debugf("container %s: %v", containername, err)
return nil
}
taskstatus, err := ctask.Status(ctx)
Expand Down Expand Up @@ -481,10 +481,8 @@ func (c *ContainerdRuntime) getContainerTask(ctx context.Context, containername
func (c *ContainerdRuntime) ListContainers(ctx context.Context, filter []*types.GenericFilter) ([]types.GenericContainer, error) {
log.Debug("listing containers")
ctx = namespaces.WithNamespace(ctx, containerdNamespace)
// TODO add containerlab label as filter criteria

filterstring := c.buildFilterString(filter)

containerlist, err := c.client.Containers(ctx, filterstring)
if err != nil {
return nil, err
Expand Down

0 comments on commit 839b164

Please sign in to comment.