Upgrade k8s package verison (#5358)
* upgrade k8s package version Signed-off-by: hongzhouzi <hongzhouzi@kubesphere.io> * Script upgrade and code formatting. Signed-off-by: hongzhouzi <hongzhouzi@kubesphere.io> Signed-off-by: hongzhouzi <hongzhouzi@kubesphere.io>
This commit is contained in:
16
vendor/k8s.io/apiserver/pkg/util/webhook/client.go
generated
vendored
16
vendor/k8s.io/apiserver/pkg/util/webhook/client.go
generated
vendored
@@ -25,12 +25,13 @@ import (
|
||||
"net/url"
|
||||
"strconv"
|
||||
|
||||
"github.com/hashicorp/golang-lru"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/runtime/serializer"
|
||||
utilerrors "k8s.io/apimachinery/pkg/util/errors"
|
||||
"k8s.io/apiserver/pkg/util/x509metrics"
|
||||
"k8s.io/client-go/rest"
|
||||
"k8s.io/utils/lru"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -64,10 +65,7 @@ type ClientManager struct {
|
||||
|
||||
// NewClientManager creates a clientManager.
|
||||
func NewClientManager(gvs []schema.GroupVersion, addToSchemaFuncs ...func(s *runtime.Scheme) error) (ClientManager, error) {
|
||||
cache, err := lru.New(defaultCacheSize)
|
||||
if err != nil {
|
||||
return ClientManager{}, err
|
||||
}
|
||||
cache := lru.New(defaultCacheSize)
|
||||
hookScheme := runtime.NewScheme()
|
||||
for _, addToSchemaFunc := range addToSchemaFuncs {
|
||||
if err := addToSchemaFunc(hookScheme); err != nil {
|
||||
@@ -148,6 +146,14 @@ func (cm *ClientManager) HookClient(cc ClientConfig) (*rest.RESTClient, error) {
|
||||
|
||||
cfg.ContentConfig.NegotiatedSerializer = cm.negotiatedSerializer
|
||||
cfg.ContentConfig.ContentType = runtime.ContentTypeJSON
|
||||
|
||||
// Add a transport wrapper that allows detection of TLS connections to
|
||||
// servers with serving certificates with deprecated characteristics
|
||||
cfg.Wrap(x509metrics.NewDeprecatedCertificateRoundTripperWrapperConstructor(
|
||||
x509MissingSANCounter,
|
||||
x509InsecureSHA1Counter,
|
||||
))
|
||||
|
||||
client, err := rest.UnversionedRESTClientFor(cfg)
|
||||
if err == nil {
|
||||
cm.cache.Add(string(cacheKey), client)
|
||||
|
||||
Reference in New Issue
Block a user