From 77ca5b47cf5d40fa53204633924e8ba30a517b3f Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 9 Jun 2018 20:45:42 +0200 Subject: [PATCH] fix(context): Global values have precedence over defaults --- context/context.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/context/context.go b/context/context.go index 237d51435..e6e3d4a12 100644 --- a/context/context.go +++ b/context/context.go @@ -88,7 +88,7 @@ func LoadContext(filename string, explicitVars *[]string) (*Context, error) { return nil, contextLoadingError(filename, err) } - // Merge variables (explicit > import > include > global > default) + // Merge variables (explicit > import > include > global > default) ctx.ResourceSets = ctx.mergeContextValues() if err != nil { @@ -168,7 +168,7 @@ func (ctx *Context) mergeContextValues() []ResourceSet { for i, rs := range ctx.ResourceSets { merged := loadDefaultValues(&rs, ctx) - merged = util.Merge(&ctx.Global, merged) + merged = util.Merge(merged, &ctx.Global) merged = util.Merge(merged, &ctx.ImportedVars) merged = util.Merge(merged, &ctx.ExplicitVars) rs.Values = *merged