From 841ff590ea6f4b195016b6a176876461b7af94e3 Mon Sep 17 00:00:00 2001 From: Alisdair McDiarmid Date: Thu, 21 May 2020 16:02:18 -0400 Subject: [PATCH] command: Add UI hooks for read actions --- command/hook_ui.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/command/hook_ui.go b/command/hook_ui.go index 61bff36b27be..4bb90c797dc5 100644 --- a/command/hook_ui.go +++ b/command/hook_ui.go @@ -60,6 +60,7 @@ const ( uiResourceCreate uiResourceModify uiResourceDestroy + uiResourceRead ) func (h *UiHook) PreApply(addr addrs.AbsResourceInstance, gen states.Generation, action plans.Action, priorState, plannedNewState cty.Value) (terraform.HookAction, error) { @@ -83,6 +84,9 @@ func (h *UiHook) PreApply(addr addrs.AbsResourceInstance, gen states.Generation, case plans.Update: operation = "Modifying..." op = uiResourceModify + case plans.Read: + operation = "Reading..." + op = uiResourceRead default: // We don't expect any other actions in here, so anything else is a // bug in the caller but we'll ignore it in order to be robust. @@ -196,6 +200,8 @@ func (h *UiHook) stillApplying(state uiResourceState) { msg = "Still destroying..." case uiResourceCreate: msg = "Still creating..." + case uiResourceRead: + msg = "Still reading..." case uiResourceUnknown: return } @@ -241,6 +247,8 @@ func (h *UiHook) PostApply(addr addrs.AbsResourceInstance, gen states.Generation msg = "Destruction complete" case uiResourceCreate: msg = "Creation complete" + case uiResourceRead: + msg = "Read complete" case uiResourceUnknown: return terraform.HookActionContinue, nil }