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

potiuk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/master by this push:
     new 5351f0d  Work properly if some variables are not defined (#12135)
5351f0d is described below

commit 5351f0d99605738b5efa0134bb51eb2dbb6eba46
Author: Jarek Potiuk <[email protected]>
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.
---
 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 664ed4e..67dde8c 100644
--- a/scripts/ci/libraries/_initialization.sh
+++ b/scripts/ci/libraries/_initialization.sh
@@ -748,5 +748,7 @@ function initialization::ga_output() {
 }
 
 function initialization::ga_env() {
-    echo "${1}=${2}" >> "${GITHUB_ENV}"
+    if [[ ${GITHUB_ENV=} != "" ]]; then
+        echo "${1}=${2}" >> "${GITHUB_ENV}"
+    fi
 }
diff --git a/scripts/ci/libraries/_kind.sh b/scripts/ci/libraries/_kind.sh
index ef1ce54..e81acaa 100644
--- a/scripts/ci/libraries/_kind.sh
+++ b/scripts/ci/libraries/_kind.sh
@@ -304,7 +304,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