Skip to content

Commit

Permalink
Fix for GitHub issue #hashicorp#11061
Browse files Browse the repository at this point in the history
Failed ES domain upgrade error isn't helpful
  • Loading branch information
obourdon committed Dec 20, 2022
1 parent 8e7f108 commit 80c8e18
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/service/elasticsearch/wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const (
func waitUpgradeSucceeded(conn *elasticsearch.ElasticsearchService, name string, timeout time.Duration) (*elasticsearch.GetUpgradeStatusOutput, error) {
stateConf := &resource.StateChangeConf{
Pending: []string{elasticsearch.UpgradeStatusInProgress},
Target: []string{elasticsearch.UpgradeStatusSucceeded},
Target: []string{elasticsearch.UpgradeStatusSucceeded, elasticsearch.UpgradeStatusFailed},
Refresh: statusUpgradeStatus(conn, name),
Timeout: timeout,
MinTimeout: domainUpgradeSuccessMinTimeout,
Expand All @@ -31,9 +31,11 @@ func waitUpgradeSucceeded(conn *elasticsearch.ElasticsearchService, name string,
outputRaw, err := stateConf.WaitForState()

if output, ok := outputRaw.(*elasticsearch.GetUpgradeStatusOutput); ok {
if *output.StepStatus == elasticsearch.UpgradeStatusFailed {
return output, fmt.Errorf("%s %s: %s", *output.UpgradeName, *output.StepStatus, *output.UpgradeStep)
}
return output, err
}

return nil, err
}

Expand Down

0 comments on commit 80c8e18

Please sign in to comment.