<#6171 Support overriding task annotations and lab...
# flyte-github
a
#6171 Support overriding task annotations and labels via with_overrides Pull request opened by arbaobao on <!date^1736931960^{date_short}|2025-01-15T09:06:00Z> ## Tracking issue ## Why are the changes needed? Improvement to allow setting labels and annotations dynamically at run time for things like cost allocation. ## What changes were proposed in this pull request? Adds labels and annotations to with_overrides(). ## How was this patch tested? Excute a workflow and using with_override(labels={"lKeyA": "lValA"},annotations={"lKeyB": "lValB"}). ### Setup process
Copy code
python

@task
def say_hello() -> str:
    return "Hello, World!"

@workflow
def hello_world_wf() -> str:
    res = say_hello().with_overrides(labels={"lKeyA": "lValA"},annotations={"lKeyB": "lValB"})
    return res
It can be tested by using kubectl describe pods {pod_name} -n flytesnacks-development ### Screenshots ## Check all the applicable boxes • I updated the documentation accordingly. • All new and existing tests passed. • All commits are signed-off. ## Related PRs flytekit 3061 ## Docs link ### Summary by Bito This PR implements TaskNodeOverrides and with_overrides() functionality for dynamic pod metadata configuration at runtime, enhancing K8s plugin manager test suite. It consolidates annotation and label override functionality, merging default values with existing metadata and override values from task context. Implementation includes protobuf updates across multiple language bindings and workflow compiler updates, with test cases verifying proper metadata configurations. Unit tests added: True Estimated effort to review (1-5, lower is better): 5 flyteorg/flyte