Add Ingress host, path and annotations support (#1325)
For each ingress controller, the format of ingress host,
path and annotations are different. To support different
kinds of controller, this PR adds new ingress config field
to http trigger spec. A user can set annotations, host and
path based on the type of underlying ingress controller
with CLI.
Command example:
fission route create --name foo \
--url /foo/{bar} --function foofn --createingress \
--ingressannotation "nginx.ingress.kubernetes.io/ssl-redirect=false" \
--ingressannotation "nginx.ingress.kubernetes.io/use-regex=true" \
--ingressrule "*=/foo/*"
This commit is contained in:
+18
-2
@@ -44,9 +44,25 @@ clean_resource_by_id() {
|
||||
}
|
||||
|
||||
test_fn() {
|
||||
url="http://$FISSION_ROUTER/$1"
|
||||
expect=$2
|
||||
test_response $url $expect
|
||||
}
|
||||
export -f test_fn
|
||||
|
||||
test_ingress() {
|
||||
url="http://$INGRESS_CONTROLLER/$1"
|
||||
expect=$2
|
||||
|
||||
echo $url
|
||||
test_response $url $expect
|
||||
}
|
||||
export -f test_ingress
|
||||
|
||||
test_response() {
|
||||
# Doing an HTTP GET on the function's route
|
||||
# Checking for valid response
|
||||
url="http://$FISSION_ROUTER/$1"
|
||||
url=$1
|
||||
expect=$2
|
||||
|
||||
set +e
|
||||
@@ -69,7 +85,7 @@ test_fn() {
|
||||
done
|
||||
set -e
|
||||
}
|
||||
export -f test_fn
|
||||
export -f test_response
|
||||
|
||||
test_post_route() {
|
||||
# Doing an HTTP POST on the function's route
|
||||
|
||||
Reference in New Issue
Block a user