Skip to content

Commit

Permalink
reject delete pod request by yurthub when cloud-edge network disconne…
Browse files Browse the repository at this point in the history
…cted
  • Loading branch information
rambohe-ch committed Nov 15, 2021
1 parent 6e4e5d7 commit af08c60
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/yurthub/proxy/local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ func localDelete(w http.ResponseWriter, req *http.Request) error {
ctx := req.Context()
info, _ := apirequest.RequestInfoFrom(ctx)
s := &metav1.Status{
Status: metav1.StatusSuccess,
Code: http.StatusOK,
Status: metav1.StatusFailure,
Code: http.StatusForbidden,
Reason: metav1.StatusReasonForbidden,
Details: &metav1.StatusDetails{
Name: info.Name,
Expand All @@ -102,7 +102,7 @@ func localDelete(w http.ResponseWriter, req *http.Request) error {
Message: "delete request is not supported in local cache",
}

util.WriteObject(http.StatusOK, s, w, req)
util.WriteObject(http.StatusForbidden, s, w, req)
return nil
}

Expand Down

0 comments on commit af08c60

Please sign in to comment.