[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: CMD with env vars



Defaults are not supported in the kube syntax.  If you want to do
shell expansion, your command has to be `["/bin/sh", "-c",
"--worker-id=${WORKER_ID:-0}"]`

On Thu, Feb 25, 2016 at 1:52 PM, Dan Mace <dmace redhat com> wrote:
>
>
> On Thu, Feb 25, 2016 at 1:43 PM, Philippe Lafoucrière
> <philippe lafoucriere tech-angels com> wrote:
>>
>> Hi,
>>
>> Sorry it's not the right place to post that, but I can't manage to get a
>> container running when env var are present in the command:
>>
>>  spec:
>>    containers:
>>    - command:
>>      - /nsqd
>>      - --worker-id=${WORKER_ID:-0}
>>      env:
>>      - name: WORKER_ID
>>        value: "1"
>>
>> I have tried with /bin/sh -c, with or without quotes, etc., and nothing is
>> working.
>>
>> Thanks,
>> Philippe
>
>
> Try this syntax:
>
> -worker-id=$(WORKER_ID)
>
> Notice the parens rather than braces. I don't know that defaulting is
> supported.
>
>
> _______________________________________________
> users mailing list
> users lists openshift redhat com
> http://lists.openshift.redhat.com/openshiftmm/listinfo/users
>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]