1
0
mirror of https://github.com/kubernetes-sigs/descheduler.git synced 2026-01-28 14:41:10 +01:00

Bump To k8s 1.22.0

This commit is contained in:
Sean Malloy
2021-08-19 00:37:47 -05:00
parent 5420988a28
commit c079c7aaae
1614 changed files with 126680 additions and 52128 deletions

View File

@@ -16,7 +16,7 @@ limitations under the License.
package handler
import "github.com/go-openapi/spec"
import "k8s.io/kube-openapi/pkg/validation/spec"
// PruneDefaults remove all the defaults recursively from all the
// schemas in the definitions, and does not modify the definitions in

View File

@@ -28,16 +28,14 @@ import (
"github.com/NYTimes/gziphandler"
"github.com/emicklei/go-restful"
"github.com/go-openapi/spec"
"github.com/golang/protobuf/proto"
"github.com/googleapis/gnostic/compiler"
openapi_v2 "github.com/googleapis/gnostic/openapiv2"
jsoniter "github.com/json-iterator/go"
"github.com/munnerz/goautoneg"
"gopkg.in/yaml.v2"
"k8s.io/kube-openapi/pkg/builder"
"k8s.io/kube-openapi/pkg/common"
"k8s.io/kube-openapi/pkg/validation/spec"
)
const (
@@ -108,11 +106,7 @@ func (o *OpenAPIService) UpdateSpec(openapiSpec *spec.Swagger) (err error) {
if err != nil {
return err
}
var json map[string]interface{}
if err := jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal(specBytes, &json); err != nil {
return err
}
specPb, err := ToProtoBinary(json)
specPb, err := ToProtoBinary(specBytes)
if err != nil {
return err
}
@@ -180,8 +174,8 @@ func jsonToYAMLValue(j interface{}) interface{} {
return j
}
func ToProtoBinary(json map[string]interface{}) ([]byte, error) {
document, err := openapi_v2.NewDocument(jsonToYAML(json), compiler.NewContext("$root", nil))
func ToProtoBinary(json []byte) ([]byte, error) {
document, err := openapi_v2.ParseDocument(json)
if err != nil {
return nil, err
}