Allow configuring the rkt binary in a kubelet with a flag.
This is necessary because coreos comes with rkt installed, and if we want to use a different version we need some way to avoid the default one.
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.
|
||||
|
@@ -128,11 +128,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