rkt: Override the config using the response from rkt api service.

This commit is contained in:
Yifan Gu 2016-08-23 11:42:20 -07:00
parent ea805efa4f
commit d65a96a600

View File

@ -88,21 +88,21 @@ func (r *Runtime) getConfig(cfg *Config) (*Config, error) {
flags := resp.Info.GlobalFlags
if cfg.Dir == "" {
if flags.Dir != "" {
cfg.Dir = flags.Dir
}
if cfg.InsecureOptions == "" {
cfg.InsecureOptions = flags.InsecureFlags
}
if cfg.LocalConfigDir == "" {
if flags.LocalConfigDir != "" {
cfg.LocalConfigDir = flags.LocalConfigDir
}
if cfg.UserConfigDir == "" {
if flags.UserConfigDir != "" {
cfg.UserConfigDir = flags.UserConfigDir
}
if cfg.SystemConfigDir == "" {
if flags.SystemConfigDir != "" {
cfg.SystemConfigDir = flags.SystemConfigDir
}
if flags.InsecureFlags != "" {
cfg.InsecureOptions = fmt.Sprintf("%s,%s", cfg.InsecureOptions, flags.InsecureFlags)
}
return cfg, nil
}