Skip to content

Commit

Permalink
Merge pull request #590 from cloudflare/sort-items-before-write
Browse files Browse the repository at this point in the history
Sort items before write
  • Loading branch information
jafowler committed Jul 20, 2023
2 parents 7b6a648 + 546f3c2 commit 7030396
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/app/cf-terraforming/cmd/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,10 @@ func generateResources() func(cmd *cobra.Command, args []string) {
}
}

sort.Slice(jsonPayload, func(i, j int) bool {
return jsonPayload[i].Phase < jsonPayload[j].Phase
})

resourceCount = len(jsonPayload)
m, _ := json.Marshal(jsonPayload)
err = json.Unmarshal(m, &jsonStructData)
Expand Down

0 comments on commit 7030396

Please sign in to comment.