From b155fe0f2e7df47a9589fe839cce40d373327683 Mon Sep 17 00:00:00 2001 From: aiordache Date: Mon, 7 Sep 2020 14:26:10 +0200 Subject: [PATCH] retrieve status with get group by name Signed-off-by: aiordache --- aci/backend.go | 10 +++++++++- aci/convert/convert.go | 9 --------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/aci/backend.go b/aci/backend.go index 37ec9f0d5..ceabd7cf2 100644 --- a/aci/backend.go +++ b/aci/backend.go @@ -172,7 +172,15 @@ func getContainerGroups(ctx context.Context, subscriptionID string, resourceGrou return []containerinstance.ContainerGroup{}, err } } - return containerGroups, nil + var groups []containerinstance.ContainerGroup + for _, group := range containerGroups { + group, err := groupsClient.Get(ctx, resourceGroup, *group.Name) + if err != nil { + return []containerinstance.ContainerGroup{}, err + } + groups = append(groups, group) + } + return groups, nil } func getContainerID(group containerinstance.ContainerGroup, container containerinstance.Container) string { diff --git a/aci/convert/convert.go b/aci/convert/convert.go index f8da647f2..eb505b4c1 100644 --- a/aci/convert/convert.go +++ b/aci/convert/convert.go @@ -452,15 +452,6 @@ func ContainerGroupToContainer(containerID string, cg containerinstance.Containe // GetStatus returns status for the specified container func GetStatus(container containerinstance.Container, group containerinstance.ContainerGroup) string { status := compose.UNKNOWN - if group.ContainerGroupProperties != nil && group.ContainerGroupProperties.ProvisioningState != nil { - status = *group.ContainerGroupProperties.ProvisioningState - switch status { - case "Succeeded": - status = compose.RUNNING - case "Failed": - status = compose.FAILED - } - } if group.InstanceView != nil && group.InstanceView.State != nil { status = "Node " + *group.InstanceView.State }