The format of key of containerEnvVar within Jenkins Kubernetes Plugin

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

The format of key of containerEnvVar within Jenkins Kubernetes Plugin

WANG, YAN-HONG
Hello,

I am Hong.

I saw "containerEnvVar" was supported by Jenkins Kubernetes Plugin 0.9.
But, it seems not support some key value with dot?

Example in containerTemplate:
containerEnvVar( key: “data.source.url”, value: “somewhere” )

I tried to use backslash to escape dot, but Jenkins parser doesn't pass it.

Someone has idea?

Thanks very much.

Best regards,
Hong

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CADLWyO1jrOYcJzMgBFZvMy0uENVjMORJsrSr%3DUoi%2Bf%2B-jGP-dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: The format of key of containerEnvVar within Jenkins Kubernetes Plugin

Carlos Sanchez
You can not use dots in an environment variable

https://kubernetes.io/docs/api-reference/v1.6/#envvar-v1-core

a valid C identifier must start with alphabetic character or '_', followed by a string of alphanumeric characters or '_'


On Wed, Aug 9, 2017 at 9:18 AM, WANG, YAN-HONG <[hidden email]> wrote:
Hello,

I am Hong.

I saw "containerEnvVar" was supported by Jenkins Kubernetes Plugin 0.9.
But, it seems not support some key value with dot?

Example in containerTemplate:
containerEnvVar( key: “data.source.url”, value: “somewhere” )

I tried to use backslash to escape dot, but Jenkins parser doesn't pass it.

Someone has idea?

Thanks very much.

Best regards,
Hong

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CADLWyO1jrOYcJzMgBFZvMy0uENVjMORJsrSr%3DUoi%2Bf%2B-jGP-dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CALHFn6MJxsBOT6_FOn1nyQr%3DNo18SX_bFng_KrWCpzUEn3jwdw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: The format of key of containerEnvVar within Jenkins Kubernetes Plugin

WANG, YAN-HONG
Hello Carlos,

Thanks for hint.

But, something interesting is if I set this environment variable into Dockerfile.
That's worked.

Looks like:
ENV data.source.url SomeWhere_A

I could see data.source.url existed when this Docker container run.
That environment variable even could be saw when this Docker container run in Kubernetes.

By the way, you are right, if use "export" under shell, that is forbidden to claim a variable name with dot inside.
That will show error message: "not a valid identifier"

But, I saw someone with "env" could claim variable name with dot.
https://unix.stackexchange.com/questions/93532/exporting-a-variable-with-dot-in-it
https://stackoverflow.com/questions/26506539/reference-to-a-bash-variable-whose-name-contains-dot

Normally containerTemplate "command" will be occupied with "cat", right?
I don't really understand the principle of containerTemplate with "cat".

If I plan to use Kubernetes args to carry some variable to Docker entry point file and replace the variable inside this entry point file.
And of course insert "cat" inside entry point. Is that possible let cat stay in docker entry point file?

Thanks very much.

Hong

Am Donnerstag, 10. August 2017 21:09:08 UTC+2 schrieb Carlos Sanchez:
You can not use dots in an environment variable

<a href="https://kubernetes.io/docs/api-reference/v1.6/#envvar-v1-core" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fkubernetes.io%2Fdocs%2Fapi-reference%2Fv1.6%2F%23envvar-v1-core\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE3jq65GMxL2gA2mmMlYQp82GeSQg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fkubernetes.io%2Fdocs%2Fapi-reference%2Fv1.6%2F%23envvar-v1-core\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE3jq65GMxL2gA2mmMlYQp82GeSQg&#39;;return true;">https://kubernetes.io/docs/api-reference/v1.6/#envvar-v1-core

a valid C identifier must start with alphabetic character or '_', followed by a string of alphanumeric characters or '_'


On Wed, Aug 9, 2017 at 9:18 AM, WANG, YAN-HONG <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="BivurJ8MCAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">allway...@...> wrote:
Hello,

I am Hong.

I saw "containerEnvVar" was supported by Jenkins Kubernetes Plugin 0.9.
But, it seems not support some key value with dot?

Example in containerTemplate:
containerEnvVar( key: “data.source.url”, value: “somewhere” )

I tried to use backslash to escape dot, but Jenkins parser doesn't pass it.

Someone has idea?

Thanks very much.

Best regards,
Hong

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="BivurJ8MCAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-users/CADLWyO1jrOYcJzMgBFZvMy0uENVjMORJsrSr%3DUoi%2Bf%2B-jGP-dg%40mail.gmail.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/CADLWyO1jrOYcJzMgBFZvMy0uENVjMORJsrSr%3DUoi%2Bf%2B-jGP-dg%40mail.gmail.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/CADLWyO1jrOYcJzMgBFZvMy0uENVjMORJsrSr%3DUoi%2Bf%2B-jGP-dg%40mail.gmail.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-users/CADLWyO1jrOYcJzMgBFZvMy0uENVjMORJsrSr%3DUoi%2Bf%2B-jGP-dg%40mail.gmail.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/87fec8e5-3138-4306-843e-f8cd43bae3f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: The format of key of containerEnvVar within Jenkins Kubernetes Plugin

