Skip to content

Commit 57d0fbc

Browse files
authored
Fix shellcheck errors (#219)
1 parent 91c68a4 commit 57d0fbc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+144
-47
lines changed

.github/workflows/pre-main.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
---
12
name: Test Incoming Changes
2-
3-
on:
3+
'on':
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
pull_request:
7-
branches: [ main ]
7+
branches: [main]
88
workflow_dispatch:
99

1010
jobs:
@@ -33,8 +33,6 @@ jobs:
3333
runs-on: ubuntu-22.04
3434
steps:
3535
- uses: actions/checkout@v3
36-
- name: Run ShellCheck
37-
uses: ludeeus/action-shellcheck@master
36+
- uses: ludeeus/action-shellcheck@master
3837
with:
39-
scandir: './scripts'
40-
severity: error
38+
ignore_names: mo

config/vagrant/scripts/bootstrap-cluster.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
# shellcheck disable=SC2207
23

34
# Download and install Kubernetes In Docker (Kind):
45
sudo curl -Lo /usr/bin/kind https://github.com/kubernetes-sigs/kind/releases/download/v0.14.0/kind-linux-amd64
@@ -13,12 +14,12 @@ OPENSHIFT_VERSION=${SORTED_VERSIONS[${#SORTED_VERSIONS[@]} - 1]}
1314
OC_BIN_TAR="openshift-client-linux.tar.gz"
1415
OC_DL_URL="https://mirror.openshift.com/pub/openshift-v4/clients/ocp"/${OPENSHIFT_VERSION}/${OC_BIN_TAR}
1516

16-
curl -Lo oc.tar.gz ${OC_DL_URL}
17+
curl -Lo oc.tar.gz "${OC_DL_URL}"
1718
tar -xvf oc.tar.gz
1819
chmod +x oc kubectl
1920
sudo cp oc kubectl /usr/bin/.
2021

2122
# create cluster
22-
cd partner
23+
cd partner || exit 1
2324
make rebuild-cluster
24-
make install
25+
make install

config/vagrant/scripts/bootstrap-docker.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
dnf update -y
33
echo "192.168.56.10 k8shost" >> /etc/hosts
4-
4+
55
# Adding docker repository
66
sudo dnf config-manager \
77
--add-repo \
@@ -65,7 +65,7 @@ sudo systemctl enable containerd.service
6565

6666
# Perform the post install ( https://docs.docker.com/engine/install/linux-postinstall )
6767
sudo groupadd docker
68-
sudo usermod -aG docker $USER
68+
sudo usermod -aG docker "$USER"
6969

7070
# ensures docker is running
7171
#STATE=""

scripts/clean-all.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
# Initialization
44
SCRIPT_DIR=$(dirname "$0")
5+
6+
# shellcheck disable=SC1091 # Not following.
57
source "$SCRIPT_DIR"/init-env.sh
68

79
# Delete debug pods

scripts/clean.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
# Initialization
44
SCRIPT_DIR=$(dirname "$0")
5+
6+
# shellcheck disable=SC1091 # Not following.
57
source "$SCRIPT_DIR"/init-env.sh
68

79
# Delete tnf, partner and operator and litmus

scripts/configure-docker.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
# Initialization
44
SCRIPT_DIR=$(dirname "$0")
5+
6+
# shellcheck disable=SC1091 # Not following.
57
source "$SCRIPT_DIR"/init-env.sh
68

79
# update docker config

scripts/create-local-registry.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
#!/usr/bin/env bash
22
# TODO: needs refactoring to work with kind
33
# Initialization
4+
# shellcheck disable=SC1001,SC2215
45
SCRIPT_DIR=$(dirname "$0")
6+
7+
# shellcheck disable=SC1091 # Not following.
58
source "$SCRIPT_DIR"/init-env.sh
69

710
#setting sudo
@@ -42,12 +45,13 @@ sudo $CERT_UPDATER
4245

4346

4447
# Add the hostname to /etc/hosts
45-
if [ -z $( grep "$REGISTRY_NAME" /etc/hosts) ]
48+
# shellcheck disable=SC2143 # Use grep -q.
49+
if [ -z "$( grep "$REGISTRY_NAME" /etc/hosts)" ]
4650
then
4751
REGISTRY_ADDRESS=$(hostname -I|awk '{print $1}')
4852
echo REGISTRY_ADDRESS= "$REGISTRY_ADDRESS"
4953
sudo REGISTRY_ADDRESS1="$REGISTRY_ADDRESS" REGISTRY1="$REGISTRY_NAME" sh -c 'echo "$REGISTRY_ADDRESS1 $REGISTRY1" >> /etc/hosts'
50-
else
54+
else
5155
echo "entry already present"
5256
fi
5357
cat /etc/hosts
@@ -65,7 +69,7 @@ ${CONTAINER_CLIENT} rm -f registry
6569

6670
# Create the docker registry
6771
${CONTAINER_CLIENT} run -d \Linux
68-
-v $(pwd)/"$SCRIPT_DIR"/certs:/certs:Z \
72+
-v "$(pwd)"/"$SCRIPT_DIR"/certs:/certs:Z \
6973
-e REGISTRY_HTTP_ADDR=0.0.0.0:443 \
7074
-e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/registry.crt \
7175
-e REGISTRY_HTTP_TLS_KEY=/certs/registry.key \

scripts/create-operator-bundle.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
# Initialization
44
SCRIPT_DIR=$(dirname "$0")
5+
6+
# shellcheck disable=SC1091 # Not following.
57
source "$SCRIPT_DIR"/init-env.sh
68

79
# Login to the registry

scripts/create-redhat-registry-secrets.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
# Initialization
44
SCRIPT_DIR=$(dirname "$0")
5+
6+
# shellcheck disable=SC1091 # Not following.
57
source "$SCRIPT_DIR"/init-env.sh
68

79
oc create secret docker-registry redhat-registry-secret \

scripts/create-secret.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
# Initialization
44
SCRIPT_DIR=$(dirname "$0")
5+
6+
# shellcheck disable=SC1091 # Not following.
57
source "$SCRIPT_DIR"/init-env.sh
68

79
#check pem file exists, create a secret with it if present

0 commit comments

Comments
 (0)