diff --git a/vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/types/bool.go b/vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/types/bool.go new file mode 100644 index 000000000..868ff3b24 --- /dev/null +++ b/vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/types/bool.go @@ -0,0 +1,28 @@ +package types + +import "strconv" + +// BoolTrue is a custom Yaml boolean type that defaults to true. +type BoolTrue struct { + value bool +} + +// UnmarshalYAML implements custom Yaml unmarshaling. +func (b *BoolTrue) UnmarshalYAML(unmarshal func(interface{}) error) error { + var s string + err := unmarshal(&s) + if err != nil { + return err + } + + value, err := strconv.ParseBool(s) + if err == nil { + b.value = !value + } + return nil +} + +// Bool returns the bool value. +func (b BoolTrue) Bool() bool { + return !b.value +} \ No newline at end of file diff --git a/vendor/vendor.json b/vendor/vendor.json index aa4b3689c..7db1c0bac 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -83,6 +83,12 @@ "revision": "5cc866493ddb8e321050e061a926a9af0080d4de", "revisionTime": "2017-05-06T00:17:19Z" }, + { + "checksumSHA1": "L7Q5qJmPITNmvFEEaj5MPwCWFRk=", + "path": "github.com/cncd/pipeline/pipeline/frontend/yaml/types", + "revision": "5cc866493ddb8e321050e061a926a9af0080d4de", + "revisionTime": "2017-05-06T00:17:19Z" + }, { "checksumSHA1": "2/3f3oNmxXy5kcrRLCFa24Oc9O4=", "path": "github.com/cncd/pipeline/pipeline/interrupt",