Skip to content

Commit

Permalink
fix reviewdog warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
houshengbo committed Apr 28, 2023
1 parent f1fc3ea commit 50b012e
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions test/e2e-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export INGRESS_CLASS=${INGRESS_CLASS:-istio.ingress.networking.knative.dev}
GENERATE_SERVING_YAML=0

readonly OPERATOR_DIR="$(dirname "${BASH_SOURCE[0]}")/.."
readonly KNATIVE_DIR=$(dirname ${OPERATOR_DIR})
readonly KNATIVE_DIR=$(dirname "${OPERATOR_DIR}")
release_yaml="$(mktemp)"
release_eventing_yaml="$(mktemp)"

Expand All @@ -62,10 +62,10 @@ function add_trap() {
local cmd=$1
shift
for trap_signal in $@; do
local current_trap="$(trap -p $trap_signal | cut -d\' -f2)"
local current_trap="$(trap -p "$trap_signal" | cut -d\' -f2)"
local new_cmd="($cmd)"
[[ -n "${current_trap}" ]] && new_cmd="${current_trap};${new_cmd}"
trap -- "${new_cmd}" $trap_signal
trap -- "${new_cmd}" "$trap_signal"
done
}

Expand All @@ -80,7 +80,7 @@ function test_setup_logging() {
fi

# Capture all logs.
kail > ${ARTIFACTS}/k8s.log-$(basename ${E2E_SCRIPT}).txt &
kail > "${ARTIFACTS}"/k8s.log-$(basename "${E2E_SCRIPT}").txt &
local kail_pid=$!
# Clean up kail so it doesn't interfere with job shutting down
add_trap "kill $kail_pid || true" EXIT
Expand All @@ -102,30 +102,30 @@ function download_knative() {
component_repo=$1
component_name=$2
# Go the directory to download the source code of knative
cd ${KNATIVE_DIR}
cd "${KNATIVE_DIR}" || exit
# Download the source code of knative
git clone "https://github.com/${component_repo}.git" "${component_name}"
cd "${component_name}"
cd "${component_name}" || exit
local branch=$3
if [ -n "${branch}" ] ; then
git fetch origin ${branch}:${branch}
git checkout ${branch}
git fetch origin "${branch}":"${branch}"
git checkout "${branch}"
fi
cd ${OPERATOR_DIR}
cd "${OPERATOR_DIR}" || exit
}

# Install Istio.
function install_istio() {
echo ">> Installing Istio"
curl -sL https://istio.io/downloadIstioctl | sh -
$HOME/.istioctl/bin/istioctl install -y
"$HOME"/.istioctl/bin/istioctl install -y
}

function create_namespace() {
echo ">> Creating test namespaces for knative serving and eventing"
# All the custom resources and Knative Serving resources are created under this TEST_NAMESPACE.
kubectl get ns ${TEST_NAMESPACE} || kubectl create namespace ${TEST_NAMESPACE}
kubectl get ns ${TEST_EVENTING_NAMESPACE} || kubectl create namespace ${TEST_EVENTING_NAMESPACE}
kubectl get ns "${TEST_NAMESPACE}" || kubectl create namespace "${TEST_NAMESPACE}"
kubectl get ns "${TEST_EVENTING_NAMESPACE}" || kubectl create namespace "${TEST_EVENTING_NAMESPACE}"
}

function download_latest_release() {
Expand Down

0 comments on commit 50b012e

Please sign in to comment.