Merge pull request #103079 from youhonglian/update-native-error-in-staging

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

Kubernetes-commit: 53592b322211075fa1f1e98217ab6274e9fc3c64
This commit is contained in:
Kubernetes Publisher 2021-06-23 12:48:10 -07:00
commit cd2331f9c1
4 changed files with 8 additions and 12 deletions

5
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,7 +37,7 @@ 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/api v0.0.0-20210623031714-d4897f24d38d
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
@ -51,7 +50,7 @@ require (
)
replace (
k8s.io/api => k8s.io/api v0.0.0-20210619071639-0f1d05d0f338
k8s.io/api => k8s.io/api v0.0.0-20210623031714-d4897f24d38d
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

4
go.sum
View File

@ -779,8 +779,8 @@ 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/api v0.0.0-20210623031714-d4897f24d38d h1:EIaYOHYm13zWj3myUuVZH9fqSUnAmB7GKoiUoufoZj0=
k8s.io/api v0.0.0-20210623031714-d4897f24d38d/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=

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
}