cloudfoundry-attic / bosh-init

bosh-init is a tool used to create and update the Director VM
Apache License 2.0
31 stars 33 forks source link

bosh-init uses template name as job name #87

Open mtekel opened 7 years ago

mtekel commented 7 years ago

When you define

jobs:
- name: myjob
  templates:
  - name: mypackage
    release: release1

Then <%= name %> in erb template of the mypackage will be mypackage instead of myjob. For example in case of collectd, your VM will send metrics as collectd instead of myjob. This is quite confusing, especially if you deploy multiple servers with bosh-init and they all end up with same name in their job configs...

bosh-init versions 0.0.95 and 0.0.80 - both have this behaviour.

cppforlife commented 7 years ago

@mtekel yup looks like a bug. should be instance group's name.

dpb587-pivotal commented 7 years ago

I'd guess NewEvaluationContext should be receiving an Instance and using Instance.JobName() for Name instead. Doesn't seem like this fix would be affected by CLI-related changes and could be safely PR'd to bosh-init and later merged to cli branch.