Skip to content

Commit 17b6a77

Browse files
committed
BATS: Fix lint issues
Signed-off-by: Mark Yen <[email protected]>
1 parent 3290894 commit 17b6a77

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

bats/tests/helpers/utils.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ capture_logs() {
388388
cp -LR "${PATH_LOGS}/" "$logdir"
389389
echo "${BATS_TEST_DESCRIPTION:-teardown}" >"${logdir}/test_description"
390390
# Capture settings.json
391-
if [[ -f "$PATH_CONFIG_FILE" ]]; then
391+
if [[ -f $PATH_CONFIG_FILE ]]; then
392392
cp "$PATH_CONFIG_FILE" "$logdir"
393393
fi
394394
foreach_profile export_profile "$logdir"

bats/tests/k8s/helm-install-rancher.bats

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -204,17 +204,17 @@ deploy_rancher() {
204204
try --max 60 --delay 10 kubectl get namespace cattle-system
205205

206206
try --max 60 --delay 10 kubectl get deployment --namespace cattle-fleet-system fleet-controller
207-
try assert_kube_deployment_available --namespace cattle-fleet-system gitjob
208-
try assert_kube_deployment_available --namespace cattle-fleet-system fleet-controller
207+
try assert_kube_deployment_available --namespace cattle-fleet-system gitjob
208+
try assert_kube_deployment_available --namespace cattle-fleet-system fleet-controller
209209

210210
try --max 120 --delay 10 assert_not_empty_list kubectl get pods --namespace cattle-system --selector app=rancher-webhook --output jsonpath='{.items}'
211211

212212
# Unfortunately, the webhook pod might restart too :(
213213
try wait_for_webhook_pod
214214

215-
try --max 60 --delay 10 assert_kube_deployment_available --namespace cattle-system rancher
216-
try --max 60 --delay 10 assert_kube_deployment_available --namespace cattle-fleet-local-system fleet-agent
217-
try --max 120 --delay 10 assert_kube_deployment_available --namespace cattle-system rancher-webhook
215+
try --max 60 --delay 10 assert_kube_deployment_available --namespace cattle-system rancher
216+
try --max 60 --delay 10 assert_kube_deployment_available --namespace cattle-fleet-local-system fleet-agent
217+
try --max 120 --delay 10 assert_kube_deployment_available --namespace cattle-system rancher-webhook
218218

219219
# The rancher pod sometimes falls over on its own; retry in a loop
220220
local i
@@ -231,16 +231,16 @@ verify_rancher() {
231231
fi
232232

233233
# Get k3s logs if possible before things fail
234-
kubectl get deployments --all-namespaces ||:
235-
kubectl get pods --all-namespaces ||:
234+
kubectl get deployments --all-namespaces || :
235+
kubectl get pods --all-namespaces || :
236236
local name
237237
name="$(kubectl get pod -n cattle-system --selector app=rancher --output=jsonpath='{.items[].metadata.name}' || echo '')"
238-
if [[ -n "$name" ]]; then
239-
kubectl logs -n cattle-system "$name" ||:
238+
if [[ -n $name ]]; then
239+
kubectl logs -n cattle-system "$name" || :
240240
fi
241241
name="$(kubectl get pod -n cattle-system --selector app=rancher-webhook --output=jsonpath='{.items[].metadata.name}' || echo '')"
242-
if [[ -n "$name" ]]; then
243-
kubectl logs -n cattle-system "$name" ||:
242+
if [[ -n $name ]]; then
243+
kubectl logs -n cattle-system "$name" || :
244244
fi
245245

246246
local host
@@ -254,7 +254,6 @@ verify_rancher() {
254254
assert_output --partial "bootstrapPassword"
255255
}
256256

257-
258257
@test 'add helm repo' {
259258
helm repo add jetstack https://charts.jetstack.io
260259
helm repo add rancher-latest https://releases.rancher.com/server-charts/latest

0 commit comments

Comments
 (0)