Skip to content

Commit

Permalink
Merge branch 'master' into config
Browse files Browse the repository at this point in the history
  • Loading branch information
hellt committed Jun 30, 2021
2 parents 1cb6b9b + a7a8033 commit c3b34ff
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
5 changes: 4 additions & 1 deletion nodes/mysocketio/mysocketio.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 8 additions & 5 deletions runtime/containerd/containerd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 2 additions & 4 deletions tests/01-smoke/03-bridges-and-host.robot
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit c3b34ff

Please sign in to comment.