refactor: add specific check for missing context
This commit is contained in:
parent
19d435c5e5
commit
4ae5e6123d
@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"coopcloud.tech/abra/client"
|
"coopcloud.tech/abra/client"
|
||||||
"coopcloud.tech/abra/config"
|
"coopcloud.tech/abra/config"
|
||||||
@ -38,8 +39,8 @@ var serverListCommand = &cli.Command{
|
|||||||
var row []string
|
var row []string
|
||||||
for _, ctx := range contexts {
|
for _, ctx := range contexts {
|
||||||
endpoint, err := client.GetContextEndpoint(ctx)
|
endpoint, err := client.GetContextEndpoint(ctx)
|
||||||
if err != nil {
|
if err != nil && strings.Contains(err.Error(), "does not exist") {
|
||||||
// This most likely means its a non-docker swarm context and we can ignore
|
// No local context found, we can continue safely
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if ctx.Name == serverName {
|
if ctx.Name == serverName {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user