This is an automated email from the ASF dual-hosted git repository.

lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 5e6a5d35d2f75932397f44602477439dce98e84b
Author: nferraro <ni.ferr...@gmail.com>
AuthorDate: Tue May 21 18:02:05 2019 +0200

    Fix #669: make sure annotations are propagated correctly to the deployment
---
 pkg/trait/deployment.go | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/pkg/trait/deployment.go b/pkg/trait/deployment.go
index 64320a0..75d2898 100644
--- a/pkg/trait/deployment.go
+++ b/pkg/trait/deployment.go
@@ -127,9 +127,12 @@ func (t *deploymentTrait) getDeploymentFor(e *Environment) 
*appsv1.Deployment {
                "camel.apache.org/integration": e.Integration.Name,
        }
 
-       annotations := e.Integration.Annotations
-       if annotations == nil {
-               annotations = make(map[string]string)
+       // create a copy to avoid sharing the underlying annotation map
+       annotations := make(map[string]string)
+       if e.Integration.Annotations != nil {
+               for k, v := range e.Integration.Annotations {
+                       annotations[k] = v
+               }
        }
 
        // Resolve registry host names when used

Reply via email to