Juniper / apstra-go-sdk

Go SDK for Apstra
Apache License 2.0
3 stars 0 forks source link

Sort pods in 5 stage template #276

Closed chrismarget-j closed 2 months ago

chrismarget-j commented 2 months ago

The CreatePodBasedTemplateRequest keeps track of pods as a map because we believed that pod order would not be preserved by the design API.

It turns out that order is preserved (except by our map) and that predictable (even if not prescribe-able) order is helpful in anticipating device names selected by Apstra during blueprint scaffolding.

This PR adds a quick sort.Slice() to the pods in CreatePodBasedTemplateRequest.raw()

I also cleaned up sloppy use of context.Todo() and context.Background() in the related tests.