Is it possible to edit the labels on an agent? If ...
# ask-community
n
Is it possible to edit the labels on an agent? If not, I suppose as a workaround I could launch a second agent with the desired labels and tear down the original agent.
FYI, I'm reposting this question since it didn't get any answers: https://github.com/PrefectHQ/prefect/discussions/4472
c
How do you deploy the agent?
Something like K8s/ECS would just be editing the environment variable on the container
n
The agent is deployed on ECS but (looking at the script someone else wrote) it looks like it runs
prefect agent local start --label ...
on ECS to start the agent. Does that make sense?
m
Hello Nicholas! Sorry for such delay. You'll have to create a new agent with updated labels. So in your case, you'll need to update the script with new labels.
c
Ah, @Nicholas Chammas I'd recommend trying to extract the labels out to the environment variable
Copy code
PREFECT__CLOUD__AGENT__LABELS
n
Would it make sense to file a feature request to make it possible to edit labels directly (either via the web UI or CLI) on a running agent? With regards to editing
PREFECT__CLOUD__AGENT__LABELS
, wouldn't I need to relaunch the agent somehow so it sees the updated environment variable? i.e. It doesn't eliminate the need to take the agent down, right?
c
I think updating it would just restart the process
👌 1