Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use node kibana version attribute in download url #5

Closed
vkhatri opened this issue Jun 6, 2015 · 7 comments
Closed

use node kibana version attribute in download url #5

vkhatri opened this issue Jun 6, 2015 · 7 comments
Labels

Comments

@vkhatri
Copy link

vkhatri commented Jun 6, 2015

kibana download_url must use node kibana version attribute

vkhatri added a commit to vkhatri/simple-kibana-cookbook that referenced this issue Jun 6, 2015
@jsirex
Copy link
Owner

jsirex commented Jun 6, 2015

This change leads to bug when using wrapper cookbook. download_url will be wrong.

It is really bad idea to calculate attributes in such way, isn't?

@jsirex jsirex added the question label Jun 6, 2015
@vkhatri
Copy link
Author

vkhatri commented Jun 7, 2015

@jsirex it should not be and i think if we modify the version attribute in a role or wrapper cookbook we would not need to set download_url

@vkhatri
Copy link
Author

vkhatri commented Jun 7, 2015

if wrapper cookbook set a different download location, then its up to the user whether the user wants to use version attribute or not.

@jsirex
Copy link
Owner

jsirex commented Jun 8, 2015

There is branch version_test for you. Check it.

I've overrode version in wrapper cookbook (simple-kibana-test) to 5.5.5.
Expected calculated resource to be version now: 5.5.5, but you'll get:

rspec spec/version_spec.rb 

simple-kibana-test::default
[2015-06-08T14:06:32+03:00] WARN: version now: 4.0.2
  expect calculated version right

@jsirex
Copy link
Owner

jsirex commented Jun 8, 2015

If you need some explanations:

You code literally means:

default['kibana']['version'] = '4.0.2'
default['kibana']['download_url'] = "https://download.elasticsearch.org/kibana/kibana/kibana-#{node['kibana']['version']}-linux-x64.tar.gz"
default['kibana']['version'] = '5.5.5'

So it will be impossible to override url in wrapper cookbook.

But, looks like if you set node attributes explicitly via node object/environment/role with higher precedence it will work for you. May be these attributes loads right before cookbooks attributes evaluations. Not sure

@vkhatri
Copy link
Author

vkhatri commented Jun 8, 2015

@jsirex i think precedence for node/environment/role is the expected flow to override default. i have not seen any issue with that. but it may be just me, i try to ignore updating default attribute in wrapper cookbook especially when other attributes are evaluated by them.

but i could be wrong, it is really comes down to how the precedence is followed in different scenarios.

@jsirex
Copy link
Owner

jsirex commented Jun 10, 2015

Similar issue faced long time ago in elasticsearch cookbook: sous-chefs/elasticsearch#178

So, I close it.

@jsirex jsirex closed this as completed Jun 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants