From f737f896054a3ac4918e727e13b044351d058872 Mon Sep 17 00:00:00 2001 From: Olha Yevtushenko Date: Fri, 19 Jul 2024 17:42:17 +0300 Subject: [PATCH] plz: add deterministic order of env vars --- pkg/cloud/types.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/cloud/types.go b/pkg/cloud/types.go index 59b10afb..ea021cfe 100644 --- a/pkg/cloud/types.go +++ b/pkg/cloud/types.go @@ -2,6 +2,7 @@ package cloud import ( "fmt" + "sort" "go.k6.io/k6/cloudapi" "go.k6.io/k6/lib/types" @@ -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 }