Skip to content

Commit 898bbaf

Browse files
committed
fixup! fix provisioner, add resource test
1 parent f35cba4 commit 898bbaf

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

provisioner/terraform/resources.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package terraform
33
import (
44
"context"
55
"fmt"
6-
"slices"
76
"strings"
87

98
"github.com/awalterschulze/gographviz"
@@ -622,17 +621,6 @@ func ConvertState(ctx context.Context, modules []*tfjson.StateModule, rawGraph s
622621
}
623622
}
624623
}
625-
// Stable order.
626-
for _, agents := range resourceAgents {
627-
for _, agent := range agents {
628-
slices.SortStableFunc(agent.Devcontainers, func(a, b *proto.Devcontainer) int {
629-
if n := strings.Compare(a.WorkspaceFolder, b.WorkspaceFolder); n != 0 {
630-
return n
631-
}
632-
return strings.Compare(a.ConfigPath, b.ConfigPath)
633-
})
634-
}
635-
}
636624

637625
// Associate metadata blocks with resources.
638626
resourceMetadata := map[string][]*proto.Resource_Metadata{}

provisioner/terraform/resources_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,6 +1403,9 @@ func sortResources(resources []*proto.Resource) {
14031403
sort.Slice(agent.Scripts, func(i, j int) bool {
14041404
return agent.Scripts[i].DisplayName < agent.Scripts[j].DisplayName
14051405
})
1406+
sort.Slice(agent.Devcontainers, func(i, j int) bool {
1407+
return agent.Devcontainers[i].WorkspaceFolder < agent.Devcontainers[j].WorkspaceFolder
1408+
})
14061409
}
14071410
sort.Slice(resource.Agents, func(i, j int) bool {
14081411
return resource.Agents[i].Name < resource.Agents[j].Name

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy