From ecf3e5d67984237d7393099b0fdcaa7e92479ed8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9a=20Grondier?= Date: Mon, 6 Jan 2025 16:34:19 +0100 Subject: [PATCH] security-group show: fix empty response if an API endpoint is misbehaving --- utils/utils.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/utils/utils.go b/utils/utils.go index 0292bd68..0de0cd47 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -57,7 +57,11 @@ func GetInstancesInSecurityGroup(ctx context.Context, client *v2.Client, securit return nil }) if err != nil { - return nil, err + if allInstances == nil { + return nil, err + } else { + fmt.Printf("error while listing instances in security group: %s", err) + } } var instancesInSG []*v2.Instance