config: delay load config file (#5258)

Restructuring of config code in v1.55 resulted in config
file being loaded early at process startup. If configuration
file is encrypted this means user will need to supply the password,
even when running commands that does not use config.
This also lead to an issue where mount with --deamon failed to
decrypt the config file when it had to prompt user for passord.

Fixes #5236
Fixes #5228
This commit is contained in:
albertony 2021-04-26 23:37:49 +02:00 committed by GitHub
parent 5d799431a7
commit f8d56bebaf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 117 additions and 101 deletions

View file

@ -103,7 +103,7 @@ type testRun struct {
// Run a suite of tests
func testServer(t *testing.T, tests []testRun, opt *rc.Options) {
ctx := context.Background()
configfile.LoadConfig(ctx)
configfile.Install()
mux := http.NewServeMux()
opt.HTTPOptions.Template = testTemplate
rcServer := newServer(ctx, opt, mux)