fix rancher api environment get
This commit is contained in:
parent
03ba8396f3
commit
cd6c58a372
1 changed files with 6 additions and 5 deletions
|
@ -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)
|
||||
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue