Merge pull request #12872 from runningwild/master

Fix several problems with using rkt on gce
This commit is contained in:
Saad Ali
2015-08-20 15:46:16 -07:00
8 changed files with 55 additions and 37 deletions

View File

@@ -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.

View File

@@ -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{