Fix: Agent-Rollout downloadete immer globale AGENT_VERSION statt Gruppen-Ziel (v2.5.0)
- downloadSetup() nutzte process.env.AGENT_VERSION statt der Patch-Gruppen- Zielversion → Staged Rollout (Test/Pilot/Produktion) hatte nie funktioniert, jeder Agent bekam beim Auto-Update immer dieselbe globale Version - Fix: downloadSetup() löst jetzt per ?hostname=X die Gruppen-Zielversion auf, exakt wie checkin() es bereits tat - ApiService.DownloadSetupAsync() schickt jetzt den Hostnamen mit - Version: 2.4.0 → 2.5.0 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -65,9 +65,9 @@ public class ApiService(string serverUrl, string agentKey)
|
||||
return await resp.Content.ReadAsByteArrayAsync();
|
||||
}
|
||||
|
||||
public async Task<byte[]> DownloadSetupAsync()
|
||||
public async Task<byte[]> DownloadSetupAsync(string hostname)
|
||||
{
|
||||
var req = BuildRequest(HttpMethod.Get, "/api/monitoring/agent-setup");
|
||||
var req = BuildRequest(HttpMethod.Get, $"/api/monitoring/agent-setup?hostname={Uri.EscapeDataString(hostname)}");
|
||||
var resp = await _http.SendAsync(req);
|
||||
resp.EnsureSuccessStatusCode();
|
||||
return await resp.Content.ReadAsByteArrayAsync();
|
||||
|
||||
@@ -125,7 +125,7 @@ public class CommandExecutor(ApiService api, string hostname, string dataDir, st
|
||||
|
||||
private async Task<string> UpdateAgent()
|
||||
{
|
||||
var bytes = await _api.DownloadSetupAsync();
|
||||
var bytes = await _api.DownloadSetupAsync(_hostname);
|
||||
if (bytes.Length < 512 * 1024) return "Download fehlgeschlagen - Installer zu klein";
|
||||
|
||||
var setupPath = Path.Combine(_dataDir, "IT-Nexus-Agent-Setup-Update.exe");
|
||||
|
||||
Reference in New Issue
Block a user