From commits-return-87465-archive-asf-public=cust-asf.ponee.io@airflow.apache.org Tue Jan 7 13:53:48 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id AD658180643 for ; Tue, 7 Jan 2020 14:53:47 +0100 (CET) Received: (qmail 55653 invoked by uid 500); 7 Jan 2020 13:53:36 -0000 Mailing-List: contact commits-help@airflow.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airflow.apache.org Delivered-To: mailing list commits@airflow.apache.org Received: (qmail 55605 invoked by uid 99); 7 Jan 2020 13:53:36 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Jan 2020 13:53:36 +0000 From: GitBox To: commits@airflow.apache.org Subject: [GitHub] [airflow] mik-laj commented on a change in pull request #7084: [AIRFLOW-6491] improve parameter handling in breeze Message-ID: <157840521627.9228.10001630445528995486.gitbox@gitbox.apache.org> References: In-Reply-To: Date: Tue, 07 Jan 2020 13:53:36 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit mik-laj commented on a change in pull request #7084: [AIRFLOW-6491] improve parameter handling in breeze URL: https://github.com/apache/airflow/pull/7084#discussion_r363756946 ########## File path: scripts/ci/_utils.sh ########## @@ -942,3 +942,38 @@ function build_image_on_ci() { unset AIRFLOW_CONTAINER_FORCE_PULL_IMAGES unset FORCE_BUILD } + +function read_from_file { + cat "${BUILD_CACHE_DIR}/.$1" 2>/dev/null || true +} + +function save_to_file { + # shellcheck disable=SC2005 + echo "$(eval echo "\$$1")" > "${BUILD_CACHE_DIR}/.$1" +} + +function check_for_allowed_params { + _VARIABLE_NAME="${1}" + _VARIABLE_DESCRIPTIVE_NAME="${2}" + _FLAG="${3}" + _ALLOWED_VALUES_ENV_NAME="_BREEZE_ALLOWED_${_VARIABLE_NAME}S" + _ALLOWED_VALUES=${!_ALLOWED_VALUES_ENV_NAME} + _VALUE=${!_VARIABLE_NAME} + if [[ ${_ALLOWED_VALUES:=} != *" ${_VALUE} "* ]]; then + echo >&2 + echo >&2 "ERROR: Allowed ${_VARIABLE_DESCRIPTIVE_NAME}: [${_ALLOWED_VALUES}]. Is: '${!_VARIABLE_NAME}'." + echo >&2 + echo >&2 "Switch to supported Kubernetes version with ${_FLAG} flag." Review comment: Is this message correct? I think we don't just use this for Kubernetes. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services