-
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.
Cleanup execution environment across wrappers and entrypoints (#4147)
- Loading branch information
1 parent
1d6ea95
commit 0a02b02
Showing
42 changed files
with
198 additions
and
302 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
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,21 @@ | ||
#!/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 | ||
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 | ||
fi | ||
|
||
declare -a args="($(cat $SNAP_DATA/args/ctr))" | ||
|
||
run_with_sudo "${SNAP}/bin/ctr" "${args[@]}" "$@" |
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
Oops, something went wrong.