You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "imran raza khan (Jira)" <ji...@apache.org> on 2019/11/03 20:35:00 UTC

[jira] [Updated] (CAMEL-14129) kubernetesConfiguration.setNamespace is not working

     [ https://issues.apache.org/jira/browse/CAMEL-14129?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

imran raza khan updated CAMEL-14129:
------------------------------------
    Description: 
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:*

    public static void main(String[] args) throws Exception {   

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 kubernetesClient =     KubernetesHelper.getKubernetesClient(kubernetesConfiguration);
 

final Main main = new Main();        main.addRouteBuilder(new ShutdownIPC());        main.bind("kubernetesClient", kubernetesClient);       

main.run(args);   

}

*Route Code:*
	    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=#kubernetesClient&operation=getConfigMap")
        .to("log:my?showAll=true&multiline=true");

 if in route i set namespace header then it works otherwise it give null body



  was:
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:

    public static void main(String[] args) throws Exception {   

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 kubernetesClient =     KubernetesHelper.getKubernetesClient(kubernetesConfiguration);
 

final Main main = new Main();        main.addRouteBuilder(new ShutdownIPC());        main.bind("kubernetesClient", kubernetesClient);       

main.run(args);   

}

Route Code:
	    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=#kubernetesClient&operation=getConfigMap")
        .to("log:my?showAll=true&multiline=true");

 if in route i set namespace header then it works otherwise it give null body




> kubernetesConfiguration.setNamespace is not working
> ---------------------------------------------------
>
>                 Key: CAMEL-14129
>                 URL: https://issues.apache.org/jira/browse/CAMEL-14129
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: imran raza khan
>            Priority: Major
>
> 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:*
>     public static void main(String[] args) throws Exception {   
> 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 kubernetesClient =     KubernetesHelper.getKubernetesClient(kubernetesConfiguration);
>  
> final Main main = new Main();        main.addRouteBuilder(new ShutdownIPC());        main.bind("kubernetesClient", kubernetesClient);       
> main.run(args);   
> }
> *Route Code:*
> 	    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=#kubernetesClient&operation=getConfigMap")
>         .to("log:my?showAll=true&multiline=true");
>  if in route i set namespace header then it works otherwise it give null body



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