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

Add a conditional replace explanation #336

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
9 changes: 7 additions & 2 deletions lib/stack_master/change_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,11 @@ def id
private

def display_resource_change(io, resource_change)
action_name = if resource_change.replacement == 'True'
action_name = case resource_change.replacement
when 'True'
'Replace'
when 'Conditional'
'Conditional replace'
else
resource_change.action
end
Expand All @@ -86,6 +89,8 @@ def display_resource_change_detail(io, action_name, color, detail)
detail_messages = [target_name]
if action_name == 'Replace'
detail_messages << "#{detail.target.requires_recreation} requires recreation"
elsif action_name == 'Conditional replace'
detail_messages << "#{detail.target.requires_recreation} may require recreation"
end
triggered_by = [detail.change_source, detail.causing_entity].compact.join('.')
if detail.evaluation != 'Static'
Expand All @@ -101,7 +106,7 @@ def action_color(action_name)
:green
when 'Modify'
:yellow
when 'Remove', 'Replace'
when 'Remove', 'Replace', 'Conditional replace'
:red
end
end
Expand Down