Shell files syntax cleanup

* add SC2001 to shellcheck skip-list
* few functions from CloudFoundryDiego application was changed -
  manual deployment test requeired

Change-Id: Ib7b223553bdfc14f7051911d7ed0e4076c6aebb0
This commit is contained in:
alexz 2016-07-25 14:46:12 +03:00 committed by Aleksey Zvyagintsev
parent 719a47fa86
commit 3f7ec09847
22 changed files with 29 additions and 29 deletions

View File

@ -11,4 +11,4 @@
# License for the specific language governing permissions and limitations
# under the License.
docker $*
docker "$@"

View File

@ -13,4 +13,4 @@
source /etc/default/docker
DOCKER_OPTS+=" --registry-mirror=$1"
echo DOCKER_OPTS=\"$DOCKER_OPTS\" > /etc/default/docker
echo "DOCKER_OPTS=${DOCKER_OPTS}" > /etc/default/docker

View File

@ -13,4 +13,4 @@
source /etc/default/docker
DOCKER_OPTS+=" --insecure-registry $1"
echo DOCKER_OPTS=\"$DOCKER_OPTS\" > /etc/default/docker
echo "DOCKER_OPTS=${DOCKER_OPTS}" > /etc/default/docker

View File

@ -1,3 +1,3 @@
#!/bin/bash
echo "Deleting Pods" >> /tmp/murano-kube.log
/opt/bin/kubectl delete pod -l $1 >> /tmp/murano-kube.log
/opt/bin/kubectl delete pod -l "$1" >> /tmp/murano-kube.log

View File

@ -1,3 +1,3 @@
#!/bin/bash
echo "Deleting a replication controller" >> /tmp/murano-kube.log
/opt/bin/kubectl delete replicationcontrollers $1 >> /tmp/murano-kube.log
/opt/bin/kubectl delete replicationcontrollers "$1" >> /tmp/murano-kube.log

View File

@ -1,3 +1,3 @@
#!/bin/bash
echo "Deleting a Service" >> /tmp/murano-kube.log
/opt/bin/kubectl delete service $1 >> /tmp/murano-kube.log
/opt/bin/kubectl delete service "$1" >> /tmp/murano-kube.log

View File

@ -1,3 +1,3 @@
#!/bin/bash
/opt/bin/kubectl get service $1 --template '{{.spec.clusterIP}}' -o template
/opt/bin/kubectl get service "$1" --template '{{.spec.clusterIP}}' -o template

View File

@ -5,7 +5,7 @@
cp -f haproxy.toml /etc/confd/conf.d/
cp -f haproxy.tmpl /etc/confd/templates/
/usr/local/bin/confd -onetime -backend etcd -node $1:4001
/usr/local/bin/confd -onetime -backend etcd -node "$1:4001"
cp -f default_scripts/haproxy /etc/default/
@ -23,4 +23,4 @@ else
service haproxy start
fi
sleep 1
sleep 1

View File

@ -9,7 +9,7 @@ echo "Adding member $1 to etcd cluster" >> /tmp/etcd.log
while [ $count -gt 0 ]; do
/opt/bin/etcdctl cluster-health >> /tmp/etcd.log
if [ $? -eq 0 ]; then
out=$((/opt/bin/etcdctl member add "$1" "http://$2:7001") 2>&1)
out=$( (/opt/bin/etcdctl member add "$1" "http://$2:7001") 2>&1)
if [ $? -ne 0 ]; then
echo "Member $1 not added. Reason: $out" >> /tmp/etcd.log
break

View File

@ -3,4 +3,4 @@
# $1 - service name
# $2 - publicIPs JSON
/opt/bin/kubectl update service $1 --patch="$2"
/opt/bin/kubectl update service "$1" --patch="$2"

View File

@ -1,4 +1,4 @@
#!/bin/bash
NODE_ID=$(/opt/bin/etcdctl member list | grep $1 | cut -d':' -f1)
/opt/bin/etcdctl member remove $NODE_ID
NODE_ID=$(/opt/bin/etcdctl member list | grep "$1" | cut -d':' -f1)
/opt/bin/etcdctl member remove "${NODE_ID}"

View File

@ -1,3 +1,3 @@
#!/bin/bash
echo "Deleting Kubernetes Node" >> /tmp/murano-kube.log
/opt/bin/kubectl delete node $1 >> /tmp/murano-kube.log
/opt/bin/kubectl delete node "$1" >> /tmp/murano-kube.log

View File

