Skip to content

Commit

Permalink
kubernetes#231 Invoking kompose --bundle X.dab convert --stdout will …
Browse files Browse the repository at this point in the history
…produce two differently ordered results
  • Loading branch information
cab105 committed Dec 15, 2016
1 parent 78845d3 commit 01f7e89
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pkg/transformer/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package kubernetes

import (
"fmt"
"sort"
"strconv"
"time"

Expand Down Expand Up @@ -353,7 +354,15 @@ func (k *Kubernetes) Transform(komposeObject kobject.KomposeObject, opt kobject.
// this will hold all the converted data
var allobjects []runtime.Object

for name, service := range komposeObject.ServiceConfigs {
// Need to ensure the kubernetes objects are in a consistent order
var sortedKeys []string
for name, _ := range komposeObject.ServiceConfigs {
sortedKeys = append(sortedKeys, name)
}
sort.Strings(sortedKeys)

for _, name := range sortedKeys {
service := komposeObject.ServiceConfigs[name]
var objects []runtime.Object

// Generate pod only and nothing more
Expand Down

0 comments on commit 01f7e89

Please sign in to comment.