From 0be0262fcbba1507cb971e826d3611f8ca551e3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Mej=C3=ADas=20Rodr=C3=ADguez?= Date: Sat, 17 Aug 2019 19:13:13 -0400 Subject: [PATCH] Add support for Azure and Edge Agent endpoint types --- cmd/endpointInspect.go | 10 +++++++--- cmd/endpointList.go | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/cmd/endpointInspect.go b/cmd/endpointInspect.go index c7944bf..cdce6b4 100644 --- a/cmd/endpointInspect.go +++ b/cmd/endpointInspect.go @@ -51,10 +51,14 @@ var endpointInspectCmd = &cobra.Command{ }) common.CheckError(err) var endpointType string - if endpoint.Type == 1 { + if endpoint.Type == portainer.DockerEnvironment { endpointType = "docker" - } else if endpoint.Type == 2 { - endpointType = "agent" + } else if endpoint.Type == portainer.AgentOnDockerEnvironment { + 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( "%v\t%s\t%v\t%s\t%s\t%v", diff --git a/cmd/endpointList.go b/cmd/endpointList.go index 7b24160..ac23979 100644 --- a/cmd/endpointList.go +++ b/cmd/endpointList.go @@ -47,10 +47,14 @@ var endpointListCmd = &cobra.Command{ common.CheckError(err) for _, e := range endpoints { var endpointType string - if e.Type == 1 { + if e.Type == portainer.DockerEnvironment { endpointType = "docker" - } else if e.Type == 2 { - endpointType = "agent" + } else if e.Type == portainer.AgentOnDockerEnvironment { + 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( "%v\t%s\t%v\t%s\t%s\t%v",