Skip to content

Commit 0872680

Browse files
committed
lint & fix
1 parent 033a2dd commit 0872680

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

bundle/direct/bundle_apply.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func (b *DeploymentBundle) Apply(ctx context.Context, client *databricks.Workspa
5151
action := entry.Action
5252
errorPrefix := fmt.Sprintf("cannot %s %s", action, resourceKey)
5353
if migrateMode {
54-
errorPrefix = fmt.Sprintf("cannot migrate %s", resourceKey)
54+
errorPrefix = "cannot migrate " + resourceKey
5555
}
5656

5757
at := deployplan.ActionTypeFromString(action)

bundle/statemgmt/state_pull.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,28 +116,26 @@ func PullResourcesState(ctx context.Context, b *bundle.Bundle, alwaysPull Always
116116
}
117117

118118
var winner *StateDesc
119-
var directDeployment bool
120119

121120
if len(states) == 0 {
122121
// no local or remote state; set directDeployment based on env vars
123-
isDirect, err := getDirectDeploymentEnv(ctx)
122+
directDeployment, err := getDirectDeploymentEnv(ctx)
124123
if err != nil {
125124
logdiag.LogError(ctx, err)
126125
return ctx, nil
127126
}
128127
winner = &StateDesc{
129-
IsDirect: isDirect,
128+
IsDirect: directDeployment,
130129
IsLocal: true,
131130
// Lineage and Serial are empty
132131
}
133132
} else {
134133
winner = states[len(states)-1]
135-
directDeployment = winner.IsDirect
136134
}
137135

138136
engine := "direct"
139137

140-
if !directDeployment {
138+
if !winner.IsDirect {
141139
engine = "terraform"
142140
}
143141

cmd/bundle/deployment/migrate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ To start using direct engine, deploy with DATABRICKS_BUNDLE_ENGINE=direct env va
7373
_, localPath := b.StateFilenameDirect(ctx)
7474
tempStatePath := localPath + ".temp-migration"
7575
if _, err = os.Stat(tempStatePath); err == nil {
76-
return fmt.Errorf("temporary state file %s already exists, another migration is in progress or was interrupated. In the latter case, delete the file.", tempStatePath)
76+
return fmt.Errorf("temporary state file %s already exists, another migration is in progress or was interrupated. In the latter case, delete the file", tempStatePath)
7777
}
7878
if _, err = os.Stat(localPath); err == nil {
7979
return fmt.Errorf("state file %s already exists", localPath)

0 commit comments

Comments
 (0)