Skip to content

Commit

Permalink
Sort stack envvars before deploying stack services (#1079)
Browse files Browse the repository at this point in the history
Signed-off-by: Pablo Chico de Guzman <pchico83@gmail.com>
  • Loading branch information
pchico83 committed Oct 7, 2020
1 parent ec27818 commit bda9ae0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/cmd/stack/translate.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import (
"context"
"fmt"
"os"
"sort"
"strings"

"github.com/okteto/okteto/pkg/cmd/build"
k8Client "github.com/okteto/okteto/pkg/k8s/client"
Expand Down Expand Up @@ -58,6 +60,9 @@ func translateEnvVars(s *model.Stack) error {
for _, envFilepath := range svc.EnvFiles {
translateEnvFile(&svc, envFilepath)
}
sort.SliceStable(svc.Environment, func(i, j int) bool {
return strings.Compare(svc.Environment[i].Name, svc.Environment[j].Name) < 0
})
svc.EnvFiles = nil
s.Services[name] = svc
}
Expand Down

0 comments on commit bda9ae0

Please sign in to comment.