From b33c353233aae4d73b1567aee41fd5d4cad5bf76 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 9 Jun 2018 16:23:09 +0200 Subject: refactor(context): Implement more explicit merging of variables The hierarchy for loading variables was previously not expressed explicitly. This commit refactors the logic for merging variables to explicitly set the different layers of variables as values on the context object and merge them for each resource set in `mergeContextValues`. --- main.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index ee70bdae55..b792a1a3b5 100644 --- a/main.go +++ b/main.go @@ -184,16 +184,11 @@ func createCommand() { } func loadContextAndResources(file *string) (*context.Context, *[]templater.RenderedResourceSet) { - ctx, err := context.LoadContextFromFile(*file) + ctx, err := context.LoadContext(*file, variables) if err != nil { app.Fatalf("Error loading context: %v\n", err) } - err = ctx.SetVariablesFromArguments(variables) - if err != nil { - app.Fatalf("Error setting explicit variables in context: %v\n", err) - } - resources, err := templater.LoadAndApplyTemplates(includes, excludes, ctx) if err != nil { app.Fatalf("Error templating resource sets: %v\n", err) -- cgit 1.4.1