cf-platform-eng / tile-generator

Tools to develop, package, test, and deploy software on Pivotal Cloud Foundry
https://docs.pivotal.io/tiledev/tile-generator.html
Apache License 2.0
88 stars 59 forks source link

BOSH Links: Generated job templates should use name instead of type #220

Closed PhilippeKhalife closed 6 years ago

PhilippeKhalife commented 6 years ago

Given tile.yml:

packages:

The generated spec for deploy-all seems correct:

consumes:

The generated "templates/deploy-all.sh.erb" and "templates/opsmgr.env.erb" however are using the "type" instead of "name" and this does not get processed correctly.

<% if_link('svc') do |link| %> <% hosts = link.instances.map { |instance| instance.address } %> export SVC_HOST="<%= link.instances[0].address %>" export SVC_HOSTS=<%= Shellwords.escape(hosts.to_json) %> export SVC_PROPERTIES=<%= Shellwords.escape(link.properties.to_json) %> <% end %>

I tested a manual change to the templates, and this works correctly:

<% if_link('svc_newname') do |link| %> <% hosts = link.instances.map { |instance| instance.address } %> export SVC_NEWNAME_HOST="<%= link.instances[0].address %>" export SVC_NEWNAME_HOSTS=<%= Shellwords.escape(hosts.to_json) %> export SVC_NEWNAME_PROPERTIES=<%= Shellwords.escape(link.properties.to_json) %> <% end %>

PhilippeKhalife commented 6 years ago

Fixing this is a requirement to fix issue #219.

PhilippeKhalife commented 6 years ago

This is now fixed with pull request submitted.