Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add reason message logs for non-exist Azure resources #64248

Merged
merged 1 commit into from May 25, 2018

Conversation

Projects
None yet
4 participants
@feiskyer
Copy link
Member

feiskyer commented May 24, 2018

What this PR does / why we need it:

In azure_wrap.go the function checkResourceExistsFromError() looks at a received error and determines it to be a ResourceNotFound if the HTTP status is http.StatusNotFound. However, the HTTP status also equals http.StatusNotFound in case of SubscriptionNotFound.

this PR adds logs to indict the real error messages for such case.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #64220

Special notes for your reviewer:

Release note:

Add reason message logs for non-exist Azure resources
}
if v.StatusCode == http.StatusNotFound {
return false, nil
return false, err.Error(), nil

This comment has been minimized.

@feiskyer

feiskyer May 24, 2018

Author Member

btw, there is a Message filed in autorest.DetailedError, but its contents are always same. So the error itself is used here

@feiskyer

This comment has been minimized.

Copy link
Member Author

feiskyer commented May 24, 2018

/sig azure

@andyzhangx

This comment has been minimized.

Copy link
Member

andyzhangx commented May 24, 2018

the code looks strange to me, if realErr is nil, why there is errMessage, may be infoMsg ?

exists, errMessage, realErr := checkResourceExistsFromError(err)

@feiskyer feiskyer force-pushed the feiskyer:exact-err-msg branch from d21d088 to 5a06ad2 May 24, 2018

@feiskyer

This comment has been minimized.

Copy link
Member Author

feiskyer commented May 24, 2018

@andyzhangx Renamed errMessage to message . PTAL

@andyzhangx
Copy link
Member

andyzhangx left a comment

/lgtm

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

k8s-ci-robot commented May 24, 2018

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andyzhangx, feiskyer

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-github-robot

This comment has been minimized.

Copy link
Contributor

k8s-github-robot commented May 25, 2018

Automatic merge from submit-queue (batch tested with PRs 63319, 64248, 64250, 63890, 64233). If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit 696430d into kubernetes:master May 25, 2018

18 checks passed

Submit Queue Queued to run github e2e tests a second time.
Details
cla/linuxfoundation feiskyer authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-cross Skipped
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-100-performance Job succeeded.
Details
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-gke Skipped
pull-kubernetes-e2e-kops-aws Job succeeded.
Details
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce-big Job succeeded.
Details
pull-kubernetes-local-e2e Skipped
pull-kubernetes-local-e2e-containerized Skipped
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details

@feiskyer feiskyer deleted the feiskyer:exact-err-msg branch May 25, 2018

@feiskyer feiskyer restored the feiskyer:exact-err-msg branch Jul 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.