-
Notifications
You must be signed in to change notification settings - Fork 957
Closed as duplicate of#23350
Copy link
Labels
MgmtThis issue is related to a management-plane library.This issue is related to a management-plane library.bugThis issue requires a change to an existing behavior in the product in order to be resolved.This issue requires a change to an existing behavior in the product in order to be resolved.
Description
Bug Report
The BeginValidate function of DeploymentsClient doesn't correctly return errors.
- import path of package in question, e.g.
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" - SDK version:
1.2.0
I believe that this is because the service defines the following in its Swagger for this operation:
"responses": {
"200": {
"description": "OK - Returns the validation result.",
"schema": {
"$ref": "#/definitions/DeploymentValidateResult"
}
},
"202": {
"description": "Accepted - The request has been accepted for processing and the operation will complete asynchronously."
},
"400": {
"description": "Returns the validation result.",
"schema": {
"$ref": "#/definitions/DeploymentValidateResult"
}
},
This results in HTTP 400 not producing an error, here
Which then ends up hitting this code:
// this is a back-stop in case the swagger is incorrect (i.e. missing one or more status codes for success).
// ideally the codegen should return an error if the initial response failed and not even create a poller.
if !poller.StatusCodeValid(resp) {
return nil, errors.New("the operation failed or was cancelled")
}
The result: Any failed deployment validate will never report any error except "the operation failed or was cancelled".
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
MgmtThis issue is related to a management-plane library.This issue is related to a management-plane library.bugThis issue requires a change to an existing behavior in the product in order to be resolved.This issue requires a change to an existing behavior in the product in order to be resolved.