~dparv/charm-haproxy/add_nrpe_ssl_certificate_check

Viewing all changes in revision 149.

  • Committer: mergebot at canonical
  • Author(s): "Simon Fels"
  • Date: 2021-11-05 10:53:18 UTC
  • mfrom: (148.1.1 charm-haproxy)
  • Revision ID: mergebot@juju-139df4-prod-is-toolbox-0.canonical.com-20211105105318-wgi62vzl8ddyvuhq
Convert port to integer to allow comparison

The update_service_ports method compares ports from both supplied lists. One list is coming from get_service_ports which keeps ports as integer and the other one from config_changed which keeps them as utf8 strings. Comparing ports will now fail inside update_service_ports as we compare integers vs strings.

With Juju 2.9 this leads to ports randomly being opened as semantics on
open-port/close-port have slightly changed.

We saw ports being never opened after initial deployment in a 2.9 model with the services config option set. Only after remove-relation/relate we were able to get the ports correctly exposed.

Fixing the port comparison resolves this and makes things work on both Juju 2.8 and 2.9

Reviewed-on: https://code.launchpad.net/~morphis/charm-haproxy/fix-port-comparison/+merge/411405
Reviewed-by: Tom Haddon <tom.haddon@canonical.com>

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: