retain ordering when converting merge keys

This commit is contained in:
Brad Rydzewski 2019-05-30 16:29:11 -07:00
parent 8ea6eb1cc3
commit 596b719f96
2 changed files with 11 additions and 1 deletions

View File

@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed ### Fixed
## [1.1.1] - 2019-05-30
### Fixed
- Retain order of steps when converting legacy pipelines with merge keys, by [@bradrydzewski](https://github.com/bradrydzewski).
## [1.1.0] - 2019-05-30 ## [1.1.0] - 2019-05-30
### Fixed ### Fixed
- Support for yaml merge keys, by [@bradrydzewski](https://github.com/bradrydzewski). - Support for yaml merge keys, by [@bradrydzewski](https://github.com/bradrydzewski).

View File

@ -10,9 +10,14 @@ import (
"github.com/vinzenz/yaml" "github.com/vinzenz/yaml"
) )
type temporary struct {
Attributes map[string]interface{} `yaml:",inline"`
Pipeline yaml.MapSlice `yaml:"pipeline"`
}
// this is a helper function that expands merge keys // this is a helper function that expands merge keys
func expandMergeKeys(b []byte) ([]byte, error) { func expandMergeKeys(b []byte) ([]byte, error) {
v := map[interface{}]interface{}{} v := new(temporary)
if err := yaml.Unmarshal(b, v); err != nil { if err := yaml.Unmarshal(b, v); err != nil {
return b, err return b, err
} }