AUTH-2687 don't copy config unnecessarily
This commit is contained in:
parent
e376a13025
commit
9e76e42e3c
|
@ -184,17 +184,24 @@ func copyUserConfiguration(userConfigDir, userConfigFile, userCredentialFile str
|
||||||
if err := ensureConfigDirExists(serviceConfigDir); err != nil {
|
if err := ensureConfigDirExists(serviceConfigDir); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
srcCredentialPath := filepath.Join(userConfigDir, userCredentialFile)
|
srcCredentialPath := filepath.Join(userConfigDir, userCredentialFile)
|
||||||
destCredentialPath := filepath.Join(serviceConfigDir, serviceCredentialFile)
|
destCredentialPath := filepath.Join(serviceConfigDir, serviceCredentialFile)
|
||||||
if err := copyCredential(srcCredentialPath, destCredentialPath); err != nil {
|
if srcCredentialPath != destCredentialPath {
|
||||||
return err
|
if err := copyCredential(srcCredentialPath, destCredentialPath); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
srcConfigPath := filepath.Join(userConfigDir, userConfigFile)
|
srcConfigPath := filepath.Join(userConfigDir, userConfigFile)
|
||||||
destConfigPath := filepath.Join(serviceConfigDir, serviceConfigFile)
|
destConfigPath := filepath.Join(serviceConfigDir, serviceConfigFile)
|
||||||
if err := copyConfig(srcConfigPath, destConfigPath); err != nil {
|
if srcConfigPath != destConfigPath {
|
||||||
return err
|
if err := copyConfig(srcConfigPath, destConfigPath); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
logger.Infof("Copied %s to %s", srcConfigPath, destConfigPath)
|
||||||
}
|
}
|
||||||
logger.Infof("Copied %s to %s", srcConfigPath, destConfigPath)
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue