diff --git a/bundle/config/root.go b/bundle/config/root.go index 89c9b2233..c5e52ec2e 100644 --- a/bundle/config/root.go +++ b/bundle/config/root.go @@ -264,11 +264,12 @@ func (r *Root) InitializeVariables(vars []string) error { // Variables can have any type of value, including complex types func (r *Root) InitializeAnyTypeVariables(vars map[string]any) error { for name, val := range vars { - if _, ok := r.Variables[name]; !ok { + variable, ok := r.Variables[name] + if !ok { return fmt.Errorf("variable %s has not been defined", name) } - err := r.Variables[name].Set(val) + err := variable.Set(val) if err != nil { return fmt.Errorf("failed to assign %s to %s: %s", val, name, err) }