Fix executor tries to create a new deployment when a function is updated (#524)

Newdeploy manager now checks the existence of function service cache by function UID before trying to create a new deployment. And return the cached fsvc directly if the cache exists.
This commit is contained in:
Ta-Ching Chen
2018-03-08 02:52:36 +08:00
committed by GitHub
parent a3826046a5
commit b4300feabc
7 changed files with 169 additions and 45 deletions
+2 -2
View File
@@ -176,7 +176,7 @@ helm_install_fission() {
helm list -q|xargs -I@ bash -c "helm_uninstall_fission @"
# deleting ns does take a while after command is issued
while `kubectl get ns| grep "fission-builder"`
while kubectl get ns| grep "fission-builder"
do
sleep 5
done
@@ -460,4 +460,4 @@ install_and_test() {
# echo "Usage: test.sh [image] [imageTag]"
# exit 1
# fi
# install_and_test $1 $2
# install_and_test $1 $2
+13 -6
View File
@@ -56,12 +56,19 @@ update_fn() {
}
test_fn() {
log "Doing an HTTP GET on the function's route"
response0=$(curl http://$FISSION_ROUTER/$1)
echo "Doing an HTTP GET on the function's route"
echo "Checking for valid response"
log "Checking for valid response"
echo $response0 | grep -i $2
while true; do
response0=$(curl http://$FISSION_ROUTER/$1)
echo $response0 | grep -i $2
if [[ $? -eq 0 ]]; then
break
fi
sleep 1
done
}
export -f test_fn
# This test only tests one path of execution: updating package and checking results of function
# There might be potential future tests where one can test changes in:
@@ -81,10 +88,10 @@ main() {
create_env $env
create_fn $fn_name $env
create_route $fn_name
test_fn $fn_name "world"
timeout 60 bash -c "test_fn $fn_name 'world'"
update_archive
update_fn $fn_name $env
test_fn $fn_name "fission"
timeout 60 bash -c "test_fn $fn_name 'fission'"
log "Update function for new deployment executor passed"
}