Repository navigation
chartutil.ReadValues is forced to unmarshal numbers into json.Number refs #1707 - #6010
bacongobbler merged 2 commits into
Conversation
This change is an attempt to address the common problem of json number unmarshalling where any number is converted into a float64 and represented in a scientific notation on a marshall call. This behavior breaks things like: chart versions and image tags if not converted to yaml strings explicitly. An example of this behavior: k8s failure to fetch an image tagged with a big number like: $IMAGE:20190612073634 after a few steps of yaml re-rendering turns into: $IMAGE:2.0190612073634e+13. Example issue: #1707 This commit forces yaml parser to use JSON modifiers and explicitly enables interface{} unmarshalling instead of float64. The change introduced might be breaking so should be processed with an extra care. Due to the fact helm mostly dals with human-produced data (charts), we have a decent level of confidence this change looses no functionality helm users rely upon (the scientific notation). Relevant doc: https://golang.org/pkg/encoding/json/#Decoder.UseNumber Signed-off-by: Oleg Sidorov <[email protected]>
|
Wow... That's a surprisingly simple patch to fix this issue. Nice catch. Would you be willing to port this over to the |
|
It turns out that this breaks certain unit tests from passing, however. Would you mind looking into the failing tests? |
|
@bacongobbler I really appreciate your instant reply! I'm working on the failing tests atm, will push a fix once I've figured out what's up. Will port the change to dev-v3 with pleasure if the change makes sense to you folks. |
Signed-off-by: Oleg Sidorov <[email protected]>
|
A quick update on this PR: the recent fix seems to look quite promising for master and 2.x branches. Dependency declarators I've identified so far:
In the current state of dev-v3 one of these components resolves yaml library to 1.0.0, not to c7ce16629ff4. Once it's fixed, the fix porting should be pretty trivial. I'll try to resolve it some time soon and update this thread. |
hickeyma
left a comment
There was a problem hiding this comment.
LGTM, thanks. Tested before and after fix and show number handled as expected.
… v2.15 - Apply workaround from helm/helm#6708 - Related to helm/helm#6010
This commit reverts changes introduced in helm#6010 due to a massive regression reported in helm#6708. An attempt to fix the problem in helm#6709 seems to be unreasonably clumzy and hacky, therefore reverting the offensive change seems to be the most pragmatic solution. This reverts commits: * 70cd32c. * 9014bd9.
This commit reverts changes introduced in helm#6010 due to a massive regression reported in helm#6708. An attempt to fix the problem in helm#6709 seems to be unreasonably clumzy and hacky, therefore reverting the offensive change seems to be the most pragmatic solution. This reverts commits: * 70cd32c. * 9014bd9. Signed-off-by: Oleg Sidorov <[email protected]>
…6010 Reverted changes introduced in #6010
This commit reverts changes introduced in #6010 due to a massive regression reported in #6708. An attempt to fix the problem in #6709 seems to be unreasonably clumzy and hacky, therefore reverting the offensive change seems to be the most pragmatic solution. This reverts commits: * 70cd32c. * 9014bd9. Signed-off-by: Oleg Sidorov <[email protected]>
… v2.15 - Apply workaround from helm/helm#6708 - Related to helm/helm#6010
What this PR does / why we need it:
This change is an attempt to address the common problem of json number
unmarshalling where any number is converted into a float64 and
represented in a scientific notation on a marshall call. This behavior
breaks things like: chart versions and image tags if not converted to
yaml strings explicitly.
An example of this behavior: k8s failure to fetch an image tagged with a
big number like: $IMAGE:20190612073634 after a few steps of yaml
re-rendering turns into: $IMAGE:2.0190612073634e+13.
Example issue: #1707
This commit forces yaml parser to use JSON modifiers and explicitly
enables interface{} unmarshalling instead of float64. The change
introduced might be breaking so should be processed with an extra care.
Due to the fact helm mostly dals with human-produced data (charts), we
have a decent level of confidence this change looses no functionality
helm users rely upon (the scientific notation).
Relevant doc: https://golang.org/pkg/encoding/json/#Decoder.UseNumber
Signed-off-by: Oleg Sidorov [email protected]
Special notes for your reviewer:
If applicable: