Skip to content

Commit

Permalink
move back the first/last time inside containerlist loop
Browse files Browse the repository at this point in the history
Signed-off-by: Heba Elayoty <hebaelayoty@gmail.com>
  • Loading branch information
helayoty committed Jan 23, 2023
1 parent 92035a5 commit d65fb7b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkg/provider/containergroup_to_pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,16 @@ func (p *ACIProvider) getPodStatusFromContainerGroup(ctx context.Context, cg *az
containerStatuses := make([]v1.ContainerStatus, 0, len(cg.Properties.Containers))
containersList := cg.Properties.Containers

//init the start/last time
firstContainerStartTime := containersList[0].Properties.InstanceView.CurrentState.StartTime
lastUpdateTime := firstContainerStartTime

for i := range containersList {
err := validation.ValidateContainer(ctx, containersList[i])
logger.Debugf("container %s has missing fields. retrying the validation...", *containersList[i].Name)
if err != nil {
return nil, err
}

firstContainerStartTime := containersList[i].Properties.InstanceView.CurrentState.StartTime
lastUpdateTime := firstContainerStartTime

containerStatus := v1.ContainerStatus{
Name: *containersList[i].Name,
State: aciContainerStateToContainerState(containersList[i].Properties.InstanceView.CurrentState),
Expand Down

0 comments on commit d65fb7b

Please sign in to comment.