From b7e43af4e2b98d57a4d1d591ad0458743825c704 Mon Sep 17 00:00:00 2001 From: Lennart Kats Date: Wed, 20 Mar 2024 16:32:21 +0100 Subject: [PATCH] Disable locking for development mode --- bundle/deploy/lock/acquire.go | 5 +++++ bundle/deploy/lock/release.go | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/bundle/deploy/lock/acquire.go b/bundle/deploy/lock/acquire.go index 69e6663fc..4db6397b4 100644 --- a/bundle/deploy/lock/acquire.go +++ b/bundle/deploy/lock/acquire.go @@ -6,6 +6,7 @@ import ( "fmt" "github.com/databricks/cli/bundle" + "github.com/databricks/cli/bundle/config" "github.com/databricks/cli/libs/filer" "github.com/databricks/cli/libs/locker" "github.com/databricks/cli/libs/log" @@ -39,6 +40,10 @@ func (m *acquire) Apply(ctx context.Context, b *bundle.Bundle) error { log.Infof(ctx, "Skipping; locking is disabled") return nil } + if b.Config.Bundle.Mode == config.Development { + log.Infof(ctx, "Skipping; locking is disabled in development mode") + return nil + } err := m.init(b) if err != nil { diff --git a/bundle/deploy/lock/release.go b/bundle/deploy/lock/release.go index 4ea47c2f9..b05f5b7cf 100644 --- a/bundle/deploy/lock/release.go +++ b/bundle/deploy/lock/release.go @@ -5,6 +5,7 @@ import ( "fmt" "github.com/databricks/cli/bundle" + "github.com/databricks/cli/bundle/config" "github.com/databricks/cli/libs/locker" "github.com/databricks/cli/libs/log" ) @@ -36,6 +37,10 @@ func (m *release) Apply(ctx context.Context, b *bundle.Bundle) error { log.Infof(ctx, "Skipping; locking is disabled") return nil } + if b.Config.Bundle.Mode == config.Development { + log.Infof(ctx, "Skipping; locking is disabled in development mode") + return nil + } // Return early if the locker is not set. // It is likely an error occurred prior to initialization of the locker instance.