Skip to content

Commit

Permalink
Enable strict confinement for the ovs exporter (#80)
Browse files Browse the repository at this point in the history
Now that the use of system-files interface has been approved and the
prometheus-ovs-exporter snap with the relevant plugs has been released
to the store, devmode usage can be disabled and additional connections
can be made.

Signed-off-by: Dmitrii Shcherbakov <[email protected]>
  • Loading branch information
dshcherb authored Oct 22, 2022
1 parent cad2e79 commit a6dd5f5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
4 changes: 2 additions & 2 deletions layer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ options:
- ['prometheus-ovs-exporter:network-observe', ':network-observe']
- ['prometheus-ovs-exporter:openvswitch', ':openvswitch']
- ['prometheus-ovs-exporter:system-observe', ':system-observe']
# - ['prometheus-ovs-exporter:etc-openvswitch', ':system-files']
# - ['prometheus-ovs-exporter:run-openvswitch', ':system-files']
- ['prometheus-ovs-exporter:etc-openvswitch', ':system-files']
- ['prometheus-ovs-exporter:run-openvswitch', ':system-files']
repo: https://github.com/openstack-charmers/charm-layer-ovn
config:
deletes:
Expand Down
6 changes: 2 additions & 4 deletions lib/charms/ovn_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1420,9 +1420,7 @@ def assess_exporter(self):
return

if is_installed:
snap.refresh('prometheus-ovs-exporter', channel=channel,
devmode=True)
snap.refresh('prometheus-ovs-exporter', channel=channel)
else:
snap.install('prometheus-ovs-exporter', channel=channel,
devmode=True)
snap.install('prometheus-ovs-exporter', channel=channel)
snap.connect_all()
6 changes: 2 additions & 4 deletions unit_tests/test_lib_charms_ovn_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1754,8 +1754,7 @@ def test_assess_exporter_fresh_install(self):

self.install.assert_called_once_with(
'prometheus-ovs-exporter',
channel='stable',
devmode=True)
channel='stable')
self.remove.assert_not_called()
self.refresh.assert_not_called()

Expand All @@ -1771,8 +1770,7 @@ def test_assess_exporter_refresh(self):

self.refresh.assert_called_once_with(
'prometheus-ovs-exporter',
channel='stable',
devmode=True)
channel='stable')
self.install.assert_not_called()
self.remove.assert_not_called()

Expand Down

0 comments on commit a6dd5f5

Please sign in to comment.