From 9d54f5daacca52b5d93a499f1f3c38efc89efccf Mon Sep 17 00:00:00 2001 From: Sanket Sudake Date: Tue, 17 Aug 2021 21:55:38 +0530 Subject: [PATCH] Consider newdeploy functions only for env update in newdeploy manager (#2165) Currently when we update env, even if we dont have newdeploy related functions env is getting is getting triggered. Added filter in finding related functions to avoid this behaviour. Signed-off-by: Sanket Sudake --- pkg/executor/executortype/newdeploy/newdeploymgr.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/executor/executortype/newdeploy/newdeploymgr.go b/pkg/executor/executortype/newdeploy/newdeploymgr.go index 61179642..bc7148dc 100644 --- a/pkg/executor/executortype/newdeploy/newdeploymgr.go +++ b/pkg/executor/executortype/newdeploy/newdeploymgr.go @@ -362,7 +362,7 @@ func (deploy *NewDeploy) getEnvFunctions(m *metav1.ObjectMeta) []fv1.Function { } relatedFunctions := make([]fv1.Function, 0) for _, f := range funcList.Items { - if (f.Spec.Environment.Name == m.Name) && (f.Spec.Environment.Namespace == m.Namespace) { + if (f.Spec.Environment.Name == m.Name) && (f.Spec.Environment.Namespace == m.Namespace) && f.Spec.InvokeStrategy.ExecutionStrategy.ExecutorType == fv1.ExecutorTypeNewdeploy { relatedFunctions = append(relatedFunctions, f) } } @@ -637,7 +637,6 @@ func (deploy *NewDeploy) updateFunction(oldFn *fv1.Function, newFn *fv1.Function } func (deploy *NewDeploy) updateFuncDeployment(fn *fv1.Function, env *fv1.Environment) error { - fsvc, err := deploy.fsCache.GetByFunctionUID(fn.ObjectMeta.UID) if err != nil { err = errors.Wrapf(err, "error updating function due to unable to find function service cache: %v", fn)