Re: Kubernetes operator's merging strategy for template arrays

2023-02-23 Thread Alexis Sarda-Espinosa
Ah I see, I'll have a look, thanks.

Am Do., 23. Feb. 2023 um 14:21 Uhr schrieb Gyula Fóra :

> If you are interested in helping to review this, here is the relevant
> ticket and the PR I just opened:
>
> https://issues.apache.org/jira/browse/FLINK-30786
> https://github.com/apache/flink-kubernetes-operator/pull/535
>
> Cheers,
> Gyula
>
> On Thu, Feb 23, 2023 at 2:10 PM Gyula Fóra  wrote:
>
>> Hi!
>>
>> The current array merging strategy in the operator is basically an
>> overwrite by position yes.
>> I actually have a pending improvement to make this configurable and allow
>> merging arrays by "name" attribute. This is generally more practical for
>> such cases.
>>
>> Cheers,
>> Gyula
>>
>> On Thu, Feb 23, 2023 at 1:37 PM Alexis Sarda-Espinosa <
>> sarda.espin...@gmail.com> wrote:
>>
>>> Hello,
>>>
>>> I noticed that if I set environment variables in both spec.podTemplate &
>>> spec.jobManager.podTemplate for the same container (flink-maincontainer),
>>> the values from the latter selectively overwrite the values from the
>>> former. For example, if I define something like this (omitting metadata
>>> properties):
>>>
>>> spec:
>>>   podTemplate:
>>> spec:
>>>   containers:
>>>   - name: flink-main-container
>>> env:
>>>   - name: FOO
>>> value: BAR
>>>   - name: BAZ
>>> value: BAK
>>>   jobManager:
>>> podTemplate:
>>>   spec:
>>> containers:
>>> - name: flink-main-container
>>>   env:
>>> - name: EXTRA
>>>   value: ENVVAR
>>>
>>> The final spec for the Job Manager Deployment will only contain EXTRA
>>> and BAZ, so FOO is overwritten by EXTRA.
>>>
>>> Is this expected? I am already evaluating the latest release of the
>>> operator (1.4.0).
>>>
>>> Regards,
>>> Alexis.
>>>
>>


Re: Kubernetes operator's merging strategy for template arrays

2023-02-23 Thread Gyula Fóra
If you are interested in helping to review this, here is the relevant
ticket and the PR I just opened:

https://issues.apache.org/jira/browse/FLINK-30786
https://github.com/apache/flink-kubernetes-operator/pull/535

Cheers,
Gyula

On Thu, Feb 23, 2023 at 2:10 PM Gyula Fóra  wrote:

> Hi!
>
> The current array merging strategy in the operator is basically an
> overwrite by position yes.
> I actually have a pending improvement to make this configurable and allow
> merging arrays by "name" attribute. This is generally more practical for
> such cases.
>
> Cheers,
> Gyula
>
> On Thu, Feb 23, 2023 at 1:37 PM Alexis Sarda-Espinosa <
> sarda.espin...@gmail.com> wrote:
>
>> Hello,
>>
>> I noticed that if I set environment variables in both spec.podTemplate &
>> spec.jobManager.podTemplate for the same container (flink-maincontainer),
>> the values from the latter selectively overwrite the values from the
>> former. For example, if I define something like this (omitting metadata
>> properties):
>>
>> spec:
>>   podTemplate:
>> spec:
>>   containers:
>>   - name: flink-main-container
>> env:
>>   - name: FOO
>> value: BAR
>>   - name: BAZ
>> value: BAK
>>   jobManager:
>> podTemplate:
>>   spec:
>> containers:
>> - name: flink-main-container
>>   env:
>> - name: EXTRA
>>   value: ENVVAR
>>
>> The final spec for the Job Manager Deployment will only contain EXTRA and
>> BAZ, so FOO is overwritten by EXTRA.
>>
>> Is this expected? I am already evaluating the latest release of the
>> operator (1.4.0).
>>
>> Regards,
>> Alexis.
>>
>


Re: Kubernetes operator's merging strategy for template arrays

2023-02-23 Thread Gyula Fóra
Hi!

The current array merging strategy in the operator is basically an
overwrite by position yes.
I actually have a pending improvement to make this configurable and allow
merging arrays by "name" attribute. This is generally more practical for
such cases.

Cheers,
Gyula

On Thu, Feb 23, 2023 at 1:37 PM Alexis Sarda-Espinosa <
sarda.espin...@gmail.com> wrote:

> Hello,
>
> I noticed that if I set environment variables in both spec.podTemplate &
> spec.jobManager.podTemplate for the same container (flink-maincontainer),
> the values from the latter selectively overwrite the values from the
> former. For example, if I define something like this (omitting metadata
> properties):
>
> spec:
>   podTemplate:
> spec:
>   containers:
>   - name: flink-main-container
> env:
>   - name: FOO
> value: BAR
>   - name: BAZ
> value: BAK
>   jobManager:
> podTemplate:
>   spec:
> containers:
> - name: flink-main-container
>   env:
> - name: EXTRA
>   value: ENVVAR
>
> The final spec for the Job Manager Deployment will only contain EXTRA and
> BAZ, so FOO is overwritten by EXTRA.
>
> Is this expected? I am already evaluating the latest release of the
> operator (1.4.0).
>
> Regards,
> Alexis.
>


Kubernetes operator's merging strategy for template arrays

2023-02-23 Thread Alexis Sarda-Espinosa
Hello,

I noticed that if I set environment variables in both spec.podTemplate &
spec.jobManager.podTemplate for the same container (flink-maincontainer),
the values from the latter selectively overwrite the values from the
former. For example, if I define something like this (omitting metadata
properties):

spec:
  podTemplate:
spec:
  containers:
  - name: flink-main-container
env:
  - name: FOO
value: BAR
  - name: BAZ
value: BAK
  jobManager:
podTemplate:
  spec:
containers:
- name: flink-main-container
  env:
- name: EXTRA
  value: ENVVAR

The final spec for the Job Manager Deployment will only contain EXTRA and
BAZ, so FOO is overwritten by EXTRA.

Is this expected? I am already evaluating the latest release of the
operator (1.4.0).

Regards,
Alexis.