forked from toolshed/abra
feat: added error to GetContextEndpoint
this ill make the progam not fail if there is a non-docker swarm context
This commit is contained in:
@ -26,10 +26,16 @@ var serverListCommand = &cli.Command{
|
||||
|
||||
serverNames := config.ReadServerNames()
|
||||
for _, serverName := range serverNames {
|
||||
|
||||
var row []string
|
||||
for _, ctx := range contexts {
|
||||
endpoint, err := client.GetContextEndpoint(ctx)
|
||||
if err != nil {
|
||||
// This most likely means its a non-docker swarm context and we can ignore
|
||||
continue
|
||||
}
|
||||
if ctx.Name == serverName {
|
||||
row = []string{serverName, client.GetContextEndpoint(ctx)}
|
||||
row = []string{serverName, endpoint}
|
||||
}
|
||||
}
|
||||
if len(row) == 0 {
|
||||
|
Reference in New Issue
Block a user