Skip to content

fix dynamicconfig parsing of long integers - #988

Open
imilchev wants to merge 1 commit into
alexandrevilain:mainfrom
imilchev:ivan/fix-dynamicconfig-parsing
Open

fix dynamicconfig parsing of long integers#988
imilchev wants to merge 1 commit into
alexandrevilain:mainfrom
imilchev:ivan/fix-dynamicconfig-parsing

Conversation

@imilchev

@imilchev imilchev commented Jul 8, 2026

Copy link
Copy Markdown

Problem

DynamicConfigToYamlDynamicConfig decoded CRD values via json.Unmarshal into an any, which always coerces JSON numbers to float64. A large integer like 2097152 became float64(2097152), and yaml.v3 then marshaled it in scientific notation (2.097152e+06). Temporal's file-based dynamic config client fails to parse this for settings that expect an integer.

Fix

  • Added a test reproducing the scientific-notation bug (2097152value: 2097152).
  • Added a test covering large integers nested inside objects/arrays.
  • Updated existing table tests to expect int instead of float64 for integer values.

Note

This changes integer dynamic config values from float64 to int in YamlConstrainedValue.Value. Existing config maps holding values in scientific notation get rewritten once to the clean integer form on upgrade.

Fixes #517

Signed-off-by: Ivan Milchev <ivan@mondoo.com>
@sonarqubecloud

sonarqubecloud Bot commented Jul 8, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dynamic config error

1 participant