Skip to content

Commit 0386ee6

Browse files
Return error for bind and unbind with deployment metadata service
Co-authored-by: Isaac
1 parent 6e19c93 commit 0386ee6

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

bundle/deploy/lock/lock.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package lock
22

33
import (
44
"context"
5+
"fmt"
56

67
"github.com/databricks/cli/bundle"
78
"github.com/databricks/cli/bundle/env"
@@ -46,10 +47,25 @@ func NewDeploymentLock(ctx context.Context, b *bundle.Bundle, goal Goal) Deploym
4647
if ok {
4748
return newMetadataServiceLock(b, versionType)
4849
}
50+
// Bind and unbind are not yet supported with the deployment metadata service.
51+
return &unsupportedLock{goal: goal}
4952
}
5053
return newWorkspaceFilesystemLock(b, goal)
5154
}
5255

56+
// unsupportedLock is returned when a goal is not supported with DMS.
57+
type unsupportedLock struct {
58+
goal Goal
59+
}
60+
61+
func (l *unsupportedLock) Acquire(context.Context) error {
62+
return fmt.Errorf("%s is not supported with the deployment metadata service", l.goal)
63+
}
64+
65+
func (l *unsupportedLock) Release(context.Context, DeploymentStatus) error {
66+
return nil
67+
}
68+
5369
func goalToVersionType(goal Goal) (tmpdms.VersionType, bool) {
5470
switch goal {
5571
case GoalDeploy:

0 commit comments

Comments
 (0)