[BUG] Parsing YAML for k8s DefaultAnnotations misunderstands "." in annotation keys to mean a nested dict. #6166
Open
Description
Describe the bug
In the FlytePropellor config (docs), there appears to be a bug in how the YAML file is parsed. Dots in keys are misunderstood as nested dicts. This is relevant, because e.g. Google Kubernetes Engine we might want to set an annotation:
cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
, which includes dots.
Consider the following config
k8s:
plugins:
k8s:
default-annotations:
test.annotation: "true"
This raises the following flytepropellor 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]'"
This suggests that the YAML is parsed into {"default-annotations": {"test": {"annotation": "true}}}
instead of {"default-annotations": {"test.annotation": "true}}
, as we'd want.
Expected behavior
I'd expect the above config to lead to a default annotation test.annotation: "true"
, but I get a FlytePropellor error.
Additional context to reproduce
Using flyte-core 1.13.3
Screenshots
No response
Are you sure this issue hasn't been raised already?
- Yes
Have you read the Code of Conduct?
- Yes
Metadata
Assignees
Labels
Type
Projects
Status
Backlog