You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Imran Raza Khan <im...@gmail.com> on 2020/12/24 17:52:19 UTC

Re: Base64 Decoding secerets of kubernetes (Apach Camel 3.2.0)

I used groovy to avoid processor code for decoding

from("timer://foo?repeatCount=1&delay=1000")
.setHeader(KubernetesConstants.KUBERNETES_NAMESPACE_NAME, simple("myns"))
.setHeader(KubernetesConstants.KUBERNETES_SECRET_NAME, simple("broker"))
.to("kubernetes-secrets:///?kubernetesClient=#kubernetesClient&operation=getSecret")


*.setHeader("AMQ_PASSWORD").groovy("new String(
request.getBody().getData().get('amq-password').decodeBase64() )")*

.to("log:my?showAll=true&multiline=true");



On Wed, May 6, 2020 at 7:17 PM Imran Raza Khan <im...@gmail.com>
wrote:

> I want to get secret from kubernetes and then want to decode it within
> route, Following is my example
>
> from("timer://foo?repeatCount=1&delay=1000")
> .setHeader(KubernetesConstants.KUBERNETES_NAMESPACE_NAME, simple("myns"))
> .setHeader(KubernetesConstants.KUBERNETES_SECRET_NAME, simple("broker"))
> .to("kubernetes-secrets:///?kubernetesClient=#kubernetesClient&operation=getSecret")
> .setHeader("AMQ_PASSWORD",simple("${body.getData['amq-password']}") ) --> here i want to decode this value
> //.process(new GetSecret())
> .to("log:my?showAll=true&multiline=true");
>
>
> I am looking for option with simple, I know i can do it in processor but i am looking for simple solution.
>
>