konpyutaika / nifikop

The NiFiKop NiFi Kubernetes operator makes it easy to run Apache NiFi on Kubernetes. Apache NiFI is a free, open-source solution that support powerful and scalable directed graphs of data routing, transformation, and system mediation logic.
https://konpyutaika.github.io/nifikop/
Apache License 2.0
122 stars 40 forks source link

Update parameter value to null instead of delete #369

Closed juldrixx closed 5 months ago

juldrixx commented 5 months ago
Q A
Bug fix? no
New feature? no
API breaks? no
Deprecations? no
Related tickets -
License Apache 2.0

What's in this PR?

Change in the logic of the parameter context updates.

Why?

If the value of parameter is deleted, the parameter shouldn't be deleted it should be set to null.

Additional context

Checklist

mh013370 commented 5 months ago

Seems reasonable to me. Did deleting it cause a problem?

juldrixx commented 5 months ago

Seems reasonable to me. Did deleting it cause a problem?

It wasn't logic. When you set:

  parameters:
    - name: toto
      description: titi

NiFiKop will create a parameter with a null value.

But if you had:

  parameters:
    - name: toto
      description: titi
      value: tata

and removed value: tata, NiFiKop deleted the parameter instead of setting it to null.

It was done in https://github.com/Orange-OpenSource/nifikop/pull/162.

I think, back then, we couldn't set it to null with the API for some reason.

juldrixx commented 5 months ago

Seems reasonable to me. Did deleting it cause a problem?

It wasn't logic. When you set:

  parameters:
    - name: toto
      description: titi

NiFiKop will create a parameter with a null value.

But if you had:

  parameters:
    - name: toto
      description: titi
      value: tata

and removed value: tata, NiFiKop deleted the parameter instead of setting it to null.

It was done in Orange-OpenSource/nifikop#162.

I think, back then, we couldn't set it to null with the API for some reason.

And yes deleting it cause a problem, because for some reason (didn't search why), the operator won't creating it back. So the dataflow will reference a parameter that doesn't exist and flag it as an error.