Skip to content

Commit 715a18b

Browse files
bundle/deploy/lock: rename CloseVersion to CompleteVersion
Co-authored-by: Shreyas Goenka <shreyas.goenka@databricks.com>
1 parent 3c0816e commit 715a18b

5 files changed

Lines changed: 9 additions & 9 deletions

File tree

bundle/deploy/lock/lock.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,19 @@ const (
3030
//
3131
// DMS semantics: CreateVersion atomically succeeds only if no other deployment
3232
// is in progress and the returned version is exactly +1 to the latest closed
33-
// version, providing serialized optimistic concurrency control. CloseVersion
33+
// version, providing serialized optimistic concurrency control. CompleteVersion
3434
// records the outcome.
3535
//
3636
// Workspace-filesystem semantics: CreateVersion acquires the workspace lock
37-
// file; CloseVersion releases it. The returned version number is a placeholder
37+
// file; CompleteVersion releases it. The returned version number is a placeholder
3838
// (the lock file does not track a monotonic counter today).
3939
type DeploymentManager interface {
4040
// CreateVersion begins a new deployment for the given goal.
4141
// Returns the version number assigned by the backend.
4242
CreateVersion(ctx context.Context, goal Goal) (int64, error)
4343

44-
// CloseVersion finalizes the deployment version created by CreateVersion.
45-
CloseVersion(ctx context.Context, version int64, status DeploymentStatus) error
44+
// CompleteVersion finalizes the deployment version created by CreateVersion.
45+
CompleteVersion(ctx context.Context, version int64, status DeploymentStatus) error
4646
}
4747

4848
// NewDeploymentManager returns a DeploymentManager backed by the workspace

bundle/deploy/lock/workspace_filesystem.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func (l *workspaceFilesystemLock) CreateVersion(ctx context.Context, goal Goal)
6363
return 0, nil
6464
}
6565

66-
func (l *workspaceFilesystemLock) CloseVersion(ctx context.Context, _ int64, _ DeploymentStatus) error {
66+
func (l *workspaceFilesystemLock) CompleteVersion(ctx context.Context, _ int64, _ DeploymentStatus) error {
6767
// Return early if locking is disabled.
6868
if !l.enabled {
6969
log.Infof(ctx, "Skipping; locking is disabled")

bundle/phases/bind.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func Bind(ctx context.Context, b *bundle.Bundle, opts *terraform.BindOptions, en
3535
if logdiag.HasError(ctx) {
3636
status = lock.DeploymentFailure
3737
}
38-
if err := dm.CloseVersion(ctx, version, status); err != nil {
38+
if err := dm.CompleteVersion(ctx, version, status); err != nil {
3939
logdiag.LogError(ctx, err)
4040
}
4141
}()
@@ -139,7 +139,7 @@ func Unbind(ctx context.Context, b *bundle.Bundle, bundleType, tfResourceType, r
139139
if logdiag.HasError(ctx) {
140140
status = lock.DeploymentFailure
141141
}
142-
if err := dm.CloseVersion(ctx, version, status); err != nil {
142+
if err := dm.CompleteVersion(ctx, version, status); err != nil {
143143
logdiag.LogError(ctx, err)
144144
}
145145
}()

bundle/phases/deploy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ func Deploy(ctx context.Context, b *bundle.Bundle, outputHandler sync.OutputHand
143143
if logdiag.HasError(ctx) {
144144
status = lock.DeploymentFailure
145145
}
146-
if err := dm.CloseVersion(ctx, version, status); err != nil {
146+
if err := dm.CompleteVersion(ctx, version, status); err != nil {
147147
logdiag.LogError(ctx, err)
148148
}
149149
}()

bundle/phases/destroy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func Destroy(ctx context.Context, b *bundle.Bundle, engine engine.EngineType) {
132132
if logdiag.HasError(ctx) {
133133
status = lock.DeploymentFailure
134134
}
135-
if err := dm.CloseVersion(ctx, version, status); err != nil {
135+
if err := dm.CompleteVersion(ctx, version, status); err != nil {
136136
logdiag.LogError(ctx, err)
137137
}
138138
}()

0 commit comments

Comments
 (0)