mirror of
https://github.com/actions/runner.git
synced 2025-12-28 20:37:54 +08:00
Fix unconfiguring of runner after group changes (#1359)
* Ignore agentpool when unconfiguring the runner Runner names and IDs are unique within a ServiceHost They don't need to be included when unconfiguring the runner. * Use -1 instead of 0 to highlight how it is ignored * Use overloads and 0 instead of -1 Using 0 seems to be the convention * Fix typo calling the wrong method
This commit is contained in:
@@ -415,7 +415,7 @@ namespace GitHub.Runner.Listener.Configuration
|
||||
// Determine the service deployment type based on connection data. (Hosted/OnPremises)
|
||||
await _runnerServer.ConnectAsync(new Uri(settings.ServerUrl), creds);
|
||||
|
||||
var agents = await _runnerServer.GetAgentsAsync(settings.PoolId, settings.AgentName);
|
||||
var agents = await _runnerServer.GetAgentsAsync(settings.AgentName);
|
||||
Trace.Verbose("Returns {0} agents", agents.Count);
|
||||
TaskAgent agent = agents.FirstOrDefault();
|
||||
if (agent == null)
|
||||
@@ -424,7 +424,7 @@ namespace GitHub.Runner.Listener.Configuration
|
||||
}
|
||||
else
|
||||
{
|
||||
await _runnerServer.DeleteAgentAsync(settings.PoolId, settings.AgentId);
|
||||
await _runnerServer.DeleteAgentAsync(settings.AgentId);
|
||||
|
||||
_term.WriteLine();
|
||||
_term.WriteSuccessMessage("Runner removed successfully");
|
||||
|
||||
Reference in New Issue
Block a user