diff --git a/bundle/bundle.go b/bundle/bundle.go index 4eb2a519c4..1f3791ef2c 100644 --- a/bundle/bundle.go +++ b/bundle/bundle.go @@ -37,6 +37,7 @@ const ( patchFile = "patch.json" dataFile = "data.json" yamlDataFile = "data.yaml" + ymlDataFile = "data.yml" defaultHashingAlg = "SHA-256" DefaultSizeLimitBytes = (1024 * 1024 * 1024) // limit bundle reads to 1GB to protect against gzip bombs DeltaBundleType = "delta" @@ -555,7 +556,7 @@ func (r *Reader) Read() (Bundle, error) { return bundle, err } - } else if filepath.Base(path) == yamlDataFile { + } else if filepath.Base(path) == yamlDataFile || filepath.Base(path) == ymlDataFile { if r.lazyLoadingMode { raw = append(raw, Raw{Path: path, Value: buf.Bytes()}) continue diff --git a/bundle/bundle_test.go b/bundle/bundle_test.go index e92ab33a8f..7032c59d2d 100644 --- a/bundle/bundle_test.go +++ b/bundle/bundle_test.go @@ -186,6 +186,7 @@ func testReadBundle(t *testing.T, baseDir string) { {"/a/b/c/data.json", "[1,2,3]"}, {"/a/b/d/data.json", "true"}, {"/a/b/y/data.yaml", `foo: 1`}, + {"/a/b/g/data.yml", "1"}, {"/example/example.rego", `package example`}, {"/policy.wasm", `legacy-wasm-module`}, {wasmResolverPath, `wasm-module`}, @@ -218,6 +219,7 @@ func testReadBundle(t *testing.T, baseDir string) { "b": map[string]interface{}{ "c": []interface{}{json.Number("1"), json.Number("2"), json.Number("3")}, "d": true, + "g": json.Number("1"), "y": map[string]interface{}{ "foo": json.Number("1"), },