This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch v1-10-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 38d55820057aa4ae9f3750a819435b2193406e6e
Author: Jarek Potiuk <jarek.pot...@polidea.com>
AuthorDate: Fri Nov 6 16:56:43 2020 +0100

    Work properly if some variables are not defined (#12135)
    
    Those variables are defined in GitHub environment so when they
    were recently addded it was not obvious that they will fail when
    running kubernetes tests locally.
    
    This PR fixes that.
    
    (cherry picked from commit 5351f0d99605738b5efa0134bb51eb2dbb6eba46)
---
 scripts/ci/libraries/_initialization.sh | 4 +++-
 scripts/ci/libraries/_kind.sh           | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/scripts/ci/libraries/_initialization.sh 
b/scripts/ci/libraries/_initialization.sh
index 316a92c..e0b4a8a 100644
--- a/scripts/ci/libraries/_initialization.sh
+++ b/scripts/ci/libraries/_initialization.sh
@@ -771,7 +771,9 @@ function initialization::ga_output() {
 }
 
 function initialization::ga_env() {
-    echo "${1}=${2}" >> "${GITHUB_ENV}"
+    if [[ ${GITHUB_ENV=} != "" ]]; then
+        echo "${1}=${2}" >> "${GITHUB_ENV}"
+    fi
 }
 
 function initialization::set_mysql_encoding() {
diff --git a/scripts/ci/libraries/_kind.sh b/scripts/ci/libraries/_kind.sh
index 451c370..41048fc 100644
--- a/scripts/ci/libraries/_kind.sh
+++ b/scripts/ci/libraries/_kind.sh
@@ -302,7 +302,7 @@ function kind::forward_port_to_kind_webserver() {
         echo
         echo "Trying to establish port forwarding to 'airflow webserver'"
         echo
-        if [[ ${INCREASE_PORT_NUMBER_FOR_KUBERNETES} == "true" ]] ; then
+        if [[ ${INCREASE_PORT_NUMBER_FOR_KUBERNETES=} == "true" ]] ; then
             forwarded_port_number=$(( forwarded_port_number + 1 ))
         fi
         if [[ ${num_tries} == "${MAX_NUM_TRIES_FOR_PORT_FORWARD}" ]]; then

Reply via email to