fix(cli): Fixed tests after outputting plan diff

This commit is contained in:
Patrick Sy 2025-10-07 15:40:27 +02:00
parent 20e3afdf0d
commit b712ae0869
Signed by: Patrick.Sy
GPG key ID: DDDC8EC51823195E
2 changed files with 9 additions and 2 deletions

View file

@ -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

View file

@ -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",