net-tools package missing after series-upgrade following charm upgrade

Bug #1953749 reported by Bayani Carbone
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Keepalived Charm
Fix Released
Undecided
Adam Dyess

Bug Description

After performing a series upgrade from bionic to focal, the net-tools package got removed and thus broke the post-series-upgrade hook of the keepalived charm (revision 98). Please see attached log.

The reason for this is because prior to the series upgrade a charm upgrade was performed to go from revision 28 to 98.

In revision 28, net-tools is not being installed:
@when_not('keepalived.package.installed')
def install_keepalived_package():
    ''' Install keepalived package '''
    status_set('maintenance', 'Installing keepalived')

    apt_update(fatal=True)
    apt_install('keepalived', fatal=True)

    set_flag('keepalived.package.installed')

While it is since revision 71:

@when_not('keepalived.package.installed')
def install_keepalived_package():
    ''' Install keepalived package '''
    status.maintenance('Installing keepalived')

    apt_update(fatal=True)
    apt_install(['keepalived', 'net-tools'], fatal=True)

    set_flag('keepalived.package.installed')

However, the upgrade_charm hook does not clear the flag 'keepalived.package.installed' and thus net-tools is not marked as just [installed], in my case it was set to [installed,auto-removable].

@hook('upgrade-charm')
def upgrade_charm():
    clear_flag('keepalived.started')
=> perhaps we just need to add clear_flag('keepalived.package.installed')

Tags: aubergine
Revision history for this message
Bayani Carbone (bcarbone) wrote :
description: updated
Revision history for this message
Adam Dyess (addyess) wrote :

I wouldn't suppose changing the `upgrade-charm` hook is appropriate to address a series-upgrade issue. Perhaps clearing the 'keepalived.package.installed' flag during the "post-series-upgrade" hook is more appropriate

The reactive bits are setup to only reconfigure keepalived when it's installed, but not started. This should force an apt install of keepalived and net-tools before anything reconfigure occurs.

Proposal: https://github.com/charmed-kubernetes/charm-keepalived/pull/16

Revision history for this message
Adam Dyess (addyess) wrote :

I just ran an upgrade of a keepalived unit from bionic -> focal and didn't experience the same loss of net-tools package as reported. However, the proposed patch above still seems low effort, and should ensure the net-tools package is installed after the upgrade.

Changed in charm-keepalived:
status: New → In Progress
assignee: nobody → Adam Dyess (addyess)
Changed in charm-keepalived:
status: In Progress → Fix Committed
milestone: none → 1.24
Changed in charm-keepalived:
status: Fix Committed → Fix Released
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.