Skip to content

Commit

Permalink
#231 Invoking kompose --bundle X.dab convert --stdout will produce tw…
Browse files Browse the repository at this point in the history
…o differently ordered results (#338)
  • Loading branch information
cab105 authored Dec 18, 2016
1 parent 7bda857 commit 072d481
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 072d481

Please sign in to comment.