rebase: update kubernetes to 1.26.1

update kubernetes and its dependencies
to v1.26.1

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna
2023-02-01 18:06:36 +01:00
committed by mergify[bot]
parent e9e33fb851
commit 9c8de9471e
937 changed files with 75539 additions and 33050 deletions

View File

@ -19,15 +19,19 @@ package cached
import (
"sync"
openapi_v3 "github.com/google/gnostic/openapiv3"
"k8s.io/client-go/openapi"
)
type groupversion struct {
delegate openapi.GroupVersion
once sync.Once
doc *openapi_v3.Document
err error
lock sync.Mutex
docs map[string]docInfo
}
type docInfo struct {
data []byte
err error
}
func newGroupVersion(delegate openapi.GroupVersion) *groupversion {
@ -36,10 +40,19 @@ func newGroupVersion(delegate openapi.GroupVersion) *groupversion {
}
}
func (g *groupversion) Schema() (*openapi_v3.Document, error) {
g.once.Do(func() {
g.doc, g.err = g.delegate.Schema()
})
func (g *groupversion) Schema(contentType string) ([]byte, error) {
g.lock.Lock()
defer g.lock.Unlock()
return g.doc, g.err
cachedInfo, ok := g.docs[contentType]
if !ok {
if g.docs == nil {
g.docs = make(map[string]docInfo)
}
cachedInfo.data, cachedInfo.err = g.delegate.Schema(contentType)
g.docs[contentType] = cachedInfo
}
return cachedInfo.data, cachedInfo.err
}