Fix agent retrieval from Buildkite
@@ -83,7 +83,7 @@ func (client *BuildkiteClient) GetAgents(org string) ([]buildkite.Agent, error)
func (client *BuildkiteClient) getResults(listFunc func(opt buildkite.ListOptions) ([]interface{}, *buildkite.Response, error), lastN int) ([]interface{}, error) {
all_results := make([]interface{}, 0)
perPage := 100
- if lastN < perPage {
+ if 0 < lastN && lastN < perPage {
perPage = lastN
}
opt := buildkite.ListOptions{Page: 1, PerPage: perPage}
