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:
@@ -70,6 +70,11 @@ func TestFunctionServiceCache(t *testing.T) {
|
||||
fsc.Log()
|
||||
log.Panicf("Failed to get fsvc: %v", err)
|
||||
}
|
||||
f, err = fsc.GetByFunctionUID(fsvc.Function.UID)
|
||||
if err != nil {
|
||||
fsc.Log()
|
||||
log.Panicf("Failed to get fsvc by function uid: %v", err)
|
||||
}
|
||||
fsvc.Atime = f.Atime
|
||||
fsvc.Ctime = f.Ctime
|
||||
if f.Address != fsvc.Address {
|
||||
@@ -98,4 +103,10 @@ func TestFunctionServiceCache(t *testing.T) {
|
||||
fsc.Log()
|
||||
log.Panicf("found fsvc while expecting empty cache: %v", err)
|
||||
}
|
||||
|
||||
_, err = fsc.GetByFunctionUID(fsvc.Function.UID)
|
||||
if err == nil {
|
||||
fsc.Log()
|
||||
log.Panicf("found fsvc by function uid while expecting empty cache: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user