This repository was archived by the owner on May 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 367
This repository was archived by the owner on May 12, 2021. It is now read-only.
Mismatch between code and comments #139
Copy link
Copy link
Closed
Description
Lines 52 to 77 in 6ac1958
| // getContainerInfo returns the container status and its pod ID. | |
| // It internally expands the container ID from the prefix provided. | |
| func getContainerInfo(containerID string) (vc.ContainerStatus, string, error) { | |
| // container ID MUST be provided. | |
| if containerID == "" { | |
| return vc.ContainerStatus{}, "", fmt.Errorf("Missing container ID") | |
| } | |
| podStatusList, err := vci.ListPod() | |
| if err != nil { | |
| return vc.ContainerStatus{}, "", err | |
| } | |
| for _, podStatus := range podStatusList { | |
| for _, containerStatus := range podStatus.ContainersStatus { | |
| if containerStatus.ID == containerID { | |
| return containerStatus, podStatus.ID, nil | |
| } | |
| } | |
| } | |
| // Not finding a container should not trigger an error as | |
| // getContainerInfo is used for checking the existence and | |
| // the absence of a container ID. | |
| return vc.ContainerStatus{}, "", nil | |
| } |
However, it cannot expand internally now. Same in cc runtime code. I think we can gather some comment errors and fix together.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels