Add warning for error when reading config

This commit is contained in:
Bernd Schoolmann 2023-09-19 22:14:52 +02:00
parent 10ec5f6fc9
commit 5a64d08022
No known key found for this signature in database
1 changed files with 1 additions and 2 deletions

View File

@ -94,8 +94,6 @@ func serveAgentSession(c net.Conn, ctx context.Context, vault *vault.Vault, cfg
}
type AgentState struct {
vault *vault.Vault
config *config.ConfigFile
}
func StartUnixAgent(path string, runtimeConfig config.RuntimeConfig) error {
@ -106,6 +104,7 @@ func StartUnixAgent(path string, runtimeConfig config.RuntimeConfig) error {
var vault = vault.NewVault(&keyring)
cfg, err := config.ReadConfig(runtimeConfig)
if err != nil {
log.Warn("Could not read config: %s", err.Error())
cfg = config.DefaultConfig()
cfg.ConfigFile.RuntimeConfig = runtimeConfig
cfg.WriteConfig()