Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

link("thing").instances.find {|item| item.bootstrap} - returns nil #596

Closed
drnic opened this issue Sep 29, 2019 · 1 comment
Closed

link("thing").instances.find {|item| item.bootstrap} - returns nil #596

drnic opened this issue Sep 29, 2019 · 1 comment
Labels

Comments

@drnic
Copy link
Contributor

drnic commented Sep 29, 2019

I have a bosh template with:

<%= link("redis").instances.find {|redis| redis.bootstrap }.address %>

But template-render init container fails as below, suggesting link("redis").instances.find {|redis| redis.bootstrap } is returning nil. Is this not supported in cf-operator or any protips for fixing?

redis-deployment-redis-v1-1 template-render + cf-operator util template-render
redis-deployment-redis-v1-1 template-render 2019/09/29 23:32:29 failed to render template: rendering failed: (erb):180:in `block in get_binding': undefined method `address' for nil:NilClass (NoMethodError)
redis-deployment-redis-v1-1 template-render 	from /usr/lib64/ruby/gems/2.5.0/gems/bosh-template-2.2.1/lib/bosh/template/evaluation_context.rb:115:in `if_p'
redis-deployment-redis-v1-1 template-render 	from (erb):177:in `get_binding'
redis-deployment-redis-v1-1 template-render 	from /usr/lib64/ruby/2.5.0/erb.rb:885:in `eval'
redis-deployment-redis-v1-1 template-render 	from /usr/lib64/ruby/2.5.0/erb.rb:885:in `result'
redis-deployment-redis-v1-1 template-render 	from /usr/lib64/ruby/gems/2.5.0/gems/bosh-template-2.2.1/lib/bosh/template/test/template.rb:22:in `render'
redis-deployment-redis-v1-1 template-render 	from /tmp/bosh-erb-renderer717623379/bosh_erb_renderer.rb:78:in `<main>'
@cf-gitbot
Copy link

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/168827598

The labels on this github issue will be updated when the story is started.

qu1queee added a commit that referenced this issue Oct 1, 2019
- Add new bootstrap field of the type boolean into JobInstance struct
- Add unit tests for ensuring generated job instances have the proper information
- Only set bootstrap to TRUE, if the instance is the one with index 0
- Extend the redis bosh release asset, to support the rendering of
  `redis.conf.erb`, where #596
  was originated.
viovanov pushed a commit that referenced this issue Oct 1, 2019
- Add new bootstrap field of the type boolean into JobInstance struct
- Add unit tests for ensuring generated job instances have the proper information
- Only set bootstrap to TRUE, if the instance is the one with index 0
- Extend the redis bosh release asset, to support the rendering of
  `redis.conf.erb`, where #596
  was originated.
@qu1queee qu1queee closed this as completed Oct 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants