canonical / operator

Pure Python framework for writing Juju charms
Apache License 2.0
245 stars 119 forks source link

Remove legacy code that sets up event symlinks #1324

Open benhoyt opened 3 weeks ago

benhoyt commented 3 weeks ago

Per discussion with @jameinel, these haven't been needed since JUJU_DISPATCH_PATH was invented, since about Juju 2.7. Let's get rid of the code in main.py.

jameinel commented 3 weeks ago

Correct. Ops added setup event symlinks so that if it was invoked with 2.7 it would see an install hook and set up the rest of the symlinks. New versions of charmcraft are going to stop creating hooks/install, so everything will have to go via dispatch, but 2.7 has been out of support for a while.

dimaqq commented 2 weeks ago

There's also this on the code path:

# When a charm is force-upgraded and a unit is in an error state Juju
# does not run upgrade-charm and instead runs the failed hook followed
# by config-changed. Given the nature of force-upgrading the hook setup
# code is not triggered on config-changed.
#
# 'start' event is included as Juju does not fire the install event for
# K8s charms (see LP: #1854635).

The referenced ticket, https://bugs.launchpad.net/juju/+bug/1854635

Is stamped as resolved in Juju 2.7.6 and 2.8.0