@ -4,5 +4,5 @@
CONTAINERS=$(docker ps -q --filter "name=_$1-")
if (( ${#CONTAINERS} > 0 )); then
docker restart $CONTAINERS
fi
docker restart "${CONTAINERS}"
fi

View File

@ -3,4 +3,4 @@
# $1 - RC name
# $2 - new size
/opt/bin/kubectl scale rc $1 --replicas=$2
/opt/bin/kubectl scale rc "${1}" --replicas="${2}"

View File

@ -2,4 +2,4 @@
source /etc/default/docker
DOCKER_OPTS+=" --registry-mirror=$1"
echo DOCKER_OPTS=\"$DOCKER_OPTS\" > /etc/default/docker
echo "DOCKER_OPTS=${DOCKER_OPTS}" > /etc/default/docker

View File

@ -2,4 +2,4 @@
source /etc/default/docker
DOCKER_OPTS+=" --insecure-registry $1"
echo DOCKER_OPTS=\"$DOCKER_OPTS\" > /etc/default/docker
echo "DOCKER_OPTS=${DOCKER_OPTS}" > /etc/default/docker

View File

@ -3,10 +3,10 @@ count=30
echo "Adding flannel configuration to etcd"
command=$((/opt/bin/etcdctl set /coreos.com/network/config '{"Network":"10.200.0.0/16"}') 2>&1)
command=$( (/opt/bin/etcdctl set /coreos.com/network/config '{"Network":"10.200.0.0/16"}') 2>&1)
while [ $count -gt 0 ]; do
if [ $command ]; then
if [ "${command}" ]; then
echo "Flannel is configured on master node" >> /tmp/etcd.log
exit 0
fi

View File

@ -28,7 +28,7 @@ done
ip link set dev docker0 down
brctl delbr docker0
echo DOCKER_OPTS=\"-H tcp://127.0.0.1:4243 -H unix:///var/run/docker.sock --bip=${FLANNEL_SUBNET} --mtu=${FLANNEL_MTU}\" > /etc/default/docker
echo "DOCKER_OPTS=-H tcp://127.0.0.1:4243 -H unix:///var/run/docker.sock --bip=${FLANNEL_SUBNET} --mtu=${FLANNEL_MTU}" > /etc/default/docker
echo post-up iptables -t nat -A POSTROUTING -s 10.200.0.0/16 ! -d 10.200.0.0/16 -j MASQUERADE >> /etc/network/interfaces.d/eth0.cfg
iptables -t nat -A POSTROUTING -s 10.200.0.0/16 ! -d 10.200.0.0/16 -j MASQUERADE

View File

@ -3,7 +3,7 @@
# File with pod is /tmp/pod.json
# $1 new or update
DEFINITION_DIR=/var/run/murano-kubernetes
mkdir -p $DEFINITION_DIR
mkdir -p "${DEFINITION_DIR}"
podId=$2
fileName=$3
@ -12,8 +12,8 @@ echo "$podId Pod $fileName" >> $DEFINITION_DIR/elements.list
if [ "$1" == "True" ]; then
#new Pod
echo "Creating a new Pod" >> /tmp/murano-kube.log
/opt/bin/kubectl create -f $fileName >> /tmp/murano-kube.log
/opt/bin/kubectl create -f "${fileName}" >> /tmp/murano-kube.log
else
echo "Updating a Pod" >> /tmp/murano-kube.log
/opt/bin/kubectl update -f $fileName >> /tmp/murano-kube.log
/opt/bin/kubectl update -f "${fileName}" >> /tmp/murano-kube.log
fi

View File

@ -11,8 +11,8 @@ echo "$serviceId Service $fileName" >> $DEFINITION_DIR/elements.list
if [ "$1" == "True" ]; then
echo "Creating a new Service" >> /tmp/murano-kube.log
/opt/bin/kubectl create -f $fileName >> /tmp/murano-kube.log
/opt/bin/kubectl create -f "${fileName}" >> /tmp/murano-kube.log
else
echo "Updating a Service" >> /tmp/murano-kube.log
/opt/bin/kubectl update -f $fileName >> /tmp/murano-kube.log
/opt/bin/kubectl update -f "${fileName}" >> /tmp/murano-kube.log
fi

View File

@ -12,4 +12,4 @@
# under the License.
echo "Deleting a replication controller" >> /tmp/murano-kube.log
/opt/bin/kubectl delete replicationcontrollers $1 >> /tmp/murano-kube.log
/opt/bin/kubectl delete replicationcontrollers "$1" >> /tmp/murano-kube.log

View File

@ -12,4 +12,4 @@
# under the License.
echo "Deleting a Service" >> /tmp/murano-kube.log
/opt/bin/kubectl delete services $1 >> /tmp/murano-kube.log
/opt/bin/kubectl delete services "$1" >> /tmp/murano-kube.log