zll600 commented on code in PR #2146:
URL:
https://github.com/apache/apisix-ingress-controller/pull/2146#discussion_r1463384060
##########
pkg/providers/translation/service.go:
##########
@@ -35,9 +35,15 @@ import (
func (t *translator) TranslateService(namespace, name, subset string, port
int32) (*apisixv1.Upstream, error) {
endpoint, err := t.EndpointLister.GetEndpoint(namespace, name)
if err != nil {
- return nil, &TranslateError{
- Field: "endpoints",
- Reason: err.Error(),
+ if k8serrors.IsNotFound(err) {
+ //Do not error wrap so that IsNotFound error can be
handled separately on upper level
+ //Reference
https://github.com/apache/apisix-ingress-controller/issues/1625
+ return nil, err
+ } else {
Review Comment:
But if the error is `NotFound`, this function will return immediately.
Otherwise this function will return a `&TranslateEror`. right?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]