Addressed final comments

This commit is contained in:
CarltonSemple
2016-11-15 22:18:55 +00:00
parent 9833a854b1
commit a5859ba218
2 changed files with 4 additions and 4 deletions

View File

@@ -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")
}
}
}

View File

@@ -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