Merge ~freyes/charm-nrpe:add-jammy-support into charm-nrpe:master

Proposed by Felipe Reyes
Status: Merged
Approved by: Eric Chen
Approved revision: dcbb810204c886b3418f53bd15dc2c8a5aa03ec2
Merged at revision: 12724fd22f98cd3d52a65b977d17895526784be8
Proposed branch: ~freyes/charm-nrpe:add-jammy-support
Merge into: charm-nrpe:master
Diff against target: 146 lines (+75/-3)
6 files modified
charmcraft.yaml (+4/-0)
hooks/nrpe_helpers.py (+5/-0)
metadata.yaml (+2/-1)
tests/functional/tests/bundles/jammy.yaml (+23/-0)
tests/functional/tests/tests.yaml (+5/-1)
tests/unit/test_nrpe_helpers.py (+36/-1)
Reviewer Review Type Date Requested Status
Eric Chen Approve
Corey Bryant (community) Approve
Przemyslaw Lal Approve
BootStack Reviewers Pending
Review via email: mp+425257@code.launchpad.net

Commit message

Add Jammy support.

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Unable to determine commit message from repository - please click "Set commit message" and enter the commit message manually.

Revision history for this message
Eric Chen (eric-chen) :
review: Needs Fixing
Revision history for this message
Przemyslaw Lal (przemeklal) wrote :

Apart from Eric's comment about ordering this change LGTM. Rebase might be needed since we've recently bumped the charmhelpers version in the master branch.

review: Needs Fixing
Revision history for this message
Felipe Reyes (freyes) wrote :

Hi, I just pushed a new version that addresses the feedback left.

- Rebased on top of master
- Sorted the list of series from newest to oldest

Best,

Revision history for this message
Przemyslaw Lal (przemeklal) wrote :

Thanks, LGTM

review: Approve
Revision history for this message
Corey Bryant (corey.bryant) wrote :

LGTM. This is blocking a bunch of our tests so would be nice to get this support merged.

review: Approve
Revision history for this message
Eric Chen (eric-chen) :
review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 12724fd22f98cd3d52a65b977d17895526784be8

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/charmcraft.yaml b/charmcraft.yaml
2index d45d038..bda5184 100644
3--- a/charmcraft.yaml
4+++ b/charmcraft.yaml
5@@ -23,6 +23,10 @@ bases:
6 architectures: ["amd64"]
7 run-on:
8 - name: ubuntu
9+ channel: "22.04"
10+ architectures:
11+ - amd64
12+ - name: ubuntu
13 channel: "20.04"
14 architectures:
15 - amd64
16diff --git a/hooks/nrpe_helpers.py b/hooks/nrpe_helpers.py
17index 9249905..b980912 100644
18--- a/hooks/nrpe_helpers.py
19+++ b/hooks/nrpe_helpers.py
20@@ -818,6 +818,11 @@ def get_partitions_to_check():
21 continue
22 if child.get("mountpoint", ""):
23 partitions_to_check.add(child.get("mountpoint"))
24+ # Jammy returns a list of "mountpoints" instead of a single value
25+ # in the key "mountpoint"
26+ for mountpoint in child.get("mountpoints", []):
27+ if mountpoint:
28+ partitions_to_check.add(mountpoint)
29
30 skipped_partitions = {"[SWAP]", "/boot/efi"}
31
32diff --git a/metadata.yaml b/metadata.yaml
33index e3b05f5..342168f 100644
34--- a/metadata.yaml
35+++ b/metadata.yaml
36@@ -27,6 +27,7 @@ requires:
37 interface: local-monitors
38 scope: container
39 series:
40- - bionic
41+ - jammy
42 - focal
43+ - bionic
44 - xenial
45diff --git a/tests/functional/tests/bundles/jammy.yaml b/tests/functional/tests/bundles/jammy.yaml
46new file mode 100644
47index 0000000..163b381
48--- /dev/null
49+++ b/tests/functional/tests/bundles/jammy.yaml
50@@ -0,0 +1,23 @@
51+local_overlay_enabled: true
52+series: jammy
53+applications:
54+ rabbitmq-server:
55+ charm: ch:rabbitmq-server
56+ channel: 3.9/stable
57+ num_units: 1
58+ constraints: root-disk=8G
59+ container:
60+ charm: ch:ubuntu
61+ num_units: 1
62+ to: ["lxd:rabbitmq-server/0"]
63+ nagios:
64+ charm: ch:nagios
65+ num_units: 1
66+ series: bionic
67+relations:
68+ - - rabbitmq-server:nrpe-external-master
69+ - nrpe:nrpe-external-master
70+ - - container:juju-info
71+ - nrpe:general-info
72+ - - nrpe:monitors
73+ - nagios:monitors
74diff --git a/tests/functional/tests/tests.yaml b/tests/functional/tests/tests.yaml
75index 45c660f..c281785 100644
76--- a/tests/functional/tests/tests.yaml
77+++ b/tests/functional/tests/tests.yaml
78@@ -1,5 +1,6 @@
79 charm_name: nrpe
80 gate_bundles:
81+ - jammy
82 - focal
83 - bionic
84 - xenial
85@@ -10,4 +11,7 @@ tests:
86 target_deploy_status:
87 container:
88 workload-status: active
89- workload-status-message-prefix: ""
90\ No newline at end of file
91+ workload-status-message-prefix: ""
92+tests_options:
93+ force_deploy:
94+ - jammy # https://github.com/juju-solutions/charm-ubuntu/issues/44
95diff --git a/tests/unit/test_nrpe_helpers.py b/tests/unit/test_nrpe_helpers.py
96index 96d1ae4..fa5a54f 100644
97--- a/tests/unit/test_nrpe_helpers.py
98+++ b/tests/unit/test_nrpe_helpers.py
99@@ -242,7 +242,41 @@ class TestDiskSpaceCheck(unittest.TestCase):
100 "mountpoint": "/srv/instances"
101 }
102 ]
103- }
104+ },
105+ {
106+ "name": "vda",
107+ "maj:min": "252:0",
108+ "rm": false,
109+ "size": "20G",
110+ "ro": false,
111+ "type": "disk",
112+ "mountpoints": [
113+ null
114+ ],
115+ "children": [
116+ {
117+ "name": "vda1",
118+ "maj:min": "252:1",
119+ "rm": false,
120+ "size": "19.9G",
121+ "ro": false,
122+ "type": "part",
123+ "mountpoints": [
124+ "/srv/jammy"
125+ ]
126+ },{
127+ "name": "vda14",
128+ "maj:min": "252:14",
129+ "rm": false,
130+ "size": "4M",
131+ "ro": false,
132+ "type": "part",
133+ "mountpoints": [
134+ null
135+ ]
136+ }
137+ ]
138+ }
139 ]
140 }"""
141
142@@ -254,3 +288,4 @@ class TestDiskSpaceCheck(unittest.TestCase):
143 self.assertEqual("/boot/efi" in result, False)
144 self.assertEqual("/" in result, True)
145 self.assertEqual("/srv/instances" in result, True)
146+ self.assertEqual("/srv/jammy" in result, True)

Subscribers

People subscribed via source and target branches

to all changes: