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

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

commit 8ad1a302dced7ee86c6dcd767b1d2d46d542cf22
Author: Andrea Cosentino <anco...@gmail.com>
AuthorDate: Wed Mar 7 13:35:27 2018 +0100

    CAMEL-12328 - Headers getting lost after calling kubernetes-services API
---
 .../component/kubernetes/services/KubernetesServicesProducer.java   | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git 
a/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/services/KubernetesServicesProducer.java
 
b/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/services/KubernetesServicesProducer.java
index 19e65b4..75ea760 100644
--- 
a/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/services/KubernetesServicesProducer.java
+++ 
b/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/services/KubernetesServicesProducer.java
@@ -35,6 +35,7 @@ import 
org.apache.camel.component.kubernetes.AbstractKubernetesEndpoint;
 import org.apache.camel.component.kubernetes.KubernetesConstants;
 import org.apache.camel.component.kubernetes.KubernetesOperations;
 import org.apache.camel.impl.DefaultProducer;
+import org.apache.camel.util.MessageHelper;
 import org.apache.camel.util.ObjectHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -105,6 +106,7 @@ public class KubernetesServicesProducer extends 
DefaultProducer {
             servicesList = 
getEndpoint().getKubernetesClient().services().inAnyNamespace()
                     .list();
         }
+        MessageHelper.copyHeaders(exchange.getIn(), exchange.getOut(), true);
         exchange.getOut().setBody(servicesList.getItems());
     }
 
@@ -131,6 +133,7 @@ public class KubernetesServicesProducer extends 
DefaultProducer {
             }
             servicesList = services.list();
         }
+        MessageHelper.copyHeaders(exchange.getIn(), exchange.getOut(), true);
         exchange.getOut().setBody(servicesList.getItems());
     }
 
@@ -153,6 +156,7 @@ public class KubernetesServicesProducer extends 
DefaultProducer {
         }
         service = getEndpoint().getKubernetesClient().services()
                 .inNamespace(namespaceName).withName(serviceName).get();
+        MessageHelper.copyHeaders(exchange.getIn(), exchange.getOut(), true);
         exchange.getOut().setBody(service);
     }
 
@@ -187,6 +191,7 @@ public class KubernetesServicesProducer extends 
DefaultProducer {
                 .endMetadata().withSpec(serviceSpec).build();
         service = getEndpoint().getKubernetesClient().services()
                 .inNamespace(namespaceName).create(serviceCreating);
+        MessageHelper.copyHeaders(exchange.getIn(), exchange.getOut(), true);
         exchange.getOut().setBody(service);
     }
 
@@ -208,6 +213,7 @@ public class KubernetesServicesProducer extends 
DefaultProducer {
         }
         boolean serviceDeleted = getEndpoint().getKubernetesClient().services()
                 .inNamespace(namespaceName).withName(serviceName).delete();
+        MessageHelper.copyHeaders(exchange.getIn(), exchange.getOut(), true);
         exchange.getOut().setBody(serviceDeleted);
     }
 }

-- 
To stop receiving notification emails like this one, please contact
acosent...@apache.org.

Reply via email to