[ 
https://issues.apache.org/jira/browse/CAMEL-14129?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16968279#comment-16968279
 ] 

Andrea Cosentino commented on CAMEL-14129:
------------------------------------------

By the way on the helper the namespace wasn't set during the client creation, 
so the bug is there for real. I'm fixing it. I'll add documentation on the 
instatiation of the client, thanks [~imranrazakhan]

> kubernetesConfiguration.setNamespace is not working
> ---------------------------------------------------
>
>                 Key: CAMEL-14129
>                 URL: https://issues.apache.org/jira/browse/CAMEL-14129
>             Project: Camel
>          Issue Type: Bug
>            Reporter: imran raza khan
>            Assignee: Andrea Cosentino
>            Priority: Major
>             Fix For: 3.0.0
>
>
> I am running following code and its not working with 
> "kubernetesConfiguration.setNamespace" but if i set 
> ".setHeader(KubernetesConstants.KUBERNETES_NAMESPACE_NAME, simple("my-ns"))" 
> then its work
> *Main Class:*
> {code:java}
> public static void main(String[] args) throws Exception {        
> KubernetesConfiguration kubernetesConfiguration = new 
> KubernetesConfiguration();        
> kubernetesConfiguration.setMasterUrl("https://0.0.0.0:8443";); 
> kubernetesConfiguration.setOauthToken("52rAQP_gk3GOtAG8o53loVtozrzPbKy9meNrpNSyCtA");
>  kubernetesConfiguration.setTrustCerts(true);
> kubernetesConfiguration.setNamespace("my-ns");
> KubernetesClient kc = 
> KubernetesHelper.getKubernetesClient(kubernetesConfiguration);
> final Main main = new Main();
> main.addRouteBuilder(new MyRoute());
> main.bind("kubeClient", kc);
> main.run(args);    
> }{code}
>  
> *Route Code:*
> {code:java}
> from("timer://ipc?repeatCount=1")
> //.setHeader(KubernetesConstants.KUBERNETES_NAMESPACE_NAME, simple("my-ns"))
> .setHeader(KubernetesConstants.KUBERNETES_CONFIGMAP_NAME, simple("my-cm"))
> .to("kubernetes-config-maps:///?kubernetesClient=#kubeClient&operation=getConfigMap")
> .to("log:my?showAll=true&multiline=true");{code}
>  if in route i set namespace header then it works otherwise it give null body 
> so if we already configured client with namespace it should be used rather 
> than we have to explicitly provide in header of route, yes if we provide in 
> header it should be override on client configuration



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to