mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 17:51:21 +00:00
Addressed final comments
This commit is contained in:
@@ -67,7 +67,7 @@ func TestContainerLabelFilter(t *testing.T) {
|
||||
// only the filtered container with fixture.TestLabelKey1 should be present
|
||||
equals(t, 1, len(topologySummaries))
|
||||
for key := range topologySummaries {
|
||||
equals(t, fixture.ClientContainerID+";<container>", key)
|
||||
equals(t, report.MakeContainerNodeID(fixture.ClientContainerID), key)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,8 +79,8 @@ func TestContainerLabelFilterExclude(t *testing.T) {
|
||||
|
||||
// all containers but the excluded container should be present
|
||||
for key := range topologySummaries {
|
||||
if fixture.ServerContainerNodeID+";<container>" == key {
|
||||
t.Errorf("TestAPITopologyNegativeContainerLabelFilter Failed. Expected to not find " + fixture.ServerContainerNodeID + ";<container> in report")
|
||||
if report.MakeContainerNodeID(fixture.ServerContainerNodeID) == key {
|
||||
t.Errorf("TestAPITopologyNegativeContainerLabelFilter Failed. Expected to not find " + report.MakeContainerNodeID(fixture.ServerContainerNodeID) + " in report")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ func (c *containerLabelFiltersFlag) toAPITopologyOption(flagValue string, filter
|
||||
containerFilterLabel := unescapeBackslashes.ReplaceAllString(labelStringEscaped, `$1`)
|
||||
labelKeyValuePair := strings.Split(containerFilterLabel, "=")
|
||||
if len(labelKeyValuePair) != 2 {
|
||||
return app.APITopologyOption{}, fmt.Errorf("Docker label in the app.container-label-filter(-exclude) flag isn't in the correct key=value format")
|
||||
return app.APITopologyOption{}, fmt.Errorf("Docker label isn't in the correct key=value format")
|
||||
}
|
||||
|
||||
filterFunction := render.HasLabel
|
||||
|
||||
Reference in New Issue
Block a user