remove go-openapi/spec

Signed-off-by: Gautier Delorme <gautier.delorme@gmail.com>

Kubernetes-commit: 34b0fcef5fc47e3fcddf7f6ca1b3e6176b2a5323
This commit is contained in:
Gautier Delorme 2021-04-20 17:48:33 +02:00 committed by Kubernetes Publisher
parent 4a8e81fac6
commit af9424d2c9
11 changed files with 16 additions and 25 deletions

1
go.mod
View File

@ -14,7 +14,6 @@ require (
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/emicklei/go-restful v2.9.5+incompatible
github.com/evanphx/json-patch v4.9.0+incompatible
github.com/go-openapi/spec v0.19.5
github.com/gogo/protobuf v1.3.2
github.com/google/go-cmp v0.5.2
github.com/google/gofuzz v1.1.0

5
go.sum
View File

@ -105,15 +105,10 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V
github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
github.com/go-logr/logr v0.4.0 h1:K7/B1jt6fIBQVd4Owv2MqGQClcgf0R266+7C/QjRcLc=
github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg=
github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w=
github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc=
github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o=
github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8=
github.com/go-openapi/spec v0.19.5 h1:Xm0Ao53uqnk9QE/LlYV5DEU09UAgpliA85QoT9LzqPw=
github.com/go-openapi/spec v0.19.5/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk=
github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY=
github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=

View File

@ -20,8 +20,6 @@ import (
"errors"
"time"
"github.com/go-openapi/spec"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/apiserver/pkg/authentication/authenticator"
"k8s.io/apiserver/pkg/authentication/group"
@ -35,6 +33,7 @@ import (
"k8s.io/apiserver/pkg/server/dynamiccertificates"
webhooktoken "k8s.io/apiserver/plugin/pkg/authenticator/token/webhook"
authenticationclient "k8s.io/client-go/kubernetes/typed/authentication/v1"
"k8s.io/kube-openapi/pkg/validation/spec"
)
// DelegatingAuthenticatorConfig is the minimal configuration needed to create an authenticator

View File

@ -25,12 +25,12 @@ import (
"unicode"
restful "github.com/emicklei/go-restful"
"github.com/go-openapi/spec"
"k8s.io/apimachinery/pkg/apis/meta/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/kube-openapi/pkg/util"
"k8s.io/kube-openapi/pkg/validation/spec"
)
var verbs = util.NewTrie([]string{"get", "log", "read", "replace", "patch", "delete", "deletecollection", "watch", "connect", "proxy", "list", "create", "patch"})

View File

@ -21,10 +21,9 @@ import (
"strings"
"testing"
"github.com/go-openapi/spec"
"k8s.io/apimachinery/pkg/runtime"
openapitesting "k8s.io/apiserver/pkg/endpoints/openapi/testing"
"k8s.io/kube-openapi/pkg/validation/spec"
)
func assertEqual(t *testing.T, expected, actual interface{}) {

View File

@ -29,7 +29,6 @@ import (
"time"
jsonpatch "github.com/evanphx/json-patch"
"github.com/go-openapi/spec"
"github.com/google/uuid"
"k8s.io/apimachinery/pkg/runtime"
@ -70,6 +69,7 @@ import (
"k8s.io/component-base/logs"
"k8s.io/klog/v2"
openapicommon "k8s.io/kube-openapi/pkg/common"
"k8s.io/kube-openapi/pkg/validation/spec"
utilsnet "k8s.io/utils/net"
// install apis

View File

@ -25,7 +25,6 @@ import (
"time"
systemd "github.com/coreos/go-systemd/daemon"
"github.com/go-openapi/spec"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -55,6 +54,7 @@ import (
"k8s.io/kube-openapi/pkg/handler"
openapiutil "k8s.io/kube-openapi/pkg/util"
openapiproto "k8s.io/kube-openapi/pkg/util/proto"
"k8s.io/kube-openapi/pkg/validation/spec"
)
// Info about an API group.

View File

@ -31,7 +31,6 @@ import (
"testing"
"time"
openapi "github.com/go-openapi/spec"
"github.com/stretchr/testify/assert"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -54,6 +53,7 @@ import (
"k8s.io/client-go/kubernetes/fake"
restclient "k8s.io/client-go/rest"
kubeopenapi "k8s.io/kube-openapi/pkg/common"
"k8s.io/kube-openapi/pkg/validation/spec"
)
const (
@ -83,13 +83,13 @@ func init() {
func buildTestOpenAPIDefinition() kubeopenapi.OpenAPIDefinition {
return kubeopenapi.OpenAPIDefinition{
Schema: openapi.Schema{
SchemaProps: openapi.SchemaProps{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Description: "Description",
Properties: map[string]openapi.Schema{},
Properties: map[string]spec.Schema{},
},
VendorExtensible: openapi.VendorExtensible{
Extensions: openapi.Extensions{
VendorExtensible: spec.VendorExtensible{
Extensions: spec.Extensions{
"x-kubernetes-group-version-kind": []interface{}{
map[string]interface{}{
"group": "",
@ -372,7 +372,7 @@ func TestUpdateOpenAPISpec(t *testing.T) {
// verify we are able to update the served spec using the exposed service
newSpec := []byte(`{"swagger":"2.0","info":{"title":"Test Updated Generic API Server Swagger","version":"v0.1.0"},"paths":null}`)
swagger := new(openapi.Swagger)
swagger := new(spec.Swagger)
err = json.Unmarshal(newSpec, swagger)
assert.NoError(err)

View File

@ -18,13 +18,13 @@ package routes
import (
restful "github.com/emicklei/go-restful"
"github.com/go-openapi/spec"
"k8s.io/klog/v2"
"k8s.io/apiserver/pkg/server/mux"
"k8s.io/kube-openapi/pkg/builder"
"k8s.io/kube-openapi/pkg/common"
"k8s.io/kube-openapi/pkg/handler"
"k8s.io/kube-openapi/pkg/validation/spec"
)
// OpenAPI installs spec endpoints for each web service.

View File

@ -19,10 +19,10 @@ package openapi
import (
"encoding/json"
"github.com/go-openapi/spec"
openapi_v2 "github.com/googleapis/gnostic/openapiv2"
"k8s.io/kube-openapi/pkg/util/proto"
"k8s.io/kube-openapi/pkg/validation/spec"
)
// ToProtoModels builds the proto formatted models from OpenAPI spec

View File

@ -20,9 +20,8 @@ import (
"reflect"
"testing"
"github.com/go-openapi/spec"
"k8s.io/kube-openapi/pkg/util/proto"
"k8s.io/kube-openapi/pkg/validation/spec"
)
// TestOpenAPIDefinitionsToProtoSchema tests the openapi parser