Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
k8s-ingress
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
uplex-varnish
k8s-ingress
Commits
f4f476d7
Commit
f4f476d7
authored
Apr 24, 2020
by
Tim Leers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use curl to test port-forwarding
parent
5b635103
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
3 deletions
+28
-3
verify_cli-args.sh
examples/varnish_pod_template/verify_cli-args.sh
+14
-1
verify_proxy.sh
examples/varnish_pod_template/verify_proxy.sh
+14
-2
No files found.
examples/varnish_pod_template/verify_cli-args.sh
View file @
f4f476d7
...
...
@@ -4,6 +4,13 @@ function killforward {
kill
$KUBEPID
}
failureCode
()
{
local
code
=
${
2
:-
500
}
local
status
=
$(
curl
--head
--location
--connect-timeout
5
--write-out
%
{
http_code
}
--silent
--output
/dev/null localhost:
${
LOCALPORT
})
[[
$status
==
${
code
}
]]
||
[[
$status
==
000
]]
}
LOCALPORT
=
${
LOCALPORT
:-
8888
}
kubectl
wait
--timeout
=
2m pod
-l
app
=
varnish-ingress,example!
=
cli-args
--for
=
delete
...
...
@@ -15,5 +22,11 @@ kubectl port-forward svc/varnish-ingress ${LOCALPORT}:80 >/dev/null &
KUBEPID
=
$!
trap
killforward EXIT
sleep
1
for
((
n
=
0
;
n < 20
;
n++
))
;
do
if
[[
failureCode
]]
;
then
sleep
0.5
fi
break
done
varnishtest
${
TESTOPTS
}
-Dlocalport
=
${
LOCALPORT
}
cafe_cli-args.vtc
examples/varnish_pod_template/verify_proxy.sh
View file @
f4f476d7
#!
/bin/bash -x
#!/bin/bash -x
function
killforward
{
kill
$KUBEPID
}
failureCode
()
{
local
code
=
${
2
:-
500
}
local
status
=
$(
curl
--head
--location
--connect-timeout
5
--write-out
%
{
http_code
}
--silent
--output
/dev/null localhost:
${
LOCALPORT
})
[[
$status
==
${
code
}
]]
||
[[
$status
==
000
]]
}
LOCALPORT
=
${
LOCALPORT
:-
8888
}
kubectl
wait
--timeout
=
2m pod
-l
app
=
varnish-ingress,example!
=
proxy
--for
=
delete
...
...
@@ -15,5 +21,11 @@ kubectl port-forward svc/varnish-ingress ${LOCALPORT}:80 >/dev/null &
KUBEPID
=
$!
trap
killforward EXIT
sleep
1
for
((
n
=
0
;
n < 20
;
n++
))
;
do
if
[[
failureCode
]]
;
then
sleep
0.5
fi
break
done
varnishtest
${
TESTOPTS
}
-Dlocalport
=
${
LOCALPORT
}
cafe_proxy.vtc
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment