Juju 4.0 will remove JUJU_TARGET_SERIES environment variable from pre-series-upgrade hook

What’s changing?

Starting with Juju 4.0, Juju will no longer set the environment variable JUJU_TARGET_SERIES during pre-series-upgrade hooks.

Juju will continue to set JUJU_TARGET_BASE as usual during these hooks. JUJU_TARGET_BASE is present in all supported versions of Juju 3.

This is because the concept of an OS series is being replaced with OS bases. Series will be removed in Juju 4.0.

Why the change?

A series is an Operating System’s code name. For example, ‘focal’ and ‘jammy’ are both series. However, series do not translate well outside of the Ubuntu world and cannot be predicted ahead of time.

Bases fix this by separating an operating system into the distro name and channel, separated by an ‘@’.

For example, the series focal is equivalent to the base ubuntu@20.04. The series jammy is equivalent to the base ubuntu@22.04.

Who is this likely to affect?

Machine charms that implement the pre-series-upgrade hook AND read JUJU_TARGET_SERIES from the environment.

That is:

  • If your charm is a Kubernetes charm, you do not need to worry!

  • If your machine charm does not implement the pre-series-upgrade hook, you do not need to worry!

  • If your machine charm does implement the ‘pre-series-upgrade’ hook, but does not read JUJU_TARGET_SERIES from the environment, you do not need to worry!

What action does this require from charm authors?

To ensure their charms are ready for Juju 4.0, charmers should use the environment variable JUJU_TARGET_BASE instead of JUJU_TARGET_SERIES within their pre-series-upgrade hook.

Compatibility

Juju 2.9: Only JUJU_TARGET_SERIES is present.

Juju 3: JUJU_TARGET_BASE and JUJU_TARGET_SERIES are both present.

Juju 4: Only JUJU_TARGET_BASE will be provided.

Charms that wish to support all of Juju 2-4 should read JUJU_TARGET_BASE, and fall back to JUJU_TARGET_SERIES if it is not provided.

3 Likes