@@ -1103,7 +1103,10 @@ func deploymentActionStatusRefreshFunc(apiClient client.MulticloudIaaS, deployme
1103
1103
func deploymentDeleteStatusRefreshFunc (apiClient client.MulticloudIaaS , id string ) resource.StateRefreshFunc {
1104
1104
return func () (interface {}, string , error ) {
1105
1105
ret , err := apiClient .Deployments .GetDeploymentByIDUsingGET (
1106
- deployments .NewGetDeploymentByIDUsingGETParams ().WithDeploymentID (strfmt .UUID (id )))
1106
+ deployments .NewGetDeploymentByIDUsingGETParams ().
1107
+ WithDeploymentID (strfmt .UUID (id )).
1108
+ WithExpandLastRequest (withBool (true )).
1109
+ WithAPIVersion (withString (DeploymentsAPIVersion )))
1107
1110
if err != nil {
1108
1111
switch err .(type ) {
1109
1112
case * deployments.GetDeploymentByIDUsingGETNotFound :
@@ -1113,7 +1116,17 @@ func deploymentDeleteStatusRefreshFunc(apiClient client.MulticloudIaaS, id strin
1113
1116
}
1114
1117
}
1115
1118
1116
- return [... ]string {id }, reflect .TypeOf (ret ).String (), nil
1119
+ status := ret .Payload .Status
1120
+ switch status {
1121
+ case models .DeploymentStatusDELETEINPROGRESS :
1122
+ return [... ]string {id }, reflect .TypeOf (ret ).String (), nil
1123
+ case models .DeploymentStatusDELETESUCCESSFUL :
1124
+ return [... ]string {id }, reflect .TypeOf (ret ).String (), nil
1125
+ case models .DeploymentStatusDELETEFAILED :
1126
+ return [... ]string {id }, reflect .TypeOf (ret ).String (), fmt .Errorf (ret .Payload .LastRequest .Details )
1127
+ default :
1128
+ return [... ]string {id }, reflect .TypeOf (ret ).String (), fmt .Errorf ("deploymentStatusRefreshFunc: unknown status %v" , status )
1129
+ }
1117
1130
}
1118
1131
}
1119
1132
0 commit comments