Repository navigation
chartutil.ReadValues is forced to unmarshal numbers into json.Number refs #1707 [dev-v3] - #6032
Merged
bacongobbler merged 1 commit intoJul 17, 2019
Merged
bacongobbler merged 1 commit into
bacongobbler merged 1 commit into
Conversation
…refs #1707 [dev-v3] Backport of #6010 to dev-v3 (the description below is a copy-paste from the original v2 branch PR). As #6016 is now merged to dev-v3, the change is reasonably trivial. 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]> Signed-off-by: Oleg Sidorov <[email protected]>
bacongobbler
approved these changes
Jul 17, 2019
Contributor
Author
|
Thanks a lot for a super fast merge @bacongobbler ! |
osdrv
deleted the
icanhazbroccoli/chartutil-no-scientific-notation-dev-v3
branch
July 17, 2019 14:15
1 of 3 tasks
hickeyma
approved these changes
Jul 17, 2019
hickeyma
left a comment
Contributor
There was a problem hiding this comment.
LGTM, thanks. Tested before and after fix and show number handled as expected.
osdrv
pushed a commit
to osdrv/helm
that referenced
this pull request
Nov 5, 2019
This change is a second attempt to fix the aforementioned problem. The first one (helm#6032) caused a major regression in numeric values helm#6708. The new approach takes the experience of the failed attempt under consideration and introduces some deeper-level changes to the rendering engine. The proposed change overloads all defined template functions and converts json.Number arguments in runtime. The rest of the description is preserved from the original ticket: 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: helm#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]>
osdrv
pushed a commit
to osdrv/helm
that referenced
this pull request
Nov 5, 2019
This change is a second attempt to fix the aforementioned problem. The first one (helm#6032) caused a major regression in numeric values helm#6708. The new approach takes the experience of the failed attempt under consideration and introduces some deeper-level changes to the rendering engine. The proposed change overloads all defined template functions and converts json.Number arguments in runtime. The rest of the description is preserved from the original ticket: 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: helm#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]>
osdrv
pushed a commit
to osdrv/helm
that referenced
this pull request
Nov 13, 2019
This change is a second attempt to fix the aforementioned problem. The first one (helm#6032) caused a major regression in numeric values helm#6708. The new approach takes the experience of the failed attempt under consideration and introduces some deeper-level changes to the rendering engine. The proposed change overloads all defined template functions and converts json.Number arguments in runtime. The rest of the description is preserved from the original ticket: 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: helm#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]>
osdrv
pushed a commit
to osdrv/helm
that referenced
this pull request
Nov 13, 2019
This change is a second attempt to fix the aforementioned problem. The first one (helm#6032) caused a major regression in numeric values helm#6708. The new approach takes the experience of the failed attempt under consideration and introduces some deeper-level changes to the rendering engine. The proposed change overloads all defined template functions and converts json.Number arguments in runtime. The rest of the description is preserved from the original ticket: 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: helm#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]>
osdrv
pushed a commit
to osdrv/helm
that referenced
this pull request
Feb 19, 2020
This change is a second attempt to fix the aforementioned problem. The first one (helm#6032) caused a major regression in numeric values helm#6708. The new approach takes the experience of the failed attempt under consideration and introduces some deeper-level changes to the rendering engine. The proposed change overloads all defined template functions and converts json.Number arguments in runtime. The rest of the description is preserved from the original ticket: 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: helm#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]>
osdrv
pushed a commit
to osdrv/helm
that referenced
this pull request
Mar 31, 2020
This change is a second attempt to fix the aforementioned problem. The first one (helm#6032) caused a major regression in numeric values helm#6708. The new approach takes the experience of the failed attempt under consideration and introduces some deeper-level changes to the rendering engine. The proposed change overloads all defined template functions and converts json.Number arguments in runtime. The rest of the description is preserved from the original ticket: 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: helm#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]>
osdrv
pushed a commit
to osdrv/helm
that referenced
this pull request
Mar 31, 2020
This change is a second attempt to fix the aforementioned problem. The first one (helm#6032) caused a major regression in numeric values helm#6708. The new approach takes the experience of the failed attempt under consideration and introduces some deeper-level changes to the rendering engine. The proposed change overloads all defined template functions and converts json.Number arguments in runtime. The rest of the description is preserved from the original ticket: 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: helm#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]>
osdrv
pushed a commit
to osdrv/helm
that referenced
this pull request
Apr 4, 2020
This change is a second attempt to fix the aforementioned problem. The first one (helm#6032) caused a major regression in numeric values helm#6708. The new approach takes the experience of the failed attempt under consideration and introduces some deeper-level changes to the rendering engine. The proposed change overloads all defined template functions and converts json.Number arguments in runtime. The rest of the description is preserved from the original ticket: 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: helm#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]>
osdrv
pushed a commit
to osdrv/helm
that referenced
this pull request
Apr 16, 2020
This change is a second attempt to fix the aforementioned problem. The first one (helm#6032) caused a major regression in numeric values helm#6708. The new approach takes the experience of the failed attempt under consideration and introduces some deeper-level changes to the rendering engine. The proposed change overloads all defined template functions and converts json.Number arguments in runtime. The rest of the description is preserved from the original ticket: 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: helm#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]>
osdrv
pushed a commit
to osdrv/helm
that referenced
this pull request
Apr 16, 2020
This change is a second attempt to fix the aforementioned problem. The first one (helm#6032) caused a major regression in numeric values helm#6708. The new approach takes the experience of the failed attempt under consideration and introduces some deeper-level changes to the rendering engine. The proposed change overloads all defined template functions and converts json.Number arguments in runtime. The rest of the description is preserved from the original ticket: 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: helm#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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
Backport of #6010 to dev-v3 (the description below is a copy-paste from the original v2 branch PR). As #6016 is now merged to dev-v3, the change is reasonably trivial.
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:
This PR is coupled with #6010, which is still relevant (imo) for branch 2.
If applicable: