mirror of
https://github.com/weaveworks/scope.git
synced 2026-05-05 00:39:04 +00:00
Daemon labels will have to wait since the go client (Docker API v1.14) doesn't support them yet (daemon labels were exposed in Docker API v1.16) See https://godoc.org/github.com/fsouza/go-dockerclient#Client.Info for details.
26 lines
448 B
Go
26 lines
448 B
Go
package docker_test
|
|
|
|
import (
|
|
"reflect"
|
|
"testing"
|
|
|
|
"github.com/weaveworks/scope/probe/docker"
|
|
"github.com/weaveworks/scope/report"
|
|
"github.com/weaveworks/scope/test"
|
|
)
|
|
|
|
func TestLabels(t *testing.T) {
|
|
want := map[string]string{
|
|
"foo1": "bar1",
|
|
"foo2": "bar2",
|
|
}
|
|
nmd := report.MakeNodeMetadata()
|
|
|
|
docker.AddLabels(nmd, want)
|
|
have := docker.ExtractLabels(nmd)
|
|
|
|
if !reflect.DeepEqual(want, have) {
|
|
t.Error(test.Diff(want, have))
|
|
}
|
|
}
|