Skip to content

Commit

Permalink
snapcraft/hooks: Update MicroOVN content interface
Browse files Browse the repository at this point in the history
Signed-off-by: Max Asnaashari <[email protected]>
  • Loading branch information
masnax committed Feb 29, 2024
1 parent 79678bc commit e015c7a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
6 changes: 3 additions & 3 deletions snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ plugs:
target: "$SNAP_DATA/microceph"
ovn-api:
interface: content
target: "$SNAP_DATA/microovn/api"
target: "$SNAP_DATA/microovn/certificates"
ovn-chassis:
interface: content
target: "$SNAP_DATA/microovn/chassis"
Expand Down Expand Up @@ -147,11 +147,11 @@ hooks:
plugs:
- lxd-support
- system-observe
connect-plug-ovn-api:
connect-plug-ovn-certificates:
plugs:
- lxd-support
- system-observe
disconnect-plug-ovn-api:
disconnect-plug-ovn-certificates:
plugs:
- lxd-support
- system-observe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,14 @@ get_bool() {
if [ -e "/etc/.lxd_generated" ]; then
ovn_builtin=$(get_bool "$(snapctl get ovn.builtin)")

if test -d /etc/ovn ; then
rm -rf /etc/ovn
fi

if ! [ "${ovn_builtin:-"false"}" = "true" ]; then
mkdir /etc/ovn
ln -snf "${SNAP_DATA}/microovn/api/client-cert.pem" /etc/ovn/cert_host
ln -snf "${SNAP_DATA}/microovn/api/client-privkey.pem" /etc/ovn/key_host
ln -snf "${SNAP_DATA}/microovn/api/cacert.pem" /etc/ovn/ovn-central.crt
ln -snf "${SNAP_DATA}/microovn/certificates/pki/client-cert.pem" /etc/ovn/cert_host
ln -snf "${SNAP_DATA}/microovn/certificates/pki/client-privkey.pem" /etc/ovn/key_host
ln -snf "${SNAP_DATA}/microovn/certificates/pki/cacert.pem" /etc/ovn/ovn-central.crt
fi
fi
2 changes: 1 addition & 1 deletion snapcraft/hooks/connect-plug-ovn-chassis
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ get_bool() {
if [ -e "/etc/.lxd_generated" ]; then
openvswitch_builtin=$(get_bool "$(snapctl get openvswitch.builtin)")
if ! [ "${openvswitch_builtin:-"false"}" = "true" ]; then
ln -snf "${SNAP_DATA}/microovn/chassis" /run/openvswitch
ln -snf "${SNAP_DATA}/microovn/chassis/switch" /run/openvswitch
fi
fi
File renamed without changes.

0 comments on commit e015c7a

Please sign in to comment.