Skip to content

Commit

Permalink
fail gracefully on deployment update (#54)
Browse files Browse the repository at this point in the history
__NODOCS__
  • Loading branch information
EarthmanT authored Apr 11, 2021
1 parent c3cca27 commit e8f9e64
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
0.15.5:
- Fail gracefully on deployment update when downloading TF binary.
0.15.4:
- Fix bug for deployment update.
0.15.3:
Expand Down
18 changes: 18 additions & 0 deletions cloudify_tf/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,24 @@ def with_terraform(func):
@wraps(func)
def f(*args, **kwargs):
ctx = kwargs['ctx']
if ctx.workflow_id == 'update' and not is_using_existing(target=False):
ctx.logger.error(
'The node type cloudify.nodes.terraform, which governs the '
'Terraform binary installation method is not currently '
'supported by deployment update. Deployment update rolls back '
'changed nodes, deleting the deployment directory in the '
'process. If only the cloudify.nodes.terraform.Module is '
'changed, then the Terraform binary may not be present in '
'the manager filesystem. This will result in corruption of '
'the Cloudify deployment. Create a new deployment with the '
'cloudify.nodes.terraform configured for local binary use. '
'You can do this by setting '
'terraform_config.use_external_resource to True, and '
'terraform_config.executable_path to the path of an '
'existing Terraform binary on the Cloudify manager file '
'system. If necessary, contact your administrator about '
'uploading Terraform binaries to the Cloudify manager.')
return
with get_terraform_source() as terraform_source:
tf = Terraform.from_ctx(ctx, terraform_source)
kwargs['tf'] = tf
Expand Down
2 changes: 1 addition & 1 deletion plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins:
tf:
executor: central_deployment_agent
package_name: cloudify-terraform-plugin
package_version: '0.15.4'
package_version: '0.15.5'

dsl_definitions:

Expand Down

0 comments on commit e8f9e64

Please sign in to comment.