-
Notifications
You must be signed in to change notification settings - Fork 73
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
Event charm.py not defined #21
Comments
This looks like the code to interact with 2.7 isn't quite working
correctly. It seems to be trying to invoke src/charm.py directly, rather
than via a symlink, so sys.argv[0] is charm.py not 'hooks/install'. And then
```
def _set_name_from_path(self, path: Path):
"""Sets the name attribute to that which can be inferred from the
given path."""
name = path.name.replace('-', '_')
if path.parent.name == 'actions':
name = '{}_action'.format(name)
self.event_name = name
```
Is then determining the name of the event is 'charm.py'
…On Mon, Jun 1, 2020 at 8:44 PM Kenneth Koski ***@***.***> wrote:
I have written a charm using charmcraft, found here:
https://github.com/juju-solutions/bundle-kubeflow/tree/admission-webhook-charm/charms/admission-webhook
I am deploying it like this:
charmcraft build
juju deploy ./admission-webhook.charm --resource oci-image=gcr.io/kubeflow-images-public/admission-webhook:vmaster-gaf96e4e3
This is with charmcraft 0.1.0 installed via pypi.org and juju 2.7.6.
After deployment, the charm stays in unknown status, and I get this
message from juju debug-log:
application-admission-webhook: 11:04:06 DEBUG unit.admission-webhook/6.juju-log Event charm.py not defined for <__main__.AdmissionWebhookCharm object at 0x7f5a3790ec18>.
I'm not sure how I'm getting an event of that name.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#21>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABRQ7PXWQGIIC5HA6HLO6LRUPLFPANCNFSM4NP653JQ>
.
|
We talked through what is happening. The issue is that 'hooks/install' is a copy of 'dispatch', which is doing an 'exec src/charm.py' to trigger the charm main. However, that sets sys.argv[0] to 'src/charm.py' rather than being 'hooks/install'.
That way if Juju is 2.8+ and is setting JUJU_DISPATCH_PATH then we just use it. |
this is part of 0.1.2 (which is the same as 0.1.1 for silly reasons), already in pypi. |
I have written a charm using charmcraft, found here:
https://github.com/juju-solutions/bundle-kubeflow/tree/admission-webhook-charm/charms/admission-webhook
I am deploying it like this:
This is with charmcraft 0.1.0 installed via pypi.org and juju 2.7.6. After deployment, the charm stays in
unknown
status, and I get this message fromjuju debug-log
:I'm not sure how I'm getting an event of that name.
The text was updated successfully, but these errors were encountered: