add a test for the new behavior, include import in go.mod

Signed-off-by: Andrew Lavery <laverya@umich.edu>
pull/8890/head
Andrew Lavery 5 years ago
parent ba87fce585
commit 98341b9cd3

@ -36,6 +36,7 @@ require (
github.com/stretchr/testify v1.6.1
github.com/xeipuuv/gojsonschema v1.2.0
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
gopkg.in/yaml.v2 v2.3.0 // indirect
k8s.io/api v0.19.2
k8s.io/apiextensions-apiserver v0.19.2
k8s.io/apimachinery v0.19.2

@ -94,6 +94,10 @@ func TestFuncs(t *testing.T) {
tpl: `{{ fromYamlArray . }}`,
expect: `[error unmarshaling JSON: while decoding JSON: json: cannot unmarshal object into Go value of type []interface {}]`,
vars: `hello: world`,
}, {
tpl: `{{ toYaml . }}`,
expect: `foo: this string needs to be more than 80 characters in order to trigger the wrapping behavior in gopkg.in/yaml.v2 <= 2.2.8`,
vars: map[string]interface{}{"foo": "this string needs to be more than 80 characters in order to trigger the wrapping behavior in gopkg.in/yaml.v2 <= 2.2.8"},
}, {
// This should never result in a network lookup. Regression for #7955
tpl: `{{ lookup "v1" "Namespace" "" "unlikelynamespace99999999" }}`,

Loading…
Cancel
Save