Skip to content

Commit

Permalink
Merge pull request #8528 from mitch000001/automated-cherry-pick-of-#8…
Browse files Browse the repository at this point in the history
…247-origin-release-1.16

Automated cherry pick of #8247 origin/release-1.16
  • Loading branch information
k8s-ci-robot authored Feb 12, 2020
2 parents 404cb9c + 8792bcc commit dfe6aab
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions pkg/model/bootstrapscript.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"encoding/base64"
"fmt"
"os"
"sort"
"strconv"
"strings"
"text/template"
Expand Down Expand Up @@ -150,9 +151,17 @@ func (b *BootstrapScript) ResourceNodeUp(ig *kops.InstanceGroup, cluster *kops.C
if err != nil {
return "", err
}

// Sort keys to have a stable sequence of "export xx=xxx"" statements
var keys []string
for k := range env {
keys = append(keys, k)
}
sort.Strings(keys)

var b bytes.Buffer
for k, v := range env {
b.WriteString(fmt.Sprintf("export %s=%s\n", k, v))
for _, k := range keys {
b.WriteString(fmt.Sprintf("export %s=%s\n", k, env[k]))
}
return b.String(), nil
},
Expand Down

0 comments on commit dfe6aab

Please sign in to comment.