mirror of https://github.com/databricks/cli.git
fix: Additional comments for source-linked deployment
This commit is contained in:
parent
dc3a157fdc
commit
37e3b1b20e
|
@ -56,6 +56,7 @@ func (m *applySourceLinkedDeploymentPreset) Apply(ctx context.Context, b *bundle
|
||||||
b.Config.Presets.SourceLinkedDeployment = &enabled
|
b.Config.Presets.SourceLinkedDeployment = &enabled
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This mutator runs before workspace paths are defaulted so it's safe to check for the user-defined value
|
||||||
if b.Config.Workspace.FilePath != "" && config.IsExplicitlyEnabled(b.Config.Presets.SourceLinkedDeployment) {
|
if b.Config.Workspace.FilePath != "" && config.IsExplicitlyEnabled(b.Config.Presets.SourceLinkedDeployment) {
|
||||||
path := dyn.NewPath(dyn.Key("targets"), dyn.Key(target), dyn.Key("workspace"), dyn.Key("file_path"))
|
path := dyn.NewPath(dyn.Key("targets"), dyn.Key(target), dyn.Key("workspace"), dyn.Key("file_path"))
|
||||||
|
|
||||||
|
@ -63,6 +64,7 @@ func (m *applySourceLinkedDeploymentPreset) Apply(ctx context.Context, b *bundle
|
||||||
diag.Diagnostic{
|
diag.Diagnostic{
|
||||||
Severity: diag.Warning,
|
Severity: diag.Warning,
|
||||||
Summary: "workspace.file_path setting will be ignored in source-linked deployment mode",
|
Summary: "workspace.file_path setting will be ignored in source-linked deployment mode",
|
||||||
|
Detail: "In source-linked deployment files are not copied to the destination and resources use source files instead",
|
||||||
Paths: []dyn.Path{
|
Paths: []dyn.Path{
|
||||||
path[2:],
|
path[2:],
|
||||||
},
|
},
|
||||||
|
|
|
@ -54,6 +54,7 @@ func (m *compute) Apply(_ context.Context, b *bundle.Bundle) diag.Diagnostics {
|
||||||
|
|
||||||
// Set file upload destination of the bundle in metadata
|
// Set file upload destination of the bundle in metadata
|
||||||
b.Metadata.Config.Workspace.FilePath = b.Config.Workspace.FilePath
|
b.Metadata.Config.Workspace.FilePath = b.Config.Workspace.FilePath
|
||||||
|
// In source-linked deployment files are not copied and resources use source files, therefore we use sync path as file path in metadata
|
||||||
if config.IsExplicitlyEnabled(b.Config.Presets.SourceLinkedDeployment) {
|
if config.IsExplicitlyEnabled(b.Config.Presets.SourceLinkedDeployment) {
|
||||||
b.Metadata.Config.Workspace.FilePath = b.SyncRootPath
|
b.Metadata.Config.Workspace.FilePath = b.SyncRootPath
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue