cmd/list: Rename functions for getting images/containers

This commit is contained in:
Ondřej Míchal 2021-03-22 14:38:45 +01:00
parent eedfdda535
commit 1e2005a7d0
2 changed files with 5 additions and 5 deletions

View file

@ -103,14 +103,14 @@ func list(cmd *cobra.Command, args []string) error {
var err error
if lsImages {
images, err = listImages()
images, err = getImages()
if err != nil {
return err
}
}
if lsContainers {
containers, err = listContainers()
containers, err = getContainers()
if err != nil {
return err
}
@ -120,7 +120,7 @@ func list(cmd *cobra.Command, args []string) error {
return nil
}
func listContainers() ([]toolboxContainer, error) {
func getContainers() ([]toolboxContainer, error) {
logrus.Debug("Fetching containers with label=com.github.containers.toolbox=true")
args := []string{"--all", "--filter", "label=com.github.containers.toolbox=true"}
containers_old, err := podman.GetContainers(args...)
@ -188,7 +188,7 @@ func listHelp(cmd *cobra.Command, args []string) {
}
}
func listImages() ([]toolboxImage, error) {
func getImages() ([]toolboxImage, error) {
logrus.Debug("Fetching images with label=com.github.containers.toolbox=true")
args := []string{"--filter", "label=com.github.containers.toolbox=true"}
images_old, err := podman.GetImages(args...)

View file

@ -166,7 +166,7 @@ func runCommand(container string,
return err
}
containers, err := listContainers()
containers, err := getContainers()
if err != nil {
err := utils.CreateErrorContainerNotFound(container, executableBase)
return err