From 29a22c50fdd9c17b5669846195f18de3b82aa25a Mon Sep 17 00:00:00 2001 From: Rebecca Mahany-Horton Date: Thu, 14 Dec 2023 17:05:26 -0500 Subject: [PATCH] Improve documentation around falling back to default config file path --- ee/tuf/library_lookup.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ee/tuf/library_lookup.go b/ee/tuf/library_lookup.go index afb2da1d9..240545dc8 100644 --- a/ee/tuf/library_lookup.go +++ b/ee/tuf/library_lookup.go @@ -81,8 +81,12 @@ func getAutoupdateConfig(args []string) (*autoupdateConfig, error) { return nil, fmt.Errorf("parsing command-line flags: %w", err) } - // If the config file wasn't set AND the other flags weren't set, fall back - // to looking in the default config flag file location + // If the config file wasn't set AND the other critical flags weren't set, fall back + // to looking in the default config flag file location. (The update directory and local + // development path are both optional flags and not critical to library lookup + // functionality.) We expect all the flags to be set either via config flag (flConfigFilePath + // is set) or via command line (flRootDirectory and flUpdateChannel are set), but do not + // support a mix of both for this usage. if flConfigFilePath == "" && flRootDirectory == "" && flUpdateChannel == "" { return getAutoupdateConfigFromFile(launcher.ConfigFilePath(args)) }