mirror of https://github.com/databricks/cli.git
4fea0219fd
## Changes While working on the v2 of #1744, I found that: * Template initialization first copies built-in templates to a temporary directory before initializing them * Reading a template's contents goes through a `filer.Filer` but is hardcoded to a local one This change updates the interface for reading templates to be `fs.FS`. This is compatible with the `embed.FS` type for the built-in templates, so they no longer have to be copied to a temporary directory before being used. The alternative is to use a `filer.Filer` throughout, but this would have required even more plumbing, and we don't need to _read_ templates, including notebooks, from the workspace filesystem (yet?). As part of making `template.Materialize` take an `fs.FS` argument, the logic to match a given argument to a particular built-in template in the `init` command has moved to sit next to its implementation. ## Tests Existing tests pass. |
||
---|---|---|
.. | ||
bundles | ||
artifacts_test.go | ||
basic_test.go | ||
bind_resource_test.go | ||
clusters_test.go | ||
dashboards_test.go | ||
deploy_test.go | ||
deploy_then_remove_resources_test.go | ||
deployment_state_test.go | ||
destroy_test.go | ||
empty_bundle_test.go | ||
environments_test.go | ||
generate_job_test.go | ||
generate_pipeline_test.go | ||
helpers.go | ||
job_metadata_test.go | ||
local_state_staleness_test.go | ||
python_wheel_test.go | ||
spark_jar_test.go | ||
validate_test.go |