Skip to content

Commit

Permalink
fix rancher api environment get
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuel Laufenberg authored and traefiker committed Sep 6, 2017
1 parent 03ba839 commit 2c4bf9b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions provider/rancher/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,14 @@ func (p *Provider) apiProvide(configurationChan chan<- types.ConfigMessage, pool
return nil
}

func listRancherEnvironments(client *rancher.RancherClient) []*rancher.Project {
func listRancherEnvironments(client *rancher.RancherClient) []*rancher.Environment {

// Rancher Environment in frontend UI is actually project in API
// Rancher Environment in frontend UI is actually a stack
// https://forums.rancher.com/t/api-key-for-all-environments/279/9

var environmentList = []*rancher.Project{}
var environmentList = []*rancher.Environment{}

environments, err := client.Project.List(nil)
environments, err := client.Environment.List(nil)

if err != nil {
log.Errorf("Cannot get Rancher Environments %+v", err)
Expand Down Expand Up @@ -193,12 +193,13 @@ func listRancherContainer(client *rancher.RancherClient) []*rancher.Container {
return containerList
}

func parseAPISourcedRancherData(environments []*rancher.Project, services []*rancher.Service, containers []*rancher.Container) []rancherData {
func parseAPISourcedRancherData(environments []*rancher.Environment, services []*rancher.Service, containers []*rancher.Container) []rancherData {
var rancherDataList []rancherData

for _, environment := range environments {

for _, service := range services {

if service.EnvironmentId != environment.Id {
continue
}
Expand Down

0 comments on commit 2c4bf9b

Please sign in to comment.