feat: Use dbr package for runtime check

This commit is contained in:
Ilya Kuznetsov 2024-11-14 18:18:17 +01:00
parent 0004ed27a7
commit 26f24538ee
1 changed files with 1 additions and 4 deletions

View File

@ -223,11 +223,8 @@ func (m *applyPresets) Apply(ctx context.Context, b *bundle.Bundle) diag.Diagnos
}
if config.IsExplicitlyEnabled((b.Config.Presets.InPlaceDeployment)) {
root := b.SyncRoot.Native()
_, ok := env.Lookup(ctx, envDatabricksRuntimeVersion)
isInWorkspace := ok && strings.HasPrefix(root, "/Workspace/")
if isInWorkspace {
if isInWorkspace && dbr.RunsOnRuntime(ctx) {
b.Config.Workspace.FilePath = b.SyncRootPath
} else {
disabled := false