Commit e803f55e authored by Yifan Gu's avatar Yifan Gu

rkt: Update the directory path for saving auth config.

parent 6320e41b
......@@ -196,11 +196,15 @@ func (r *Runtime) writeDockerAuthConfig(image string, credsSlice []docker.AuthCo
registry = strings.Split(image, "/")[0]
}
localConfigDir := rktLocalConfigDir
if r.config.LocalConfigDir != "" {
localConfigDir = r.config.LocalConfigDir
configDir := r.config.UserConfigDir
if configDir == "" {
configDir = r.config.LocalConfigDir
}
authDir := path.Join(localConfigDir, "auth.d")
if configDir == "" {
return fmt.Errorf("No user or local config dir is specified")
}
authDir := path.Join(configDir, "auth.d")
if _, err := os.Stat(authDir); os.IsNotExist(err) {
if err := os.Mkdir(authDir, 0600); err != nil {
glog.Errorf("rkt: Cannot create auth dir: %v", err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment