Fix incorrect reference to name in v1beta3 API.

This commit is contained in:
Daniel Smith
2015-04-03 14:10:47 -07:00
parent 0c2d3ffe68
commit 34b399ca02
11 changed files with 51 additions and 46 deletions

View File

@@ -53,7 +53,7 @@ func (s *SelectionPredicate) Matches(obj runtime.Object) (bool, error) {
// name.
func (s *SelectionPredicate) MatchesSingle() (string, bool) {
// TODO: should be namespace.name
if name, ok := s.Field.RequiresExactMatch("name"); ok {
if name, ok := s.Field.RequiresExactMatch("metadata.name"); ok {
return name, true
}
return "", false

View File

@@ -68,9 +68,9 @@ func TestSelectionPredicate(t *testing.T) {
shouldMatch: false,
},
"D": {
fieldSelector: "name=12345",
fieldSelector: "metadata.name=12345",
labels: labels.Set{},
fields: fields.Set{"name": "12345"},
fields: fields.Set{"metadata.name": "12345"},
shouldMatch: true,
matchSingleKey: "12345",
},