Add support for Azure and Edge Agent endpoint types

This commit is contained in:
Juan Carlos Mejías Rodríguez 2019-08-17 19:13:13 -04:00
parent 3c409ca3f3
commit 0be0262fcb
2 changed files with 14 additions and 6 deletions

View File

@ -51,10 +51,14 @@ var endpointInspectCmd = &cobra.Command{
}) })
common.CheckError(err) common.CheckError(err)
var endpointType string var endpointType string
if endpoint.Type == 1 { if endpoint.Type == portainer.DockerEnvironment {
endpointType = "docker" endpointType = "docker"
} else if endpoint.Type == 2 { } else if endpoint.Type == portainer.AgentOnDockerEnvironment {
endpointType = "agent" endpointType = "agent on docker"
} else if endpoint.Type == portainer.AzureEnvironment {
endpointType = "azure"
} else if endpoint.Type == portainer.EdgeAgentEnvironment {
endpointType = "edge agent"
} }
_, err = fmt.Fprintln(writer, fmt.Sprintf( _, err = fmt.Fprintln(writer, fmt.Sprintf(
"%v\t%s\t%v\t%s\t%s\t%v", "%v\t%s\t%v\t%s\t%s\t%v",

View File

@ -47,10 +47,14 @@ var endpointListCmd = &cobra.Command{
common.CheckError(err) common.CheckError(err)
for _, e := range endpoints { for _, e := range endpoints {
var endpointType string var endpointType string
if e.Type == 1 { if e.Type == portainer.DockerEnvironment {
endpointType = "docker" endpointType = "docker"
} else if e.Type == 2 { } else if e.Type == portainer.AgentOnDockerEnvironment {
endpointType = "agent" endpointType = "agent on docker"
} else if e.Type == portainer.AzureEnvironment {
endpointType = "azure"
} else if e.Type == portainer.EdgeAgentEnvironment {
endpointType = "edge agent"
} }
_, err := fmt.Fprintln(writer, fmt.Sprintf( _, err := fmt.Fprintln(writer, fmt.Sprintf(
"%v\t%s\t%v\t%s\t%s\t%v", "%v\t%s\t%v\t%s\t%s\t%v",