-
Notifications
You must be signed in to change notification settings - Fork 37
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
global_values in evironments do not get applied #26
Comments
interestingly, when i add consul to the template sources and add the template to consul ( i had to, due to #27 ) i do get the proper behavior, so development->mysql.erb->config->slow_query_log superseeds defaults->global->slow_query_log this seem to be a bug for sure, as far as i understand |
I could reproduce it once again: This run is without having anything in conul - default is picked up
this one is with having set configuration/globals/httpd/all/open_file_cache_valid to 12s
As you see, 12s are replaced by 45s now i added the value to the production environment configuration/globals/httpd/production/open_file_cache_valid to 11s
still, overriden by defaults. My common.yaml looks like this:
|
i think this has nothing to do with consul, its a broken defaults plugin. having this configuration
i see
as you see open_file_cache_valid => '0s' being replaced by : '45s' from DefaultsDataSource so first the env development is picked up with 0, then overriden by global? |
@markround as promised, i created a docker image for easy testing: To reproduce
The you see
As you see, the environment is production, while the value of should_be_overriden is still overriden. You can build the image yourself or run it with a custom cmd to change the environment like
You can of course build the image yourself, if you have no hub.docker.io account
@markround this is a huge blocker for me, it makes tiller more or less completely useless for what i have chosen it. It would be great if we could sort this out as soon as possible. Let me know how to assist you |
@markround i could drill down the issue a bit a) i fixed the wrong defintion in production causing the first issue EugenMayer/tiller-test@00288c3#diff-a186fce8e470a58e6e6848844574b2cbL11 so the general overriding works, but not entirely. When you run the container with
you see, that the global_values definition of development is not applied as documented here: https://github.com/markround/tiller#defaults-per-environment. So the only issue left here is, that global_values in environments are not applied There is an additional issue, i will create a new issue for that (#29) |
Also waiting here, anyhow i could help? |
Hi, Firstly - many thanks for the incredibly detailed issues and test cases around them. Much appreciated! Anyway, looking at this, I think it's again a similar issue to #32. I can see your exec: [ "cat" , "/tmp/test"]
data_sources: [ "defaults", "file"]
template_sources: [ "file" ]
defaults:
test.erb:
target: /tmp/test
config:
global_val: '1'
should_be_overriden: 'global'
environments:
production:
test.erb:
config:
should_be_overriden: 'production'
development:
global_values:
should_be_overriden: 'development' Which will not work in development, as the global value will always be over-written by a template value, which is what the defaults module is providing. Just to re-iterate my comment on #32, "a template var always over-rides a global var, and can only be over-ridden by another template var from a higher priority plugin." This would work, as it uses template vars to over-ride the defaults global var: exec: [ "cat" , "/tmp/test"]
data_sources: [ "defaults", "file"]
template_sources: [ "file" ]
defaults:
should_be_overriden: 'global'
global_val: '1'
environments:
production:
test.erb:
target: /tmp/test
config:
should_be_overriden: 'production'
development:
test.erb:
target: /tmp/test
config:
should_be_overriden: 'development' Or, if you want to avoid duplication, define the template for all environments and stick to using template vars: exec: [ "cat" , "/tmp/test"]
data_sources: [ "defaults", "file"]
template_sources: [ "file" ]
defaults:
test.erb:
target: /tmp/test
config:
should_be_overriden: 'global'
global_val: '1'
environments:
production:
test.erb:
config:
should_be_overriden: 'production'
development:
test.erb:
config:
should_be_overriden: 'development' Or something like this, using global vars that then get over-ridden by template vars in the environments, but specifying the template target as a default template var, so you don't have to repeat that bit of the definitions: exec: [ "cat" , "/tmp/test"]
data_sources: [ "defaults", "file"]
template_sources: [ "file" ]
defaults:
should_be_overriden: 'global'
global_val: '1'
test.erb:
target: /tmp/test
environments:
production:
test.erb:
config:
should_be_overriden: 'production'
development:
test.erb:
config:
should_be_overriden: 'development' Or even making it more efficient by using global vars to over-ride things (the template still gets generated in the both environments as it's defined in the defaults section): exec: [ "cat" , "/tmp/test"]
data_sources: [ "defaults", "file"]
template_sources: [ "file" ]
defaults:
should_be_overriden: 'global'
global_val: '1'
test.erb:
target: /tmp/test
environments:
production:
global_values:
should_be_overriden: 'production'
development:
global_values:
should_be_overriden: 'development' Or even a mix of the two approaches: exec: [ "cat" , "/tmp/test"]
data_sources: [ "defaults", "file"]
template_sources: [ "file" ]
defaults:
should_be_overriden: 'global'
global_val: '1'
test.erb:
target: /tmp/test
environments:
production:
test.erb:
config:
should_be_overriden: 'production'
development:
global_values:
should_be_overriden: 'development' |
Closing this issue as I think this is down to a mis-understanding of Tiller's behaviour. I've updated the docs to hopefully make this clearer. Please re-open if you believe this to be a genuine bug. |
Having this common.yaml: https://goo.gl/ew5po4
I get a warning, that slow_query_log and log_queries_not_using_index being overriden by the "global" defaults, so they end up being 0, not 1, in development.
I expected the environment specific defaults to superseed the global defaults, not the other way arround?
The text was updated successfully, but these errors were encountered: