-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved errors retry/ignore (#3795)
* Add handling of multiline errors * Simplified errors message cleanup * Strict lint updates * Log message update
- Loading branch information
Showing
5 changed files
with
69 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
resource "null_resource" "script_runner" { | ||
provisioner "local-exec" { | ||
command = "./script.sh" | ||
|
||
interpreter = ["/bin/sh", "-c"] | ||
on_failure = fail | ||
} | ||
|
||
triggers = { | ||
always_run = timestamp() | ||
} | ||
} | ||
|
||
output "value" { | ||
value = "valid value from failing_dep" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
echo "Error: creating Route in Route Table (rtb-46521694) with destination (10.0.0.0/8): operation error EC2: CreateRoute, https response error StatusCode: 400, RequestID: JD40-14127-2022, api error InvalidTransitGatewayID.NotFound: The transitGateway ID 'tgw-xxxxxxxxxxxxxx' does not exist." | ||
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
errors { | ||
# Retry block for transient errors | ||
retry "transient_errors" { | ||
retryable_errors = [ | ||
"(?s).*cannot create resource \"storageclasses\" in API group.*", | ||
] | ||
max_attempts = 3 | ||
sleep_interval_sec = 20 | ||
} | ||
|
||
ignore "transit_gateway_errors" { | ||
ignorable_errors = [ | ||
".*creating Route in Route Table*" | ||
] | ||
message = "Ignoring transit gateway not found when creating internal route." | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters