Skip to content

Commit 0a206fd

Browse files
committed
fix(tests): source /etc/environment only if it exists
1 parent 6656097 commit 0a206fd

4 files changed

Lines changed: 15 additions & 7 deletions

File tree

builder/image/bin/boot

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
# fail hard and fast even on pipelines
77
set -eo pipefail
88

9-
source /etc/environment_proxy
9+
if [[ -f /etc/environment_proxy ]]; then
10+
source /etc/environment_proxy
11+
fi
1012

1113
# set debug based on envvar
1214
[[ $DEBUG ]] && set -x

builder/image/bin/entry

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
#!/bin/bash
22
set -eo pipefail
33

4-
source /etc/environment_proxy
4+
if [[ -f /etc/environment_proxy ]]; then
5+
source /etc/environment_proxy
6+
fi
57

68
# START jpetazzo/dind wrapper
79

810
# First, make sure that cgroups are mounted correctly.
911
CGROUP=/sys/fs/cgroup
1012

11-
[ -d $CGROUP ] ||
13+
[ -d $CGROUP ] ||
1214
mkdir $CGROUP
1315

14-
mountpoint -q $CGROUP ||
16+
mountpoint -q $CGROUP ||
1517
mount -n -t tmpfs -o uid=0,gid=0,mode=0755 cgroup $CGROUP || {
1618
echo "Could not make a tmpfs mount. Did you use -privileged?"
1719
exit 1
@@ -29,7 +31,7 @@ fi
2931
for SUBSYS in $(cut -d: -f2 /proc/1/cgroup)
3032
do
3133
[ -d $CGROUP/$SUBSYS ] || mkdir $CGROUP/$SUBSYS
32-
mountpoint -q $CGROUP/$SUBSYS ||
34+
mountpoint -q $CGROUP/$SUBSYS ||
3335
mount -n -t cgroup -o $SUBSYS cgroup $CGROUP/$SUBSYS
3436

3537
# The two following sections address a bug which manifests itself

builder/image/slugbuilder/builder/build.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/bin/bash
22
set -eo pipefail
33

4-
source /etc/environment_proxy
4+
if [[ -f /etc/environment_proxy ]]; then
5+
source /etc/environment_proxy
6+
fi
57

68
if [[ "$1" == "-" ]]; then
79
slug_file="$1"

builder/image/slugrunner/runner/init

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/bin/bash
22
set -eo pipefail
33

4-
source /etc/environment_proxy
4+
if [[ -f /etc/environment_proxy ]]; then
5+
source /etc/environment_proxy
6+
fi
57

68
## Load slug from Bind Mount, URL or STDIN
79

0 commit comments

Comments
 (0)