PredicateMetadata factory and optimization, Cleaned up some comments,

Comments addressed, Make emptyMetadataProducer a func to avoid casting,
FakeSvcLister: remove error return for len(svc)=0.  New test for
predicatePrecomp to make method semantics explictly enforced when meta
is missing. Precompute wrapper.
This commit is contained in:
jayunit100
2016-10-12 12:03:01 -04:00
parent 66a0aa64c2
commit 08cff0157d
13 changed files with 250 additions and 107 deletions

View File

@@ -49,7 +49,11 @@ func ExampleFindLabelsInSet() {
},
},
{}, // a third pod which will have no effect on anything.
{
ObjectMeta: api.ObjectMeta{
Name: "pod3ThatWeWontSee",
},
},
}
fmt.Println(FindLabelsInSet([]string{"label1", "label2", "label3"}, nsPods[0].ObjectMeta.Labels)["label3"])
AddUnsetLabelsToMap(labelSubset, []string{"label1", "label2", "label3"}, nsPods[0].ObjectMeta.Labels)