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 srcCredentialPath != destCredentialPath {
|
||||||
if err := copyCredential(srcCredentialPath, destCredentialPath); err != nil {
|
if err := copyCredential(srcCredentialPath, destCredentialPath); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
srcConfigPath := filepath.Join(userConfigDir, userConfigFile)
|
srcConfigPath := filepath.Join(userConfigDir, userConfigFile)
|
||||||
destConfigPath := filepath.Join(serviceConfigDir, serviceConfigFile)
|
destConfigPath := filepath.Join(serviceConfigDir, serviceConfigFile)
|
||||||
|
if srcConfigPath != destConfigPath {
|
||||||
if err := copyConfig(srcConfigPath, destConfigPath); err != nil {
|
if err := copyConfig(srcConfigPath, destConfigPath); err != nil {
|
||||||
return err
|
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