Skip to content

Commit

Permalink
Fixed infra defaults for deploy commands (#1917)
Browse files Browse the repository at this point in the history
  • Loading branch information
kessler-frost authored Jan 22, 2024
1 parent 3e8aa09 commit 2f46195
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- Fixed the scenario where any deploy commands would fail if the user had a non deploy compatible plugin installed
- Fixed deploy commands' default value of plugins not being propagated to the tfvars file

## [0.233.0-rc.0] - 2024-01-07

Expand Down
11 changes: 11 additions & 0 deletions covalent/cloud_resource_manager/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,17 @@ def up(self, print_callback: Callable, dry_run: bool = True) -> None:
# Setup terraform infra variables as passed by the user
tf_vars_env_dict = os.environ.copy()

# Write the default values to the terraform.tfvars file
infra_settings = self.ExecutorInfraDefaults.schema()["properties"]
with open(tfvars_file, "w", encoding="utf-8") as f:
for key, value in infra_settings.items():
if "default" in value:
tf_vars_env_dict[f"TF_VAR_{key}"] = value["default"]

if value["default"] != "":
f.write(f'{key}="{value["default"]}"\n')

# Overwrite the default values with the user passed values
if self.executor_options:
with open(tfvars_file, "w", encoding="utf-8") as f:
for key, value in self.executor_options.items():
Expand Down

0 comments on commit 2f46195

Please sign in to comment.