From b712ae0869e4f8a2f159fec516d2fdba67c04cbd Mon Sep 17 00:00:00 2001 From: Patrick Sy Date: Tue, 7 Oct 2025 15:40:27 +0200 Subject: [PATCH] fix(cli): Fixed tests after outputting plan diff --- internal/apply/planner.go | 9 +++++++-- internal/apply/planner_test.go | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/internal/apply/planner.go b/internal/apply/planner.go index a9219ea..4e2a3e0 100644 --- a/internal/apply/planner.go +++ b/internal/apply/planner.go @@ -391,8 +391,13 @@ func (p *EdgeConnectPlanner) compareAppStates(current, desired *AppState) ([]str // Compare outbound connections outboundChanges := p.compareOutboundConnections(current.OutboundConnections, desired.OutboundConnections) if len(outboundChanges) > 0 { - changes = append(changes, "Outbound connections changed:") - changes = append(changes, outboundChanges...) + sb:= strings.Builder{} + sb.WriteString("Outbound connections changed:\n") + for _, change := range outboundChanges { + sb.WriteString(change) + sb.WriteString("\n") + } + changes = append(changes, sb.String()) } return changes, manifestChanged diff --git a/internal/apply/planner_test.go b/internal/apply/planner_test.go index cd9ef31..358ae41 100644 --- a/internal/apply/planner_test.go +++ b/internal/apply/planner_test.go @@ -185,6 +185,7 @@ func TestPlanExistingDeploymentNoChanges(t *testing.T) { // Note: We would calculate expected manifest hash here when API supports it // Mock existing app with same manifest hash and outbound connections + manifestContent := "apiVersion: v1\nkind: Pod\nmetadata:\n name: test\n" existingApp := &edgeconnect.App{ Key: edgeconnect.AppKey{ Organization: "testorg", @@ -192,6 +193,7 @@ func TestPlanExistingDeploymentNoChanges(t *testing.T) { Version: "1.0.0", }, Deployment: "kubernetes", + DeploymentManifest: manifestContent, RequiredOutboundConnections: []edgeconnect.SecurityRule{ { Protocol: "tcp",