Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

Commit

Permalink
Merge pull request #348 from ZhuPeng/scale-demo
Browse files Browse the repository at this point in the history
Add label selector
  • Loading branch information
brendandburns committed Jan 7, 2016
2 parents ccecc17 + 843a388 commit 4d713e6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion scale-demo/aggregator/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,17 @@ func loadData() {
fmt.Printf("Error creating client: %v", err)
return
}
pods, err := c.Pods("default").List(labels.Everything(), fields.Everything())
var labelSelector labels.Selector
if *selector != "" {
labelSelector, err = labels.Parse(*selector)
if err != nil {
fmt.Printf("Parse label selector err: %v", err)
return
}
} else {
labelSelector = labels.Everything()
}
pods, err := c.Pods("default").List(labelSelector, fields.Everything())
if err != nil {
fmt.Printf("Error getting pods: %v", err)
return
Expand Down

0 comments on commit 4d713e6

Please sign in to comment.