You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update filenames used by bundle generate to use .<resource-type>.yml (#1901)
## Changes
Update filenames used by bundle generate to use '.resource-type.yml'
Similar to [Add sub-extension to resource files in built-in templates by
shreyas-goenka · Pull Request #1777 ·
databricks/cli](#1777)
---------
Co-authored-by: shreyas-goenka <[email protected]>
// User might continuously run generate command to update their bundle jobs with any changes made in Databricks UI.
92
+
// Due to changing in the generated file names, we need to first rename existing resource file to the new name.
93
+
// Otherwise users can end up with duplicated resources.
94
+
err=os.Rename(oldFilename, filename)
95
+
iferr!=nil&&!errors.Is(err, fs.ErrNotExist) {
96
+
returnfmt.Errorf("failed to rename file %s. DABs uses the resource type as a sub-extension for generated content, please rename it to %s, err: %w", oldFilename, filename, err)
// User might continuously run generate command to update their bundle jobs with any changes made in Databricks UI.
92
+
// Due to changing in the generated file names, we need to first rename existing resource file to the new name.
93
+
// Otherwise users can end up with duplicated resources.
94
+
err=os.Rename(oldFilename, filename)
95
+
iferr!=nil&&!errors.Is(err, fs.ErrNotExist) {
96
+
returnfmt.Errorf("failed to rename file %s. DABs uses the resource type as a sub-extension for generated content, please rename it to %s, err: %w", oldFilename, filename, err)
97
+
}
98
+
87
99
saver:=yamlsaver.NewSaverWithStyle(
88
100
// Including all PipelineSpec and nested fields which are map[string]string type
0 commit comments