diff --git a/nodes/mysocketio/mysocketio.go b/nodes/mysocketio/mysocketio.go index ef6e0c0cb..31a2df560 100644 --- a/nodes/mysocketio/mysocketio.go +++ b/nodes/mysocketio/mysocketio.go @@ -33,7 +33,10 @@ func (s *mySocketIO) PreDeploy(configName, labCADir, labCARoot string) error { // utils.CreateDirectory(s.cfg.LabDir, 0777) return nil } -func (s *mySocketIO) Deploy(ctx context.Context, r runtime.ContainerRuntime) error { return nil } + +func (s *mySocketIO) Deploy(ctx context.Context, r runtime.ContainerRuntime) error { + return r.CreateContainer(ctx, s.cfg) +} func (s *mySocketIO) PostDeploy(ctx context.Context, r runtime.ContainerRuntime, ns map[string]nodes.Node) error { log.Debugf("Running postdeploy actions for mysocketio '%s' node", s.cfg.ShortName) diff --git a/runtime/containerd/containerd.go b/runtime/containerd/containerd.go index 34e0504d1..aa88d3c4c 100644 --- a/runtime/containerd/containerd.go +++ b/runtime/containerd/containerd.go @@ -490,8 +490,8 @@ func (c *ContainerdRuntime) ListContainers(ctx context.Context, filter []*types. func (c *ContainerdRuntime) buildFilterString(filter []*types.GenericFilter) string { filterstring := "" - delim := "" - for _, filterEntry := range filter { + delim := "," + for counter, filterEntry := range filter { isExistsOperator := false operator := filterEntry.Operator @@ -503,14 +503,17 @@ func (c *ContainerdRuntime) buildFilterString(filter []*types.GenericFilter) str isExistsOperator = true } + if counter+1 == len(filter) { + delim = "" + } + if filterEntry.FilterType == "label" { - filterstring = filterstring + "labels." + filterEntry.Field + filterstring = filterstring + "labels.\"" + filterEntry.Field + "\"" if !isExistsOperator { - filterstring = filterstring + operator + filterEntry.Match + delim + filterstring = filterstring + operator + "\"" + filterEntry.Match + "\"" + delim } } // more might be implemented later - delim = "," } log.Debug("Filterstring: " + filterstring) return filterstring diff --git a/tests/01-smoke/03-bridges-and-host.robot b/tests/01-smoke/03-bridges-and-host.robot index c79e2a4d4..a08df3dbd 100644 --- a/tests/01-smoke/03-bridges-and-host.robot +++ b/tests/01-smoke/03-bridges-and-host.robot @@ -50,16 +50,14 @@ Verify links in host ns Should Contain ${output} state UP Verify management network is using user-specified bridge - # containerd has an issue with filtering at this moment, so skip it - Skip If '${runtime}' != 'docker' # show management interface info and cut the information about the ifindex of the remote veth # note that exec returns the info in the stderr stream, thus we use stderr to parse the ifindex ${rc} ${iface} = OperatingSystem.Run And Return Rc And Output - ... sudo containerlab --runtime ${runtime} exec -t ${CURDIR}/${lab-file} --label clab-node-name\=l1 --cmd "ip l show eth0" 2>&1 | cut -d ' ' -f5 | cut -d '@' -f2 | cut -c3- + ... sudo containerlab --runtime ${runtime} exec -t ${CURDIR}/${lab-file} --label clab-node-name\=l1 --cmd "ip l show eth0" 2>&1 | perl -lne '/.*[0-9]+: .*\\@if(.*:) .*/ && print $1' Log ${iface} Should Be Equal As Integers ${rc} 0 ${rc} ${res} = OperatingSystem.Run And Return Rc And Output - ... sudo ip l | grep ${iface} + ... sudo ip l | grep "${iface}" Log ${res} Should Contain ${res} master ${mgmt-br-name} state UP