Repository: fission/fission (language: go)

Issue:
Why not transparent transmission the function annotation to the pod?
**Is your feature request related to a problem? Please describe.**
I want to set some annotations from the function to the newdeploy pod. I found the #2080, but it's not transparent transmission the function annotation to the pod. It's only for the env annotation, why?

**Describe the solution you'd like**
A clear and concise description of what you want to happen.
https://github.com/fission/fission/pull/2113/files#diff-2fdd8eb01ee685add7d9afcf63d788e25ee082afc27e7b3f05879296a3af4c51R744
I want to copy the `fnMeta.Annotations` to the newdeploy

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.



Discussion / hints:
Thank you for your first issue! ✨😊

Fix patch:
diff --git a/pkg/executor/executortype/newdeploy/newdeploymgr.go b/pkg/executor/executortype/newdeploy/newdeploymgr.go
index fc15d7ed49..df5504f776 100644
--- a/pkg/executor/executortype/newdeploy/newdeploymgr.go
+++ b/pkg/executor/executortype/newdeploy/newdeploymgr.go
@@ -455,7 +455,7 @@ func (deploy *NewDeploy) fnCreate(ctx context.Context, fn *fv1.Function) (*fscac
 
 	kubeObjRefs := []apiv1.ObjectReference{
 		{
-			//obj.TypeMeta.Kind does not work hence this, needs investigation and a fix
+			// obj.TypeMeta.Kind does not work hence this, needs investigation and a fix
 			Kind:            "deployment",
 			Name:            depl.ObjectMeta.Name,
 			APIVersion:      depl.TypeMeta.APIVersion,
@@ -747,14 +747,14 @@ func (deploy *NewDeploy) getDeployLabels(fnMeta metav1.ObjectMeta, envMeta metav
 		fv1.FUNCTION_NAMESPACE:    fnMeta.Namespace,
 		fv1.FUNCTION_UID:          string(fnMeta.UID),
 	}
-	for k, v := range envMeta.Labels {
-		deployLabels[k] = v
-	}
+	maps.MergeStringMap(deployLabels, envMeta.Labels)
+	maps.MergeStringMap(deployLabels, fnMeta.Labels)
 	return deployLabels
 }
 
 func (deploy *NewDeploy) getDeployAnnotations(fnMeta metav1.ObjectMeta, envMeta metav1.ObjectMeta) map[string]string {
 	deployAnnotations := maps.CopyStringMap(envMeta.Annotations)
+	maps.MergeStringMap(deployAnnotations, fnMeta.Annotations)
 	deployAnnotations[fv1.EXECUTOR_INSTANCEID_LABEL] = deploy.instanceID
 	deployAnnotations[fv1.FUNCTION_RESOURCE_VERSION] = fnMeta.ResourceVersion
 	return deployAnnotations
diff --git a/pkg/utils/maps/map.go b/pkg/utils/maps/map.go
index 7635d9d4d5..0cbf4d8fa3 100644
--- a/pkg/utils/maps/map.go
+++ b/pkg/utils/maps/map.go
@@ -22,3 +22,9 @@ func CopyStringMap(m map[string]string) map[string]string {
 	}
 	return n
 }
+
+func MergeStringMap(targetMap map[string]string, sourceMap map[string]string) {
+	for k, v := range sourceMap {
+		targetMap[k] = v
+	}
+}


Test patch: