about summary refs log tree commit diff
path: root/context
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@gmail.com>2018-06-09T18·45+0200
committerVincent Ambo <github@tazj.in>2018-06-09T19·16+0200
commit77ca5b47cf5d40fa53204633924e8ba30a517b3f (patch)
tree302e4ba5feed8a25a8d48d018f73a3a459cf64e0 /context
parentae6d960df941c3980c91e90e940b50ad59697eb7 (diff)
fix(context): Global values have precedence over defaults
Diffstat (limited to 'context')
-rw-r--r--context/context.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/context/context.go b/context/context.go
index 237d51435e91..e6e3d4a12540 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