You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by lb...@apache.org on 2019/05/23 08:59:36 UTC
[camel-k] 03/07: Fix #669: make sure annotations are propagated
correctly to the deployment
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...@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