Skip to content

Commit 108e7b4

Browse files
chore: wrap services url
1 parent fba0cd0 commit 108e7b4

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

.github/workflows/k8s-tests.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -108,39 +108,39 @@ jobs:
108108
echo "INFO: status:"
109109
kubectl get pods
110110
echo "INFO: logs:"
111-
kubectl logs --selector=$3 --all-containers=true
111+
kubectl logs --selector=$3 --all-containers=true
112112
exit 1
113113
fi
114114
return ${?}
115115
}
116116
echo "Waiting for init job..."
117-
to_complete "condition=Complete" job "defectdojo.org/component=initializer"
117+
to_complete "condition=Complete" job "defectdojo.org/component=initializer"
118118
echo "Waiting for celery pods..."
119-
to_complete "condition=ready" pod "defectdojo.org/component=celery"
119+
to_complete "condition=ready" pod "defectdojo.org/component=celery"
120120
echo "Waiting for django pod..."
121-
to_complete "condition=ready" pod "defectdojo.org/component=django"
121+
to_complete "condition=ready" pod "defectdojo.org/component=django"
122122
echo "Pods up and ready to rumbole"
123123
kubectl get pods
124124
RETRY=0
125125
while :
126126
do
127127
DJANGO_IP=$(kubectl get svc defectdojo-django -o jsonpath='{.spec.clusterIP}')
128-
OUT=$(kubectl run curl --quiet=true --image=curlimages/curl:7.73.0 \
128+
OUT=$(kubectl run curl --quiet=true --image=curlimages/curl:7.73.0 \
129129
--overrides='{ "apiVersion": "v1" }' \
130130
--restart=Never -i --rm -- \
131131
--silent \
132132
--max-time 20 \
133133
--head \
134134
--header "Host: $DD_HOSTNAME" \
135-
http://$DJANGO_IP/login?next=/)
135+
"http://${DJANGO_IP}/login?next=/")
136136
echo $OUT
137-
CR=`echo $OUT | egrep "^HTTP" | cut -d' ' -f2`
137+
CR=$(echo $OUT | egrep "^HTTP" | cut -d' ' -f2)
138138
echo $CR
139139
if [[ $CR -ne 200 ]]; then
140140
echo $RETRY
141141
if [[ $RETRY -gt 2 ]]; then
142142
kubectl get pods
143-
echo `kubectl logs --tail=30 -l defectdojo.org/component=django -c uwsgi`
143+
echo $(kubectl logs --tail=30 -l defectdojo.org/component=django -c uwsgi)
144144
echo "ERROR: cannot display login screen; got HTTP code $CR"
145145
exit 1
146146
else
@@ -156,7 +156,7 @@ jobs:
156156
ADMIN_PASS=$(kubectl get secret/defectdojo -o jsonpath='{.data.DD_ADMIN_PASSWORD}' | base64 -d)
157157
echo "Simple API check"
158158
DJANGO_IP=$(kubectl get svc defectdojo-django -o jsonpath='{.spec.clusterIP}')
159-
CR=$(kubectl run curl --quiet=true --image=curlimages/curl:7.73.0 \
159+
CR=$(kubectl run curl --quiet=true --image=curlimages/curl:7.73.0 \
160160
--overrides='{ "apiVersion": "v1" }' \
161161
--restart=Never -i --rm -- \
162162
--silent \
@@ -165,7 +165,7 @@ jobs:
165165
--data-raw "username=admin&password=$ADMIN_PASS" \
166166
--output /dev/null \
167167
--write-out "%{http_code}\n" \
168-
http://$DJANGO_IP/api/v2/api-token-auth/)
168+
"http://${DJANGO_IP}/api/v2/api-token-auth/")
169169
echo $CR
170170
if [[ $CR -ne 200 ]]; then
171171
echo "ERROR: login is not possible; got HTTP code $CR"
@@ -174,8 +174,8 @@ jobs:
174174
echo "Result received"
175175
fi
176176
echo "Final Check of components"
177-
errors=`kubectl get pods | grep Error | awk '{print $1}'`
178-
if [[ ! -z $errors ]]; then
177+
errors=$(kubectl get pods | grep Error | awk '{print $1}')
178+
if [[ ! -z $errors ]]; then
179179
echo "Few pods with errors"
180180
for line in $errors; do
181181
echo "Dumping log from $line"

0 commit comments

Comments
 (0)