remove destroy_ events from list (#37586)

I expect these will come back, but since we don't have a firm roadmap just yet it's better not to make future promises.
pull/37589/head
Kristin Laemmert 7 months ago committed by GitHub
parent 9b015c6c28
commit e315a07c71
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -129,25 +129,11 @@ func decodeActionTriggerBlock(block *hcl.Block) (*ActionTrigger, hcl.Diagnostics
event = BeforeUpdate
case "after_update":
event = AfterUpdate
case "before_destroy":
event = BeforeDestroy
case "after_destroy":
event = AfterDestroy
default:
diags = append(diags, &hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: fmt.Sprintf("Invalid \"event\" value %s", hcl.ExprAsKeyword(expr)),
Detail: "The \"event\" argument supports the following values: before_create, after_create, before_update, after_update, before_destroy, after_destroy.",
Subject: expr.Range().Ptr(),
})
continue
}
if event == BeforeDestroy || event == AfterDestroy {
diags = append(diags, &hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "Invalid destroy event used",
Detail: "The destroy events (before_destroy, after_destroy) are not supported as of right now. They will be supported in a future release.",
Detail: "The \"event\" argument supports the following values: before_create, after_create, before_update, after_update.",
Subject: expr.Range().Ptr(),
})
continue

@ -250,7 +250,7 @@ func TestDecodeActionTriggerBlock(t *testing.T) {
},
},
[]string{
"MockExprTraversal:0,0-12: Invalid \"event\" value not_an_event; The \"event\" argument supports the following values: before_create, after_create, before_update, after_update, before_destroy, after_destroy.",
"MockExprTraversal:0,0-12: Invalid \"event\" value not_an_event; The \"event\" argument supports the following values: before_create, after_create, before_update, after_update.",
":0,0-0: No events specified; At least one event must be specified for an action_trigger.",
},
},

Loading…
Cancel
Save