Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed infra defaults for deploy commands #1917

Merged
merged 1 commit into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
# 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"]

Check warning on line 433 in covalent/cloud_resource_manager/core.py

View check run for this annotation

Codecov / codecov/patch

covalent/cloud_resource_manager/core.py#L432-L433

Added lines #L432 - L433 were not covered by tests

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

Check warning on line 436 in covalent/cloud_resource_manager/core.py

View check run for this annotation

Codecov / codecov/patch

covalent/cloud_resource_manager/core.py#L435-L436

Added lines #L435 - L436 were not covered by tests

# 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
Loading