mirror of https://github.com/databricks/cli.git
accept JSON includes (#2265)
#2201 disabled using JSON as part of a bundle definition. I believe this was not intended. ## Changes Accept json files as includes, just as YAML files. ## Tests Covered by the tests in #2201
This commit is contained in:
parent
d86ad91899
commit
84b694f2a1
|
@ -1,7 +1,7 @@
|
||||||
Error: Files in the 'include' configuration section must be YAML files.
|
Error: Files in the 'include' configuration section must be YAML or JSON files.
|
||||||
in databricks.yml:5:4
|
in databricks.yml:5:4
|
||||||
|
|
||||||
The file test.py in the 'include' configuration section is not a YAML file, and only YAML files are supported. To include files to sync, specify them in the 'sync.include' configuration section instead.
|
The file test.py in the 'include' configuration section is not a YAML or JSON file, and only such files are supported. To include files to sync, specify them in the 'sync.include' configuration section instead.
|
||||||
|
|
||||||
Name: non_yaml_in_includes
|
Name: non_yaml_in_includes
|
||||||
|
|
||||||
|
|
|
@ -71,11 +71,11 @@ func (m *processRootIncludes) Apply(ctx context.Context, b *bundle.Bundle) diag.
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
seen[rel] = true
|
seen[rel] = true
|
||||||
if filepath.Ext(rel) != ".yaml" && filepath.Ext(rel) != ".yml" {
|
if filepath.Ext(rel) != ".yaml" && filepath.Ext(rel) != ".yml" && filepath.Ext(rel) != ".json" {
|
||||||
diags = diags.Append(diag.Diagnostic{
|
diags = diags.Append(diag.Diagnostic{
|
||||||
Severity: diag.Error,
|
Severity: diag.Error,
|
||||||
Summary: "Files in the 'include' configuration section must be YAML files.",
|
Summary: "Files in the 'include' configuration section must be YAML or JSON files.",
|
||||||
Detail: fmt.Sprintf("The file %s in the 'include' configuration section is not a YAML file, and only YAML files are supported. To include files to sync, specify them in the 'sync.include' configuration section instead.", rel),
|
Detail: fmt.Sprintf("The file %s in the 'include' configuration section is not a YAML or JSON file, and only such files are supported. To include files to sync, specify them in the 'sync.include' configuration section instead.", rel),
|
||||||
Locations: b.Config.GetLocations(fmt.Sprintf("include[%d]", i)),
|
Locations: b.Config.GetLocations(fmt.Sprintf("include[%d]", i)),
|
||||||
})
|
})
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in New Issue