From 20395e0e26624de0d267888d1ad36de433687c0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Mon, 29 Aug 2022 17:44:47 +0200 Subject: [PATCH] Manager: always start the variable lookup table with a fresh map If the loaded config doesn't define the default variables, the latter should not be found in the lookup table any more; this is now fixed. --- internal/manager/config/config.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/manager/config/config.go b/internal/manager/config/config.go index cca9b9f8..d3cb5adb 100644 --- a/internal/manager/config/config.go +++ b/internal/manager/config/config.go @@ -311,9 +311,10 @@ func (c *Conf) ensureVariablesUnique() { } func (c *Conf) constructVariableLookupTable() { - if c.VariablesLookup == nil { - c.VariablesLookup = map[VariableAudience]map[VariablePlatform]map[string]string{} - } + // Always start with a fresh map, so that variables (or values) that have been + // removed are actually gone. This is even necessary to account for + // differences between the default config and the loaded config. + c.VariablesLookup = map[VariableAudience]map[VariablePlatform]map[string]string{} c.constructVariableLookupTableForVars(c.Variables) c.constructVariableLookupTableForVars(c.implicitVariables)