fix(tiller): correct sort manifests by type

Closes #1313
pull/1315/head
Matt Butcher 8 years ago
parent 31d51a7912
commit a85c37f2a4

@ -165,5 +165,5 @@ func sortManifests(files map[string]string, apis versionSet, sort SortOrder) ([]
}
hs = append(hs, h)
}
return hs, generic, nil
return hs, sortByKind(generic, sort), nil
}

@ -19,6 +19,8 @@ package main
import (
"testing"
"github.com/ghodss/yaml"
"k8s.io/helm/pkg/proto/hapi/release"
)
@ -156,6 +158,28 @@ metadata:
}
}
// Verify the sort order
sorted := make([]manifest, len(data))
for i, s := range data {
var sh simpleHead
err := yaml.Unmarshal([]byte(s.manifest), &sh)
if err != nil {
// This is expected for manifests that are corrupt or empty.
t.Log(err)
}
sorted[i] = manifest{
content: s.manifest,
name: s.name,
head: &sh,
}
}
sorted = sortByKind(sorted, InstallOrder)
for i, m := range generic {
if m.content != sorted[i].content {
t.Errorf("Expected %q, got %q", m.content, sorted[i].content)
}
}
}
func TestVersionSet(t *testing.T) {

Loading…
Cancel
Save