Skip to content

Commit 4f3e37b

Browse files
committed
remove route from state if not found during migration
1 parent 6159d24 commit 4f3e37b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cloudfoundry/resource_cf_route_service_binding.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,10 @@ func upgradeStateRouteServiceBindingStateV0toV1ChangeID(ctx context.Context, raw
187187
routeBinding, err := session.ClientGo.ServiceRouteBindings.Single(context.Background(), options)
188188

189189
if err != nil {
190+
if strings.Contains(err.Error(), "CF-ResourceNotFound") {
191+
rawState["id"] = ""
192+
return rawState, nil
193+
}
190194
log.Println("[DEBUG] Failed to migrate RouteServiceBinding id: did not find the route service binding.")
191195
return rawState, err
192196
}

0 commit comments

Comments
 (0)