BUGFIX: If runtime cannot be found, error out
In the case where the runtime cannot be found, kpod should error out. This occurs in kpod ps when iterating through the containers to get details. Signed-off-by: baude <bbaude@redhat.com>
This commit is contained in:
parent
af692f611d
commit
73b9e4c430
1 changed files with 5 additions and 0 deletions
|
@ -4,6 +4,7 @@ import (
|
|||
"os"
|
||||
"strings"
|
||||
|
||||
"fmt"
|
||||
is "github.com/containers/image/storage"
|
||||
"github.com/containers/storage"
|
||||
"github.com/fatih/camelcase"
|
||||
|
@ -93,6 +94,10 @@ func getConfig(c *cli.Context) (*libkpod.Config, error) {
|
|||
if c.GlobalIsSet("runtime") {
|
||||
config.Runtime = c.GlobalString("runtime")
|
||||
}
|
||||
if _, err := os.Stat(config.Runtime); os.IsNotExist(err) {
|
||||
// path to runtime does not exist
|
||||
return config, fmt.Errorf("invalid --runtime value %q", err)
|
||||
}
|
||||
return config, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue