-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
hooks/install ran, but other hooks not expanded #310
Comments
The charm was updated to Operator Framework 0.6.0 at the same time as changing the Juju version to 2.8.0rc3, which might be related to this issue. |
I think this is just a bug in 0.6.0. We landed code to support "dispatch" but it was slightly incorrect.
That means we think we are being invoked via 'dispatch' and looking to see if there is a hooks/* that needs to be executed. However, the check we are doing for it is:
Which in Juju 2.8 if you create 'hooks/install => ../src/charm.py', then JUJU_DISPATCH_PATH will be set, but we aren't being called from dispatch, so we need to create the other symlinks. (the code that sets up the symlinks is in the call to:
but that has:
The issue is that 2.8 is dispatch aware, but was not invoked via dispatch. |
On possible check we could do instead is
Or another possibility is
|
I think the trick is that we need both checks. "if dispatch exists but JUJU_DISPATCH_PATH" doesn't, then we need to create the symlinks (juju2.8 invoked via hooks/install). But if JUJU_DISPATCH_PATH isn't set and dispatch does exist we also need to create the symlinks (juju 2.7 with a charm that would like to use dispatch if possible.) So
|
This avoids the situation where Juju is dispatch-aware but the charm is not resulting in no symlinks getting created. fixes: canonical#310
@jameinel I agree with your analysis, and I've implemented that change -- having first written failing tests for it :-) |
This avoids the situation where Juju is dispatch-aware but the charm is not resulting in no symlinks getting created. fixes: #310
I have a charm using the Operator framework, working fine with Juju 2.7. It contains just hooks/install to bootstrap things:
When deployed, logs show the install hook is called and by on_install handler invoked. However, as seen above no other hooks were created by the Operator framework. Juju ran the config-changed hook, but it of course did nothing.
The text was updated successfully, but these errors were encountered: