Skip to content

Commit

Permalink
Add quotes around variables
Browse files Browse the repository at this point in the history
Change-Id: Ic68b36004ed726b62f8733cf7c94ab620baa0a2e
  • Loading branch information
fredg02 committed Jun 13, 2022
1 parent fcde85f commit 46c1779
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions infoCenter/k8s/createInfoCenter_yaml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fi
create_license_header() {
local file="${1:-}"
local year="2021"
cat <<EOF > ${file}
cat <<EOF > "${file}"
#*******************************************************************************
# Copyright (c) ${year} Eclipse Foundation and others.
# This program and the accompanying materials are made available
Expand All @@ -52,7 +52,7 @@ create_route () {
local host_name="${3:-}"
local file_name="${release_name}/route.yml"
create_license_header "${file_name}"
cat <<EOF >> ${file_name}
cat <<EOF >> "${file_name}"
apiVersion: "route.openshift.io/v1"
kind: "Route"
metadata:
Expand Down Expand Up @@ -83,7 +83,7 @@ create_service () {
local namespace_name="${2:-}"
local file_name="${release_name}/service.yml"
create_license_header "${file_name}"
cat <<EOF >> ${file_name}
cat <<EOF >> "${file_name}"
apiVersion: "v1"
kind: "Service"
metadata:
Expand Down Expand Up @@ -113,7 +113,7 @@ create_deployment () {
echo "Image name: ${infocenter_image}"

create_license_header "${file_name}"
cat <<EOF >> ${file_name}
cat <<EOF >> "${file_name}"
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down
2 changes: 1 addition & 1 deletion infoCenter/k8s/deployInfoCenter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ set -o nounset
set -o pipefail

# Parameters:
release_name=${1:-}
release_name="${1:-}"

# Verify inputs
if [[ -z "${release_name}" ]]; then
Expand Down
12 changes: 6 additions & 6 deletions infoCenter/k8s/removeInfoCenter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ set -o nounset
set -o pipefail

# Parameters:
release_name=${1:-}
release_name="${1:-}"
namespace="infocenter"

# Verify inputs
Expand All @@ -24,15 +24,15 @@ if [[ -z "${release_name}" ]]; then
exit 1
fi

oc scale deployment infocenter-${release_name} -n="${namespace}" --replicas=0
oc delete deployment infocenter-${release_name} -n "${namespace}"
oc delete service infocenter-${release_name} -n "${namespace}"
oc delete route infocenter-${release_name} -n "${namespace}"
oc scale deployment "infocenter-${release_name}" -n="${namespace}" --replicas=0
oc delete deployment "infocenter-${release_name}" -n "${namespace}"
oc delete service "infocenter-${release_name}" -n "${namespace}"
oc delete route "infocenter-${release_name}" -n "${namespace}"

remove_question() {
read -p "Do you want to remove the folder for ${release_name}? (Y)es, (N)o, E(x)it: " yn
case $yn in
[Yy]* ) rm -rf ${release_name};;
[Yy]* ) rm -rf "${release_name}";;
[Nn]* ) exit 0;;
[Xx]* ) exit 0;;
* ) echo "Please answer (Y)es, (N)o, E(x)it"; question;
Expand Down

0 comments on commit 46c1779

Please sign in to comment.