From ea9c2857a7b747108493175a2a8b99b7ef116d26 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Sun, 22 Mar 2026 14:25:09 -0400 Subject: [PATCH] fix(docker,cli): add LmxProxy.Client to Docker build, fix set-bindings JSON parsing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Docker: include lmxproxy/src/ZB.MOM.WW.LmxProxy.Client in build context so the project reference resolves during container image build. CLI: fix set-bindings JSON parsing — use JsonElement.GetString()/GetInt32() instead of object.ToString() which returned null for deserialized elements. --- docker/Dockerfile | 4 +++- src/ScadaLink.CLI/Commands/InstanceCommands.cs | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 8f4c967..922f5e3 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -21,14 +21,16 @@ COPY src/ScadaLink.ClusterInfrastructure/ScadaLink.ClusterInfrastructure.csproj COPY src/ScadaLink.InboundAPI/ScadaLink.InboundAPI.csproj src/ScadaLink.InboundAPI/ COPY src/ScadaLink.ConfigurationDatabase/ScadaLink.ConfigurationDatabase.csproj src/ScadaLink.ConfigurationDatabase/ COPY src/ScadaLink.ManagementService/ScadaLink.ManagementService.csproj src/ScadaLink.ManagementService/ +COPY lmxproxy/src/ZB.MOM.WW.LmxProxy.Client/ZB.MOM.WW.LmxProxy.Client.csproj lmxproxy/src/ZB.MOM.WW.LmxProxy.Client/ -# Restore NuGet packages via Host project (follows ProjectReferences to all 17 dependencies) +# Restore NuGet packages via Host project (follows ProjectReferences to all dependencies) # This layer is cached until any .csproj changes — source-only changes skip restore entirely RUN dotnet restore src/ScadaLink.Host/ScadaLink.Host.csproj # Stage 2: Build + Publish FROM restore AS build COPY src/ src/ +COPY lmxproxy/src/ZB.MOM.WW.LmxProxy.Client/ lmxproxy/src/ZB.MOM.WW.LmxProxy.Client/ RUN dotnet publish src/ScadaLink.Host/ScadaLink.Host.csproj \ -c Release -o /app/publish diff --git a/src/ScadaLink.CLI/Commands/InstanceCommands.cs b/src/ScadaLink.CLI/Commands/InstanceCommands.cs index a039e89..bb9193b 100644 --- a/src/ScadaLink.CLI/Commands/InstanceCommands.cs +++ b/src/ScadaLink.CLI/Commands/InstanceCommands.cs @@ -51,10 +51,10 @@ public static class InstanceCommands { var id = result.GetValue(idOption); var bindingsJson = result.GetValue(bindingsOption)!; - var pairs = System.Text.Json.JsonSerializer.Deserialize>>(bindingsJson) + var pairs = System.Text.Json.JsonSerializer.Deserialize>>(bindingsJson) ?? throw new InvalidOperationException("Invalid bindings JSON"); var bindings = pairs.Select(p => - (p[0].ToString()!, int.Parse(p[1].ToString()!))).ToList(); + (p[0].GetString()!, p[1].GetInt32())).ToList(); return await CommandHelpers.ExecuteCommandAsync( result, urlOption, formatOption, usernameOption, passwordOption, new SetConnectionBindingsCommand(id, bindings));