Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Added config states #36
Conversation
|
This looks great, will review and test later today |
|
@marcoceppi Some changes made. |
johnsca
referenced this pull request
in juju-solutions/layer-apache-hive
Feb 16, 2016
Merged
Reconfigure service on config changes #7
|
Is there any reason this was not handled by another decorator? What happens if there is a "config.changed" state? Or if the configuration option has a dot in it? |
|
Don't get me wrong, I WANT a function like this, but it seems arbitrary to base it on the string state that could collide with legit states. |
|
All states should be prefixed with that layer name. As such there shouldn't On Tue, Feb 16, 2016, 4:27 PM Matt Bruzek notifications@github.com wrote:
|
|
Then shouldn't it be basic.config.changed ? |
|
Basic isn't really a layer less than it is a a primitive for other layers On Tue, Feb 16, 2016, 5:04 PM Matt Bruzek notifications@github.com wrote:
|
|
I also have a use case where I want to know if config A or B or C changes. I don't think we have a way to do that with this way of reusing @When |
|
States are arbitrary and technically developers can pick what ever they want. If they happen to pick "config.changed" as a state their layer emits, this breaks the functionality of the "if configuration changes". This feels to me more like a new decorator is needed @when_any_changed('A', 'B', 'C') or @when_changed('A') rather than an arbitrary state that could actually collide with the "config.changed" state. Much like "reserved words" in programming languages. If we do this change, we need to define "reserved states" in a document somewhere so people don't shoot themselves in the foot. Reserved states still feels arbitrary and non-deterministic to me but as @johnsca explained to me it is reusing facilities that already work and have been testsed. |
|
If a layer is choosing A |
|
|
johnsca commentedFeb 16, 2016
Now you can detect config value changes with states: