Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.
This repository was archived by the owner on May 12, 2021. It is now read-only.

Mismatch between code and comments #139

@caoruidong

Description

@caoruidong

runtime/cli/oci.go

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions