vidispine / hull

The incredible HULL - Helm Uniform Layer Library - is a Helm library chart to improve Helm chart based workflows
https://github.com/vidispine/hull
Apache License 2.0
213 stars 12 forks source link

hull.util.transformation.get converts a string to an integer #276

Closed khmarochos closed 8 months ago

khmarochos commented 8 months ago

Hello!

It seems that I've found an unexpected (at least by me) scenario when a string is being forcefully converted to an integer by hull.util.transformation.get.

Here's a minimalistic values set:

hull:
  objects:
    job:
      my-job:
        pod:
          containers:
            my-container:
              image:
                registry: my-registry.local
                repository: my-repository
                tag: _HT*image.tag
image:
  tag: "09956e29" # in my "real-world" case this value is just a commit tag, the `image.tag` value is set by the CI pipeline

And here's what I get in spec.template.spec.containers[0].image:

my-registry.local/my-repository:9.956e+32

Can I prevent this behaviour?

Thank you in advance, I'm really sorry for disturbance.

gre9ory commented 8 months ago

Hi @khmarochos ,

this looks very much the same as the recent issue here.

There is no convenient solution that can be build in HULL as explained there. If you expect a "problematic" value in one of your fields you should try to take the precautions listed in the other issue.

Hope that clears this up.

khmarochos commented 8 months ago

Thank you very much.

I definitely should have done some research before opening the issue; in that case, I would have understood that it was a Helm-related issue and found some workaround myself.

I have to admit that my mental capacities have gone extremely low during the last year or two. I've been feeling really dumb lately; I can barely remember what was a day or two ago. :-) I'm very sorry for some of the questions I asked (and keep asking).

Will implement _HT!{{ (index . "$").Values.image.tag | toJson | trimAll "\"" | quote }}.

gre9ory commented 8 months ago

No worries, any question is welcome :)