@@ -18,11 +18,11 @@ package source
18
18
19
19
import (
20
20
"context"
21
+ "errors"
21
22
"fmt"
22
23
"sort"
23
24
"text/template"
24
25
25
- "github.com/pkg/errors"
26
26
projectcontour "github.com/projectcontour/contour/apis/projectcontour/v1"
27
27
log "github.com/sirupsen/logrus"
28
28
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -87,7 +87,7 @@ func NewContourHTTPProxySource(
87
87
88
88
uc , err := NewUnstructuredConverter ()
89
89
if err != nil {
90
- return nil , errors . Wrap ( err , "failed to setup Unstructured Converter" )
90
+ return nil , fmt . Errorf ( "failed to setup Unstructured Converter: %w" , err )
91
91
}
92
92
93
93
return & httpProxySource {
@@ -121,14 +121,14 @@ func (sc *httpProxySource) Endpoints(ctx context.Context) ([]*endpoint.Endpoint,
121
121
hpConverted := & projectcontour.HTTPProxy {}
122
122
err := sc .unstructuredConverter .scheme .Convert (unstructuredHP , hpConverted , nil )
123
123
if err != nil {
124
- return nil , errors . Wrap ( err , "failed to convert to HTTPProxy" )
124
+ return nil , fmt . Errorf ( "failed to convert to HTTPProxy: %w" , err )
125
125
}
126
126
httpProxies = append (httpProxies , hpConverted )
127
127
}
128
128
129
129
httpProxies , err = sc .filterByAnnotations (httpProxies )
130
130
if err != nil {
131
- return nil , errors . Wrap ( err , "failed to filter HTTPProxies" )
131
+ return nil , fmt . Errorf ( "failed to filter HTTPProxies: %w" , err )
132
132
}
133
133
134
134
endpoints := []* endpoint.Endpoint {}
@@ -144,14 +144,14 @@ func (sc *httpProxySource) Endpoints(ctx context.Context) ([]*endpoint.Endpoint,
144
144
145
145
hpEndpoints , err := sc .endpointsFromHTTPProxy (hp )
146
146
if err != nil {
147
- return nil , errors . Wrap ( err , "failed to get endpoints from HTTPProxy" )
147
+ return nil , fmt . Errorf ( "failed to get endpoints from HTTPProxy: %w" , err )
148
148
}
149
149
150
150
// apply template if fqdn is missing on HTTPProxy
151
151
if (sc .combineFQDNAnnotation || len (hpEndpoints ) == 0 ) && sc .fqdnTemplate != nil {
152
152
tmplEndpoints , err := sc .endpointsFromTemplate (hp )
153
153
if err != nil {
154
- return nil , errors . Wrap ( err , "failed to get endpoints from template" )
154
+ return nil , fmt . Errorf ( "failed to get endpoints from template: %w" , err )
155
155
}
156
156
157
157
if sc .combineFQDNAnnotation {
0 commit comments