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.
This commit is contained in:
Sybren A. Stüvel 2022-08-29 17:44:47 +02:00
parent 4a201d47b4
commit 20395e0e26

@ -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)