From 93b582f92ef8883437f45650c0c88b594ff3003e Mon Sep 17 00:00:00 2001 From: Cheick Keita Date: Wed, 10 May 2023 13:01:49 -0700 Subject: [PATCH] Match the agent version to the server (#3093) * match the agent version to the server * fix node state --- src/ApiService/ApiService/Functions/AgentEvents.cs | 7 +++---- src/agent/onefuzz-agent/build.rs | 2 +- src/agent/onefuzz-task/build.rs | 2 +- src/proxy-manager/build.rs | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/ApiService/ApiService/Functions/AgentEvents.cs b/src/ApiService/ApiService/Functions/AgentEvents.cs index 73319d06ba..88b2788153 100644 --- a/src/ApiService/ApiService/Functions/AgentEvents.cs +++ b/src/ApiService/ApiService/Functions/AgentEvents.cs @@ -71,11 +71,10 @@ private async Async.Task Post(HttpRequestData req) { } if (ev.State == NodeState.Free) { - if (!node.Managed) { - return null; - } - if (node.ReimageRequested || node.DeleteRequested) { + if (!node.Managed) { + return null; + } _log.Info($"stopping free node with reset flags: {machineId:Tag:MachineId}"); // discard result: node not used after this point _ = await _context.NodeOperations.Stop(node); diff --git a/src/agent/onefuzz-agent/build.rs b/src/agent/onefuzz-agent/build.rs index 88f1d13a80..d763c31c9d 100644 --- a/src/agent/onefuzz-agent/build.rs +++ b/src/agent/onefuzz-agent/build.rs @@ -37,7 +37,7 @@ fn print_version(include_sha: bool, include_local: bool, sha: &str) -> Result<() let mut version = read_file("../../../CURRENT_VERSION")?; if include_sha { - version.push('-'); + version.push('+'); version.push_str(sha); // if we're a non-release build, check to see if git has diff --git a/src/agent/onefuzz-task/build.rs b/src/agent/onefuzz-task/build.rs index 3b2c82f825..975c40d69e 100644 --- a/src/agent/onefuzz-task/build.rs +++ b/src/agent/onefuzz-task/build.rs @@ -37,7 +37,7 @@ fn print_version(include_sha: bool, include_local: bool, sha: &str) -> Result<() let mut version = read_file("../../../CURRENT_VERSION")?; if include_sha { - version.push('-'); + version.push('+'); version.push_str(sha); // if we're a non-release build, check to see if git has diff --git a/src/proxy-manager/build.rs b/src/proxy-manager/build.rs index 44d8fe530e..7274947d8c 100644 --- a/src/proxy-manager/build.rs +++ b/src/proxy-manager/build.rs @@ -30,7 +30,7 @@ fn print_version(include_sha: bool, include_local: bool) -> Result<(), Box