File tree 1 file changed +2
-3
lines changed
images/kube-api-rewriter/pkg/proxy
1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ import (
33
33
"time"
34
34
35
35
"github.com/tidwall/gjson"
36
+ k8serrors "k8s.io/apimachinery/pkg/api/errors"
36
37
37
38
"github.com/deckhouse/kube-api-rewriter/pkg/labels"
38
39
logutil "github.com/deckhouse/kube-api-rewriter/pkg/log"
@@ -186,10 +187,8 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
186
187
resp , err := h .TargetClient .Do (req )
187
188
if err != nil {
188
189
logger .Error ("Error passing request to the target" , logutil .SlogErr (err ))
189
- http .Error (w , " Error passing request to the target" , http .StatusInternalServerError )
190
+ http .Error (w , k8serrors . NewInternalError ( err ). Error () , http .StatusInternalServerError )
190
191
metrics .TargetResponseError ()
191
- // TODO return apimachinery NewInternalError
192
- // https://github.com/kubernetes/apimachinery/blob/master/pkg/api/errors/errors.go
193
192
return
194
193
}
195
194
You can’t perform that action at this time.
0 commit comments