Skip to content

Commit c632563

Browse files
authored
Run bundle summary with --force-pull (#1181)
Fixes a problem with projects that use older version of the databricks provider (than the one with ship the extension with). With the updated logic we always regenerating internal terraform state when we execute `summary` command, which sets the correct provider version for the terraform
1 parent ddd1ce4 commit c632563

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

packages/databricks-vscode/src/bundle/models/BundleRemoteStateModel.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ export class BundleRemoteStateModel extends BaseModelWithStateCache<BundleRemote
4444
public target: string | undefined;
4545
public authProvider: AuthProvider | undefined;
4646
protected mutex = new Mutex();
47-
private refreshInterval: NodeJS.Timeout | undefined;
4847
private logger = logging.NamedLogger.getOrCreate(Loggers.Bundle);
4948

5049
constructor(
@@ -149,8 +148,5 @@ export class BundleRemoteStateModel extends BaseModelWithStateCache<BundleRemote
149148

150149
dispose() {
151150
super.dispose();
152-
if (this.refreshInterval !== undefined) {
153-
clearInterval(this.refreshInterval);
154-
}
155151
}
156152
}

packages/databricks-vscode/src/cli/CliWrapper.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,17 @@ export class CliWrapper {
334334
configfilePath?: string,
335335
logger?: logging.NamedLogger
336336
) {
337-
const cmd = [this.cliPath, "bundle", "summary", "--target", target];
337+
const cmd = [
338+
this.cliPath,
339+
"bundle",
340+
"summary",
341+
"--target",
342+
target,
343+
// Forces the CLI to regenerate local terraform state and pull the remote state.
344+
// Regenerating terraform state is useful when we want to ensure that the provider version
345+
// used in the local state matches the bundled version we supply with the extension.
346+
"--force-pull",
347+
];
338348

339349
logger?.info(
340350
`Refreshing bundle configuration for target ${target}...`,

0 commit comments

Comments
 (0)