Skip to content

Commit 692c53d

Browse files
committed
devtool: stop asking for user confirmation on container pull
Whenever devtool notices that its container is not cached locally, it requests user input to confirm the new devctr version should indeed be downloaded. In practice, I do not remember ever saying "no" here. On the other hand, forgetting to explicitly disable these confirmations in buildkite pipelines has lead to a myriad of "stuck pipeline" issues. Thus, remove this confirmation step altogether, as it does more harm than good. To avoid having to fix all pipelines that do pass `-y` today, simply treat the `-y` parameter as a no-op (suggested by Pablo, thanks!). We cannot remove get_user_confirmation altogether, as its also used by some of the release scripts, and there it seems like a valid usecase (but these scripts we never run in buildkite). Signed-off-by: Patrick Roy <[email protected]>
1 parent f304682 commit 692c53d

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

tools/devtool

+2-6
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,6 @@ PRIV_KEY_PATH=/root/.ssh/id_rsa
127127
# Path to the linux kernel directory, as bind-mounted in the container.
128128
CTR_KERNEL_DIR="${CTR_FC_ROOT_DIR}/.kernel"
129129

130-
# Global options received by $0
131-
# These options are not command-specific, so we store them as global vars
132-
OPT_UNATTENDED=false
133-
134130
# Get the target prefix to avoid repeated calls to uname -m
135131
TARGET_PREFIX="$(uname -m)-unknown-linux-"
136132

@@ -195,7 +191,6 @@ ensure_devctr() {
195191
# download it, if we don't.
196192
[[ $(docker images -q "$DEVCTR_IMAGE" | wc -l) -gt 0 ]] || {
197193
say "About to pull docker image $DEVCTR_IMAGE"
198-
get_user_confirmation || die "Aborted."
199194

200195
# Run docker pull 5 times in case it fails - sleep 3 seconds
201196
# between attempts
@@ -1235,7 +1230,8 @@ main() {
12351230
while [ $# -gt 0 ]; do
12361231
case "$1" in
12371232
-h|--help) { cmd_help; exit 1; } ;;
1238-
-y|--unattended) { OPT_UNATTENDED=true; } ;;
1233+
-y|--unattended) # purposefully ignored
1234+
;;
12391235
-*)
12401236
die "Unknown arg: $1. Please use \`$0 help\` for help."
12411237
;;

tools/functions

-5
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,7 @@ function SGR {
7171
# exit code 0 for successful confirmation
7272
# exit code != 0 if the user declined
7373
#
74-
OPT_UNATTENDED=false
7574
get_user_confirmation() {
76-
77-
# Pass if running unattended
78-
[[ "$OPT_UNATTENDED" = true ]] && return 0
79-
8075
# Fail if STDIN is not a terminal (there's no user to confirm anything)
8176
[[ -t 0 ]] || return 1
8277

0 commit comments

Comments
 (0)