add auto-set container-runtime for kic
parent
2bf1289bf3
commit
b6dbf3bd0d
|
|
@ -969,6 +969,13 @@ func autoSetDriverOptions(cmd *cobra.Command, drvName string) error {
|
|||
if !cmd.Flags().Changed(cacheImages) {
|
||||
viper.Set(cacheImages, hints.CacheImages)
|
||||
}
|
||||
|
||||
// currently only used for kic
|
||||
if !cmd.Flags().Changed(containerRuntime) && hints.ContainerRuntime != "" {
|
||||
viper.Set(containerRuntime, hints.ContainerRuntime)
|
||||
glog.Infof("auto set container runtime to %s for kic driver.", hints.ContainerRuntime)
|
||||
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -75,14 +75,20 @@ func BareMetal(name string) bool {
|
|||
|
||||
// FlagHints are hints for what default options should be used for this driver
|
||||
type FlagHints struct {
|
||||
ExtraOptions string
|
||||
CacheImages bool
|
||||
ExtraOptions string
|
||||
CacheImages bool
|
||||
ContainerRuntime string
|
||||
}
|
||||
|
||||
// FlagDefaults returns suggested defaults based on a driver
|
||||
func FlagDefaults(name string) FlagHints {
|
||||
if name != None {
|
||||
return FlagHints{CacheImages: true}
|
||||
fh := FlagHints{CacheImages: true}
|
||||
// only for kic, till other run-times are available we auto-set containerd.
|
||||
if name == KicDocker {
|
||||
fh.ContainerRuntime = "containerd"
|
||||
}
|
||||
return fh
|
||||
}
|
||||
|
||||
extraOpts := ""
|
||||
|
|
|
|||
Loading…
Reference in New Issue