Skip to content

Commit

Permalink
add template name to render variables
Browse files Browse the repository at this point in the history
  • Loading branch information
wr0ngway committed Jun 22, 2021
1 parent a24edbb commit 89938ca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/kubetruth/etl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def apply
template_name, template = *pair
logger.debug { "Processing template '#{template_name}' (#{i}/#{project.spec.resource_templates.size})" }
resource_yml = template.render(
template: template_name,
project: project.name,
project_heirarchy: project.heirarchy,
debug: logger.debug?,
Expand Down
1 change: 1 addition & 0 deletions spec/kubetruth/etl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ class ForceExit < Exception; end

allow(etl).to receive(:kube_apply)
expect(etl.load_config.root_spec.resource_templates.values.first).to receive(:render) do |*args, **kwargs|
expect(kwargs[:template]).to eq("configmap")
expect(kwargs[:project]).to eq("proj1")
expect(kwargs[:project_heirarchy]).to eq(Project.all["proj1"].heirarchy)
expect(kwargs[:debug]).to eq(etl.logger.debug?)
Expand Down

0 comments on commit 89938ca

Please sign in to comment.