Add worker-name filter to airflow edge list-workers#70095
Conversation
|
@shubhamraj-git, looks like there are conflicts. Can you resolve them? What are your thoughts on extending the |
There was a problem hiding this comment.
Actually on second pass, the current approach is better. Could we rename this option from --name-pattern to --worker-name-pattern?
The command output and model field both use worker_name, and the edge API/UI already expose worker_name_pattern, so --worker-name-pattern makes the target field clearer. I'd avoid extending --edge-hostname for this, since that option is used as an exact worker identity for mutation commands.
Drafted-by: Codex (GPT-5); reviewed by @dheerajturaga before posting
I gave it a thought before raising this PR,
sounds bit redundant on the worker side, so thought of going with just name-pattern since here name self explains it is for worker, let me know what do you think? |
0d78a59 to
0bea07c
Compare
just incase we want to use the same option for other edge CLIs it would make it clear |
Match the existing worker_name_pattern naming already used by the edge REST/UI routes for consistency.
dheerajturaga
left a comment
There was a problem hiding this comment.
Awesome! Works as expected. Thanks for making adjustments as needed!
In clusters with many edge workers,
list-workerscould only be narrowed by--state. This adds an optional--worker-name-patternglob (e.g.'prod-*','*gpu*') that filters workers by name DB-side, composable with--state. This brings the CLI to parity with the edge UI/REST route, which already supportsworker_name_pattern.Usage:
airflow edge list-workers --worker-name-pattern 'bree-*'
Was generative AI tooling used to co-author this PR?