File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -4,11 +4,11 @@ import (
4
4
"encoding/json"
5
5
"errors"
6
6
"fmt"
7
- "io/ioutil"
8
- "os"
9
-
10
7
"github.com/ghodss/yaml"
11
8
"helm.sh/helm/v3/pkg/releaseutil"
9
+ "io/ioutil"
10
+ "os"
11
+ "sort"
12
12
)
13
13
14
14
type FileCollector struct {
@@ -60,9 +60,17 @@ func (c *FileCollector) Get() ([]map[string]interface{}, error) {
60
60
// let's try YAML too
61
61
if err != nil {
62
62
manifests := releaseutil .SplitManifests (string (input ))
63
- for _ , m := range manifests {
63
+
64
+ // keep output stable
65
+ var keys []string
66
+ for key := range manifests {
67
+ keys = append (keys , key )
68
+ }
69
+ sort .Sort (releaseutil .BySplitManifestsOrder (keys ))
70
+
71
+ for _ , k := range keys {
64
72
var manifest map [string ]interface {}
65
- err := yaml .Unmarshal ([]byte (m ), & manifest )
73
+ err := yaml .Unmarshal ([]byte (manifests [ k ] ), & manifest )
66
74
if err != nil {
67
75
return nil , fmt .Errorf ("failed to parse file %s: %v" , f , err )
68
76
}
You can’t perform that action at this time.
0 commit comments