Perform compatibility checks in the install hook/upgrade action

Bug #1418100 reported by Free Ekanayaka
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Landscape Charm
Invalid
Wishlist
Unassigned

Bug Description

The install hook/upgrade action should check if it they handle the version of the landscape-server that is going to be installed (and that comes from the repository configured with the "source" configuration option of the charm).

A way to do that would be:

- Add a CHARM.info file to the landscape-server Debian package that declares the minimum charm version required in order to install this version of the package.

- Run apt-get install with the "-d" (download only) option at first, then use gzip/ar to extract the content of the CHARM.info file from the downloaded landscape-server deb (debs are really compressed ar files) and finally check if the current charm version on the unit is greater or equal than the one advertised in the CHARM.info file of the package

If the check doesn't pass the script will fail.

tags: added: upgradable-charm
Revision history for this message
Данило Шеган (danilo) wrote :

FWIW, I believe we should use custom fields in .deb control files instead: https://www.debian.org/doc/debian-policy/ch-controlfields.html#s5.7

Using "XB-Required-Charm-Version: X" would put "Required-Charm-Version: X" in the landscape-server binary deb control file, and we'd be able to read it with something like "dpkg -f landscape-server*.deb Required-Charm-Version" (or maybe "apt-cache showpkg landscape-server", though I haven't checked that).

Revision history for this message
Данило Шеган (danilo) wrote :

We could also make it slightly more generic with something like "XB-Charm-Depends: landscape-server (>= 15)", which might make it suitable for inclusion in charmhelpers directly (and their fetch module would then check for compatibility).

Revision history for this message
Björn Tillenius (bjornt) wrote :

We talked about this on IRC. I think this is too complex to do now. For now, requiring the charm to be upgraded before upgrading the server to a new major release should be fine, in the rare case that it would be needed.

This is even so complex that it would be good to have a mini-spec for it. For example, some examples of breakages would be good to have. As well as defining what a "charm version " is and when and how to bump that version.

Changed in landscape-charm:
importance: Undecided → Wishlist
Revision history for this message
🤖 Landscape Builder (landscape-builder) wrote :

This bug has not seen any activity in the last 6 months, so it is being automatically closed.

If you are still experiencing this issue, please feel free to re-open.

Landscape Team

Changed in landscape-charm:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.