update github.com/pkg/errors to go native errors pkg in staging

Kubernetes-commit: 4b1402187474a1ebd0f71c824f45448fea160fc6
This commit is contained in:
youhonglian 2021-06-22 11:54:56 +08:00 committed by Kubernetes Publisher
parent 3492629d2b
commit 56e6dac0bb
4 changed files with 13 additions and 24 deletions

18
go.mod
View File

@ -23,7 +23,6 @@ require (
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/hashicorp/golang-lru v0.5.1
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822
github.com/pkg/errors v0.9.1
github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021 // indirect
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.7.0
@ -38,10 +37,10 @@ require (
google.golang.org/grpc v1.38.0
gopkg.in/natefinch/lumberjack.v2 v2.0.0
gopkg.in/square/go-jose.v2 v2.2.2
k8s.io/api v0.0.0-20210619071639-0f1d05d0f338
k8s.io/apimachinery v0.0.0-20210619071501-4713ab59dd88
k8s.io/client-go v0.0.0-20210619071903-3fae6f05ac95
k8s.io/component-base v0.0.0-20210622112647-573397b706f6
k8s.io/api v0.0.0
k8s.io/apimachinery v0.0.0
k8s.io/client-go v0.0.0
k8s.io/component-base v0.0.0
k8s.io/klog/v2 v2.9.0
k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e
k8s.io/utils v0.0.0-20210521133846-da695404a2bc
@ -51,8 +50,9 @@ require (
)
replace (
k8s.io/api => k8s.io/api v0.0.0-20210619071639-0f1d05d0f338
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20210619071501-4713ab59dd88
k8s.io/client-go => k8s.io/client-go v0.0.0-20210619071903-3fae6f05ac95
k8s.io/component-base => k8s.io/component-base v0.0.0-20210622112647-573397b706f6
k8s.io/api => ../api
k8s.io/apimachinery => ../apimachinery
k8s.io/apiserver => ../apiserver
k8s.io/client-go => ../client-go
k8s.io/component-base => ../component-base
)

8
go.sum
View File

@ -779,14 +779,6 @@ honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWh
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
k8s.io/api v0.0.0-20210619071639-0f1d05d0f338 h1:I2xy7G2dXwWm4wOW7Bq1ZrGipGsH8DtdxfUweLBbqYg=
k8s.io/api v0.0.0-20210619071639-0f1d05d0f338/go.mod h1:dPr4vYpBMxtH6RV3Sx1BkuNqvS8PvNu1U1QShIc9EUg=
k8s.io/apimachinery v0.0.0-20210619071501-4713ab59dd88 h1:9Qc+08Nttbg1dtl8dElWJv9nGb0aMA+Qbx4sXD9iK2E=
k8s.io/apimachinery v0.0.0-20210619071501-4713ab59dd88/go.mod h1:AZCsxGyiXb/4yTvUIiY+4LESjQ12B77LFrbW2xd61is=
k8s.io/client-go v0.0.0-20210619071903-3fae6f05ac95 h1:Wp1xPF8rzpQlkLEPswI7WKJjUQosHDZuXQRXIj1T1Z8=
k8s.io/client-go v0.0.0-20210619071903-3fae6f05ac95/go.mod h1:KdxPzTHgLRCmXpcnSOA+LaZEp8WyV8TQMVbFMTeJWIA=
k8s.io/component-base v0.0.0-20210622112647-573397b706f6 h1:fqgjYHQo/UQtfRXsTIv6ZOCPEcdSAooyUOU8OZAmZmY=
k8s.io/component-base v0.0.0-20210622112647-573397b706f6/go.mod h1:RwSvrG7yEBwMDhwYXuMGl6zz/ufmJuveaOC/GspqdRE=
k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
k8s.io/klog/v2 v2.9.0 h1:D7HV+n1V57XeZ0m6tdRkfknthUaM06VFbWldOFh8kzM=

View File

@ -21,6 +21,7 @@ import (
"crypto/sha256"
"encoding/binary"
"encoding/json"
"errors"
"fmt"
"math"
"math/rand"
@ -28,8 +29,6 @@ import (
"sync"
"time"
"github.com/pkg/errors"
apiequality "k8s.io/apimachinery/pkg/api/equality"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -432,7 +431,7 @@ func (cfgCtlr *configController) digestConfigObjects(newPLs []*flowcontrol.Prior
// and nothing more needs to be done here.
klog.V(5).Infof("%s at %s: attempted update of concurrently deleted FlowSchema %s; nothing more needs to be done", cfgCtlr.name, cfgCtlr.clock.Now().Format(timeFmt), fsu.flowSchema.Name)
} else {
errs = append(errs, errors.Wrap(err, fmt.Sprintf("failed to set a status.condition for FlowSchema %s", fsu.flowSchema.Name)))
errs = append(errs, fmt.Errorf("failed to set a status.condition for FlowSchema %s: %w", fsu.flowSchema.Name, err))
}
}
cfgCtlr.addUpdateResult(currResult)
@ -688,7 +687,7 @@ func queueSetCompleterForPL(qsf fq.QueueSetFactory, queues fq.QueueSet, pl *flow
qsc, err = qsf.BeginConstruction(qcQS, intPair)
}
if err != nil {
err = errors.Wrap(err, fmt.Sprintf("priority level %q has QueuingConfiguration %#+v, which is invalid", pl.Name, qcAPI))
err = fmt.Errorf("priority level %q has QueuingConfiguration %#+v, which is invalid: %w", pl.Name, qcAPI, err)
}
return qsc, err
}

View File

@ -23,8 +23,6 @@ import (
"sync"
"time"
"github.com/pkg/errors"
"k8s.io/apimachinery/pkg/util/clock"
"k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/apiserver/pkg/util/flowcontrol/counter"
@ -143,7 +141,7 @@ func checkConfig(qCfg fq.QueuingConfig) (*shufflesharding.Dealer, error) {
}
dealer, err := shufflesharding.NewDealer(qCfg.DesiredNumQueues, qCfg.HandSize)
if err != nil {
err = errors.Wrap(err, "the QueueSetConfig implies an invalid shuffle sharding config (DesiredNumQueues is deckSize)")
err = fmt.Errorf("the QueueSetConfig implies an invalid shuffle sharding config (DesiredNumQueues is deckSize): %w", err)
}
return dealer, err
}