Merge pull request #12872 from runningwild/master
Fix several problems with using rkt on gce
This commit is contained in:
@@ -21,6 +21,8 @@ import "fmt"
|
||||
// Config stores the global configuration for the rkt runtime.
|
||||
// Run 'rkt' for more details.
|
||||
type Config struct {
|
||||
// The absolute path to the binary, or leave empty to find it in $PATH.
|
||||
Path string
|
||||
// The debug flag for rkt.
|
||||
Debug bool
|
||||
// The rkt data directory.
|
||||
|
@@ -131,11 +131,14 @@ func New(config *Config,
|
||||
return nil, fmt.Errorf("cannot connect to dbus: %v", err)
|
||||
}
|
||||
|
||||
// Test if rkt binary is in $PATH.
|
||||
// TODO(yifan): Use a kubelet flag to read the path.
|
||||
rktBinAbsPath, err := exec.LookPath("rkt")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot find rkt binary: %v", err)
|
||||
rktBinAbsPath := config.Path
|
||||
if rktBinAbsPath == "" {
|
||||
// No default rkt path was set, so try to find one in $PATH.
|
||||
var err error
|
||||
rktBinAbsPath, err = exec.LookPath("rkt")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot find rkt binary: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
rkt := &runtime{
|
||||
|
Reference in New Issue
Block a user