WANG, YAN-HONG
Hello Carlos,

I found out some other way to avoid to use dot in variable name.
Thanks.

Hong

Am Freitag, 11. August 2017 16:27:24 UTC+2 schrieb YAN-HONG WANG:
Hello Carlos,

Thanks for hint.

But, something interesting is if I set this environment variable into Dockerfile.
That's worked.

Looks like:
ENV data.source.url SomeWhere_A

I could see data.source.url existed when this Docker container run.
That environment variable even could be saw when this Docker container run in Kubernetes.

By the way, you are right, if use "export" under shell, that is forbidden to claim a variable name with dot inside.
That will show error message: "not a valid identifier"

But, I saw someone with "env" could claim variable name with dot.
<a href="https://unix.stackexchange.com/questions/93532/exporting-a-variable-with-dot-in-it" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Funix.stackexchange.com%2Fquestions%2F93532%2Fexporting-a-variable-with-dot-in-it\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHDujFLMhl5OCc9wEGb9o_UBcfFpw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Funix.stackexchange.com%2Fquestions%2F93532%2Fexporting-a-variable-with-dot-in-it\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHDujFLMhl5OCc9wEGb9o_UBcfFpw&#39;;return true;">https://unix.stackexchange.com/questions/93532/exporting-a-variable-with-dot-in-it
<a href="https://stackoverflow.com/questions/26506539/reference-to-a-bash-variable-whose-name-contains-dot" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fstackoverflow.com%2Fquestions%2F26506539%2Freference-to-a-bash-variable-whose-name-contains-dot\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEKw7SLpcf67hRnO5b_RQQ1rCkaPw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fstackoverflow.com%2Fquestions%2F26506539%2Freference-to-a-bash-variable-whose-name-contains-dot\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEKw7SLpcf67hRnO5b_RQQ1rCkaPw&#39;;return true;">https://stackoverflow.com/questions/26506539/reference-to-a-bash-variable-whose-name-contains-dot

Normally containerTemplate "command" will be occupied with "cat", right?
I don't really understand the principle of containerTemplate with "cat".

If I plan to use Kubernetes args to carry some variable to Docker entry point file and replace the variable inside this entry point file.
And of course insert "cat" inside entry point. Is that possible let cat stay in docker entry point file?

Thanks very much.

Hong

Am Donnerstag, 10. August 2017 21:09:08 UTC+2 schrieb Carlos Sanchez:
You can not use dots in an environment variable

<a href="https://kubernetes.io/docs/api-reference/v1.6/#envvar-v1-core" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fkubernetes.io%2Fdocs%2Fapi-reference%2Fv1.6%2F%23envvar-v1-core\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE3jq65GMxL2gA2mmMlYQp82GeSQg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fkubernetes.io%2Fdocs%2Fapi-reference%2Fv1.6%2F%23envvar-v1-core\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE3jq65GMxL2gA2mmMlYQp82GeSQg&#39;;return true;">https://kubernetes.io/docs/api-reference/v1.6/#envvar-v1-core

a valid C identifier must start with alphabetic character or '_', followed by a string of alphanumeric characters or '_'


On Wed, Aug 9, 2017 at 9:18 AM, WANG, YAN-HONG <[hidden email]> wrote:
Hello,

I am Hong.

I saw "containerEnvVar" was supported by Jenkins Kubernetes Plugin 0.9.
But, it seems not support some key value with dot?

Example in containerTemplate:
containerEnvVar( key: “data.source.url”, value: “somewhere” )

I tried to use backslash to escape dot, but Jenkins parser doesn't pass it.

Someone has idea?

Thanks very much.

Best regards,
Hong

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-users/CADLWyO1jrOYcJzMgBFZvMy0uENVjMORJsrSr%3DUoi%2Bf%2B-jGP-dg%40mail.gmail.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/CADLWyO1jrOYcJzMgBFZvMy0uENVjMORJsrSr%3DUoi%2Bf%2B-jGP-dg%40mail.gmail.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/CADLWyO1jrOYcJzMgBFZvMy0uENVjMORJsrSr%3DUoi%2Bf%2B-jGP-dg%40mail.gmail.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-users/CADLWyO1jrOYcJzMgBFZvMy0uENVjMORJsrSr%3DUoi%2Bf%2B-jGP-dg%40mail.gmail.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/d2234c47-e762-4aea-b435-760bd8cff51a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...