From ce8432204313a1923b81bfae536544d6340d6ada Mon Sep 17 00:00:00 2001 From: Sayan Chowdhury Date: Mon, 14 Dec 2020 18:54:10 +0530 Subject: [PATCH] dev_container_util.sh: Use the shflags group instead of the default flag The build_image script invokes the create_dev_container function, and passes the `FLAGS_group` as param. Use the param, to generate the binhost URL instead of using the DEFAULT_GROUP which stays as developer always. Fixes: kinvolk/Flatcar#298 Signed-off-by: Sayan Chowdhury --- build_library/dev_container_util.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/build_library/dev_container_util.sh b/build_library/dev_container_util.sh index b4bba72d3df..22bdd926add 100755 --- a/build_library/dev_container_util.sh +++ b/build_library/dev_container_util.sh @@ -3,10 +3,12 @@ # found in the LICENSE file. get_binhost_url() { - if [ "${DEFAULT_GROUP}" == "developer" ]; then - echo "https://storage.googleapis.com/flatcar-jenkins/${DEFAULT_GROUP}/boards/${BOARD}/${FLATCAR_VERSION}/$1" + local image_group=$1 + local image_path=$2 + if [ "${image_group}" == "developer" ]; then + echo "https://storage.googleapis.com/flatcar-jenkins/${image_group}/boards/${BOARD}/${FLATCAR_VERSION}/${image_path}" else - echo "https://storage.googleapis.com/flatcar-jenkins/boards/${BOARD}/${FLATCAR_VERSION_ID}/$1" + echo "https://storage.googleapis.com/flatcar-jenkins/boards/${BOARD}/${FLATCAR_VERSION_ID}/${image_path}" fi } @@ -33,8 +35,8 @@ PKGDIR="/var/lib/portage/pkgs" PORT_LOGDIR="/var/log/portage" PORTDIR="/var/lib/portage/portage-stable" PORTDIR_OVERLAY="/var/lib/portage/coreos-overlay" -PORTAGE_BINHOST="$(get_binhost_url 'pkgs') -$(get_binhost_url 'toolchain')" +PORTAGE_BINHOST="$(get_binhost_url $2 'pkgs') +$(get_binhost_url $2 'toolchain')" EOF sudo_clobber "$1/etc/portage/repos.conf/coreos.conf" <