juju-solutions / layer-caas-base

Base layer for CaaS charms
Apache License 2.0
2 stars 7 forks source link

config.changed trigger not triggering #16

Open stub42 opened 5 years ago

stub42 commented 5 years ago

I have a trigger on config.changed, which is not firing:

reactive.register_trigger(when='config.changed', clear_flag='postgresql.configured')

I think this is because caas_base is initializing the flags on module import, rather than scheduling it for later using hookenv.atstart like the base layer does. At this point, none of the triggers are registered as none of the code in reactive/ has been discovered.

johnsca commented 5 years ago

Rather than porting https://github.com/juju-solutions/layer-basic/pull/126 here and hoping it doesn't get out of sync again, maybe we should go ahead and move forward with pulling the flags into charms.reactive.