diff --git a/bundle/config/mutator/apply_presets.go b/bundle/config/mutator/apply_presets.go index 4b29f0057..cdccf5491 100644 --- a/bundle/config/mutator/apply_presets.go +++ b/bundle/config/mutator/apply_presets.go @@ -222,13 +222,17 @@ func (m *applyPresets) Apply(ctx context.Context, b *bundle.Bundle) diag.Diagnos dashboard.DisplayName = prefix + dashboard.DisplayName } - root := b.SyncRoot.Native() - _, ok := env.Lookup(ctx, envDatabricksRuntimeVersion) - isInWorkspace := ok && strings.HasPrefix(root, "/Workspace/") + if config.IsExplicitlyEnabled((b.Config.Presets.InPlaceDeployment)) { + root := b.SyncRoot.Native() + _, ok := env.Lookup(ctx, envDatabricksRuntimeVersion) + isInWorkspace := ok && strings.HasPrefix(root, "/Workspace/") - if !isInWorkspace { - disabled := false - b.Config.Presets.InPlaceDeployment = &disabled + if isInWorkspace { + b.Config.Workspace.FilePath = b.BundleRootPath + } else { + disabled := false + b.Config.Presets.InPlaceDeployment = &disabled + } } return diags diff --git a/bundle/config/mutator/default_workspace_paths.go b/bundle/config/mutator/default_workspace_paths.go index 9dfbf763a..02a1ddb3b 100644 --- a/bundle/config/mutator/default_workspace_paths.go +++ b/bundle/config/mutator/default_workspace_paths.go @@ -5,7 +5,6 @@ import ( "path" "github.com/databricks/cli/bundle" - "github.com/databricks/cli/bundle/config" "github.com/databricks/cli/libs/diag" ) @@ -26,10 +25,6 @@ func (m *defineDefaultWorkspacePaths) Apply(ctx context.Context, b *bundle.Bundl return diag.Errorf("unable to define default workspace paths: workspace root not defined") } - if config.IsExplicitlyEnabled((b.Config.Presets.InPlaceDeployment)) { - b.Config.Workspace.FilePath = b.BundleRootPath - } - if b.Config.Workspace.FilePath == "" { b.Config.Workspace.FilePath = path.Join(root, "files") }