Skip to content

Enable dot in config keys#7369

Merged
machichima merged 3 commits into
flyteorg:masterfrom
machichima:enable-dot-in-config-keys
May 15, 2026
Merged

Enable dot in config keys#7369
machichima merged 3 commits into
flyteorg:masterfrom
machichima:enable-dot-in-config-keys

Conversation

@machichima

@machichima machichima commented May 13, 2026

Copy link
Copy Markdown
Member

Tracking issue

Closes #6166

Why are the changes needed?

We may want to set annotations with dots in keys (e.g. cluster-autoscaler.kubernetes.io/safe-to-evict: "false"). Currently, when setting config like:

  k8s:
    plugins:
      k8s:
        default-annotations: 
          test.annotation: "true"

We will get error:

time="2025-01-14T10:33:00Z" level=error msg="\n\n\n1 error(s) decoding:\n\n* 'default-annotations[test]' expected type 'string', got unconvertible type 'map[string]interface {}', value: 'map[annotation:true]'"

The YAML is parsed as {"default-annotations": {"test": {"annotation": "true"}}} instead of the intended {"default-annotations": {"test.annotation": "true"}}

What changes were proposed in this pull request?

Adds a post-processing pass in parseViperConfig that re-reads the raw YAML config files and patches viper's output to restore any leaf keys that contained dots. This follows the same pattern as the existing restoreCaseSensitiveArrayKeys workaround in the file.

How was this patch tested?

  • Unit tests
  • Start local sandbox with following config, ensure no error raised
plugins:
  k8s:
    default-annotations: 
      test.annotation: "true"

Labels

Please add one or more of the following labels to categorize your PR:

  • added: For new features.
  • changed: For changes in existing functionality.
  • deprecated: For soon-to-be-removed features.
  • removed: For features being removed.
  • fixed: For any bug fixed.
  • security: In case of vulnerabilities

This is important to improve the readability of release notes.

Setup process

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Stack

If you do use git town to manage PR Stacks, the stack relevant to this PR
will show below. Otherwise, you can ignore this section.

Docs link

Signed-off-by: machichima <nary12321@gmail.com>
Signed-off-by: machichima <nary12321@gmail.com>
@marrrcin

Copy link
Copy Markdown
Contributor

Can't wait to have this released 🤗

Signed-off-by: machichima <nary12321@gmail.com>
@machichima machichima merged commit c6c746e into flyteorg:master May 15, 2026
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants