diff --git a/kubernetes-model-generator/openapi/generator/go.mod b/kubernetes-model-generator/openapi/generator/go.mod index 970516e24fc..d6bd8399ca0 100644 --- a/kubernetes-model-generator/openapi/generator/go.mod +++ b/kubernetes-model-generator/openapi/generator/go.mod @@ -5,6 +5,7 @@ go 1.22.0 require ( github.com/getkin/kin-openapi v0.125.0 k8s.io/api v0.30.2 + k8s.io/apiextensions-apiserver v0.30.2 k8s.io/apimachinery v0.30.2 k8s.io/client-go v0.30.2 ) diff --git a/kubernetes-model-generator/openapi/generator/go.sum b/kubernetes-model-generator/openapi/generator/go.sum index 2b7422267be..63d295fde9e 100644 --- a/kubernetes-model-generator/openapi/generator/go.sum +++ b/kubernetes-model-generator/openapi/generator/go.sum @@ -112,6 +112,8 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= k8s.io/api v0.30.2 h1:+ZhRj+28QT4UOH+BKznu4CBgPWgkXO7XAvMcMl0qKvI= k8s.io/api v0.30.2/go.mod h1:ULg5g9JvOev2dG0u2hig4Z7tQ2hHIuS+m8MNZ+X6EmI= +k8s.io/apiextensions-apiserver v0.30.2 h1:l7Eue2t6QiLHErfn2vwK4KgF4NeDgjQkCXtEbOocKIE= +k8s.io/apiextensions-apiserver v0.30.2/go.mod h1:lsJFLYyK40iguuinsb3nt+Sj6CmodSI4ACDLep1rgjw= k8s.io/apimachinery v0.30.2 h1:fEMcnBj6qkzzPGSVsAZtQThU62SmQ4ZymlXRC5yFSCg= k8s.io/apimachinery v0.30.2/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= k8s.io/client-go v0.30.2 h1:sBIVJdojUNPDU/jObC+18tXWcTJVcwyqS9diGdWHk50= diff --git a/kubernetes-model-generator/openapi/generator/main.go b/kubernetes-model-generator/openapi/generator/main.go index badb0e31835..e9b19db21b7 100644 --- a/kubernetes-model-generator/openapi/generator/main.go +++ b/kubernetes-model-generator/openapi/generator/main.go @@ -17,10 +17,12 @@ package main import ( "github.com/getkin/kin-openapi/openapi3" - v1admission "k8s.io/api/admission/v1" - v1beta1admission "k8s.io/api/admission/v1beta1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - configapi "k8s.io/client-go/tools/clientcmd/api/v1" + admissionV1 "k8s.io/api/admission/v1" + admissionV1Beta1 "k8s.io/api/admission/v1beta1" + apiextensionsV1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + apiextensionsV1Beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + metaV1 "k8s.io/apimachinery/pkg/apis/meta/v1" + configapiV1 "k8s.io/client-go/tools/clientcmd/api/v1" "os" "path/filepath" "reflect" @@ -45,17 +47,23 @@ func main() { panic(err) } schemas := []Schemas{ - {[]reflect.Type{reflect.TypeOf(configapi.Config{})}, "kubernetes-config"}, + {[]reflect.Type{reflect.TypeOf(configapiV1.Config{})}, "kubernetes-config"}, {[]reflect.Type{ - reflect.TypeOf(v1admission.AdmissionRequest{}), - reflect.TypeOf(v1beta1admission.AdmissionRequest{}), - }, "admission-registration"}, - {[]reflect.Type{ - reflect.TypeOf(metav1.MicroTime{}), + reflect.TypeOf(metaV1.MicroTime{}), // reflect.TypeOf(metav1.GroupKind{}), // reflect.TypeOf(metav1.GroupVersionKind{}), // reflect.TypeOf(metav1.GroupVersionResource{}), }, "api-machinery-extra"}, + {[]reflect.Type{ + reflect.TypeOf(admissionV1.AdmissionRequest{}), + reflect.TypeOf(admissionV1Beta1.AdmissionRequest{}), + }, "admission-registration"}, + {[]reflect.Type{ + reflect.TypeOf(apiextensionsV1.ConversionReview{}), + reflect.TypeOf(apiextensionsV1Beta1.ConversionReview{}), + reflect.TypeOf(apiextensionsV1Beta1.SelectableField{}), + reflect.TypeOf(apiextensionsV1Beta1.ValidationRule{}), + }, "apiextensions"}, } generate(schemas, targetDirectory) }