Update naming to ResourceActionTrigger

pull/38245/head
Mutahhir Hayat 3 months ago committed by Daniel Schmidt
parent 552e25b5f9
commit 49feb6e86f

@ -1345,7 +1345,7 @@ func actionInvocationPlanned(ai *hooks.ActionInvocation) (*stacks.StackChangePro
}
switch trig := ai.Trigger.(type) {
case *plans.LifecycleActionTrigger:
case *plans.ResourceActionTrigger:
res.ActionTrigger = &stacks.StackChangeProgress_ActionInvocationPlanned_LifecycleActionTrigger{
LifecycleActionTrigger: &stacks.StackChangeProgress_LifecycleActionTrigger{
TriggeringResourceAddress: stacks.NewResourceInstanceInStackAddr(

@ -927,7 +927,7 @@ func (pc *PlannedChangeActionInvocationInstancePlanned) ChangeDescription() (*st
// Convert the action trigger information
switch at := pc.Invocation.ActionTrigger.(type) {
case *plans.LifecycleActionTrigger:
case *plans.ResourceActionTrigger:
triggerEvent := stacks.PlannedChange_INVALID_EVENT
switch at.ActionTriggerEvent {
case configs.BeforeCreate:

@ -964,7 +964,7 @@ func TestPlannedChangeAsProto(t *testing.T) {
Key: addrs.NoKey,
},
},
ActionTrigger: &plans.LifecycleActionTrigger{
ActionTrigger: &plans.ResourceActionTrigger{
TriggeringResourceAddr: addrs.Resource{
Mode: addrs.ManagedResourceMode,
Type: "example_resource",
@ -993,8 +993,8 @@ func TestPlannedChangeAsProto(t *testing.T) {
Invocation: &planproto.ActionInvocationInstance{
Addr: "action.webhook.notify",
Provider: `provider["example.com/webhooks/http"]`,
ActionTrigger: &planproto.ActionInvocationInstance_LifecycleActionTrigger{
LifecycleActionTrigger: &planproto.LifecycleActionTrigger{
ActionTrigger: &planproto.ActionInvocationInstance_ResourceActionTrigger{
ResourceActionTrigger: &planproto.ResourceActionTrigger{
TriggeringResourceAddr: "example_resource.main",
TriggerEvent: planproto.ActionTriggerEvent_AFTER_CREATE,
ActionTriggerBlockIndex: 0,

@ -968,7 +968,6 @@ func TestPlanning_LocalsDataSource(t *testing.T) {
assertNoDiagnostics(t, diags)
return rawPlan, nil
})
if err != nil {
t.Fatal(err)
}
@ -1013,7 +1012,8 @@ func TestPlanning_LocalsDataSource(t *testing.T) {
expectedString := cty.StringVal("through-local-aloha-foo-foo")
expectedList := []cty.Value{
cty.StringVal("through-local-aloha-foo"),
cty.StringVal("foo")}
cty.StringVal("foo"),
}
expectedMap := map[string]cty.Value{
"key": cty.StringVal("through-local-aloha-foo"),
@ -1040,7 +1040,6 @@ func TestPlanning_LocalsDataSource(t *testing.T) {
return state, nil
})
if err != nil {
t.Fatal(err)
}
@ -1173,8 +1172,8 @@ func TestPlanning_ActionInvocationLifecycle(t *testing.T) {
if foundActionChange.Invocation == nil {
t.Fatal("invocation is nil")
}
if _, ok := foundActionChange.Invocation.ActionTrigger.(*plans.LifecycleActionTrigger); !ok {
t.Errorf("wrong action trigger type\ngot: %T\nwant: *plans.LifecycleActionTrigger", foundActionChange.Invocation.ActionTrigger)
if _, ok := foundActionChange.Invocation.ActionTrigger.(*plans.ResourceActionTrigger); !ok {
t.Errorf("wrong action trigger type\ngot: %T\nwant: *plans.ResourceActionTrigger", foundActionChange.Invocation.ActionTrigger)
}
// Verify we can convert to proto successfully

@ -6460,7 +6460,7 @@ func TestPlanWithActionInvocationHooks(t *testing.T) {
{
Addr: testActionInvocationAddr,
ProviderAddr: addrs.NewBuiltInProvider("testing"),
Trigger: &plans.LifecycleActionTrigger{
Trigger: &plans.ResourceActionTrigger{
TriggeringResourceAddr: testResourceInstance,
ActionTriggerEvent: configs.AfterCreate,
ActionTriggerBlockIndex: 0,

Loading…
Cancel
Save