-
Notifications
You must be signed in to change notification settings - Fork 776
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add use_snap_env helper function and cleanup code
- Loading branch information
1 parent
feb939d
commit 42ff182
Showing
39 changed files
with
188 additions
and
270 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,11 @@ | ||
#!/bin/bash | ||
#!/usr/bin/env bash | ||
|
||
set -eu | ||
|
||
source $SNAP/actions/common/utils.sh | ||
|
||
export PATH="$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH" | ||
|
||
ARCH="$($SNAP/bin/uname -m)" | ||
export IN_SNAP_LD_LIBRARY_PATH="$SNAP/lib:$SNAP/usr/lib:$SNAP/lib/$ARCH-linux-gnu:$SNAP/usr/lib/$ARCH-linux-gnu" | ||
export PYTHONNOUSERSITE=false | ||
export LC_ALL="${LC_ALL:-C.UTF-8}" | ||
export LANG="${LANG:-C.UTF-8}" | ||
use_snap_env | ||
|
||
exit_if_no_permissions | ||
|
||
LD_LIBRARY_PATH=$IN_SNAP_LD_LIBRARY_PATH ${SNAP}/usr/bin/python3 ${SNAP}/scripts/wrappers/addons.py "${@}" | ||
${SNAP}/usr/bin/python3 ${SNAP}/scripts/wrappers/addons.py "${@}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,25 @@ | ||
#!/bin/bash | ||
#!/usr/bin/env bash | ||
|
||
set -eu | ||
|
||
export PATH="$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH" | ||
ARCH="$($SNAP/bin/uname -m)" | ||
export IN_SNAP_LD_LIBRARY_PATH="$SNAP/lib:$SNAP/usr/lib:$SNAP/lib/$ARCH-linux-gnu:$SNAP/usr/lib/$ARCH-linux-gnu" | ||
|
||
source $SNAP/actions/common/utils.sh | ||
|
||
SNAPSHOTTER=$(snapshotter) | ||
use_snap_env | ||
|
||
exit_if_no_permissions | ||
|
||
export CONTAINERD_SNAPSHOTTER=$(snapshotter) | ||
|
||
if ! [ -e $SNAP_DATA/args/ctr ] | ||
then | ||
echo "Arguments file $SNAP_DATA/args/ctr is missing." | ||
exit 1 | ||
fi | ||
|
||
declare -a args="($(cat $SNAP_DATA/args/ctr))" | ||
if is_strict | ||
then | ||
"${SNAP}/bin/ctr" "${args[@]}" "$@" | ||
else | ||
declare -a args="($(cat $SNAP_DATA/args/ctr))" | ||
if is_strict | ||
then | ||
LD_LIBRARY_PATH="$IN_SNAP_LD_LIBRARY_PATH" CONTAINERD_SNAPSHOTTER="$SNAPSHOTTER" "${SNAP}/bin/ctr" "${args[@]}" "$@" | ||
else | ||
sudo -E LD_LIBRARY_PATH="$IN_SNAP_LD_LIBRARY_PATH" CONTAINERD_SNAPSHOTTER="$SNAPSHOTTER" "${SNAP}/bin/ctr" "${args[@]}" "$@" | ||
fi | ||
sudo -E "${SNAP}/bin/ctr" "${args[@]}" "$@" | ||
fi |
11 changes: 3 additions & 8 deletions
11
microk8s-resources/wrappers/microk8s-dashboard-proxy.wrapper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,11 @@ | ||
#!/bin/bash | ||
#!/usr/bin/env bash | ||
set -eu | ||
|
||
ARCH="$($SNAP/bin/uname -m)" | ||
export PATH="$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH" | ||
export IN_SNAP_LD_LIBRARY_PATH="$SNAP/lib:$SNAP/usr/lib:$SNAP/lib/$ARCH-linux-gnu:$SNAP/usr/lib/$ARCH-linux-gnu" | ||
export PYTHONNOUSERSITE=false | ||
source $SNAP/actions/common/utils.sh | ||
|
||
export LC_ALL="${LC_ALL:-C.UTF-8}" | ||
export LANG="${LANG:-C.UTF-8}" | ||
use_snap_env | ||
|
||
exit_if_not_root | ||
exit_if_no_permissions | ||
|
||
LD_LIBRARY_PATH=$IN_SNAP_LD_LIBRARY_PATH ${SNAP}/usr/bin/python3 ${SNAP}/scripts/wrappers/dashboard_proxy.py | ||
${SNAP}/usr/bin/python3 ${SNAP}/scripts/wrappers/dashboard_proxy.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
#!/bin/bash | ||
#!/usr/bin/env bash | ||
|
||
set -eu | ||
|
||
export PATH="$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH" | ||
ARCH="$($SNAP/bin/uname -m)" | ||
export IN_SNAP_LD_LIBRARY_PATH="$SNAP/lib:$SNAP/usr/lib:$SNAP/lib/$ARCH-linux-gnu:$SNAP/usr/lib/$ARCH-linux-gnu" | ||
export PYTHONNOUSERSITE=false | ||
|
||
source $SNAP/actions/common/utils.sh | ||
|
||
use_snap_env | ||
|
||
exit_if_not_root | ||
|
||
exit_if_no_permissions | ||
|
||
LD_LIBRARY_PATH=$IN_SNAP_LD_LIBRARY_PATH ${SNAP}/usr/bin/python3 ${SNAP}/scripts/wrappers/dbctl.py "${@}" | ||
${SNAP}/usr/bin/python3 ${SNAP}/scripts/wrappers/dbctl.py "${@}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,11 @@ | ||
#!/bin/bash | ||
#!/usr/bin/env bash | ||
|
||
set -eu | ||
|
||
source $SNAP/actions/common/utils.sh | ||
|
||
export PATH="$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH" | ||
|
||
ARCH="$($SNAP/bin/uname -m)" | ||
export IN_SNAP_LD_LIBRARY_PATH="$SNAP/lib:$SNAP/usr/lib:$SNAP/lib/$ARCH-linux-gnu:$SNAP/usr/lib/$ARCH-linux-gnu" | ||
export PYTHONNOUSERSITE=false | ||
use_snap_env | ||
|
||
exit_if_no_permissions | ||
|
||
LD_LIBRARY_PATH=$IN_SNAP_LD_LIBRARY_PATH ${SNAP}/usr/bin/python3 ${SNAP}/scripts/wrappers/images.py "${@}" | ||
${SNAP}/usr/bin/python3 ${SNAP}/scripts/wrappers/images.py "${@}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.