Skip to content

Commit

Permalink
plz: add deterministic order of env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
yorugac committed Jul 19, 2024
1 parent 20f0d5f commit f737f89
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/cloud/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cloud

import (
"fmt"
"sort"

"go.k6.io/k6/cloudapi"
"go.k6.io/k6/lib/types"
Expand Down Expand Up @@ -86,6 +87,11 @@ func (lz *LZConfig) EnvVars() []corev1.EnvVar {
}
i++
}
// to have deterministic order in the array
sort.Slice(ev, func(i, j int) bool {
return ev[i].Name < ev[j].Name
})

return ev
}

Expand Down

0 comments on commit f737f89

Please sign in to comment.