Disable locking for development mode

This commit is contained in:
Lennart Kats 2024-03-20 16:32:21 +01:00
parent 0ef93c2502
commit b7e43af4e2
No known key found for this signature in database
GPG Key ID: 1EB8B57673197023
2 changed files with 10 additions and 0 deletions

View File

@ -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 {

View File

@ -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.