@@ -2,12 +2,12 @@ package k8s
22
33import (
44 "context"
5+ "errors"
56 "fmt"
67 "regexp"
78 "strings"
89 "time"
910
10- "github.com/pkg/errors"
1111 "github.com/pmylund/go-cache"
1212 admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
1313 appsv1 "k8s.io/api/apps/v1"
@@ -148,7 +148,7 @@ func (c *ConfigDynamic) NewDataGatherer(ctx context.Context) (datagatherer.DataG
148148 if isNativeResource (c .GroupVersionResource ) {
149149 clientset , err := NewClientSet (c .KubeConfigPath )
150150 if err != nil {
151- return nil , errors . WithStack ( err )
151+ return nil , err
152152 }
153153
154154 return c .newDataGathererWithClient (ctx , nil , clientset )
@@ -341,7 +341,7 @@ func (g *DataGathererDynamic) Fetch() (interface{}, int, error) {
341341 // Redact Secret data
342342 err := redactList (items , g .ExcludeAnnotKeys , g .ExcludeLabelKeys )
343343 if err != nil {
344- return nil , - 1 , errors . WithStack ( err )
344+ return nil , - 1 , err
345345 }
346346
347347 // add gathered resources to items
@@ -356,7 +356,7 @@ func redactList(list []*api.GatheredResource, excludeAnnotKeys, excludeLabelKeys
356356 // Determine the kind of items in case this is a generic 'mixed' list.
357357 gvks , _ , err := scheme .Scheme .ObjectKinds (item )
358358 if err != nil {
359- return errors . WithStack ( err )
359+ return err
360360 }
361361
362362 resource := item
@@ -401,7 +401,7 @@ func redactList(list []*api.GatheredResource, excludeAnnotKeys, excludeLabelKeys
401401 resource := item .(runtime.Object )
402402 gvks , _ , err := scheme .Scheme .ObjectKinds (resource )
403403 if err != nil {
404- return errors . WithStack ( err )
404+ return err
405405 }
406406
407407 // During the internal marshal/unmarshal the runtime.Object the metav1.TypeMeta seems to be lost
0 commit comments