From 060d9816602ef5ca766f7bb8cfef5bcebddf55fa Mon Sep 17 00:00:00 2001 From: Marc Nuri Date: Wed, 2 Oct 2024 14:32:02 +0200 Subject: [PATCH] refactor(openapi): remove no longer needed openshift-cluster-network-operator.json Signed-off-by: Marc Nuri --- .../openapi/generator/cmd/reflection.go | 6 ------ .../openapi/schemas/openshift-cluster-network-operator.json | 1 - kubernetes-model-generator/openshift-model-operator/pom.xml | 5 ----- 3 files changed, 12 deletions(-) delete mode 100644 kubernetes-model-generator/openapi/schemas/openshift-cluster-network-operator.json diff --git a/kubernetes-model-generator/openapi/generator/cmd/reflection.go b/kubernetes-model-generator/openapi/generator/cmd/reflection.go index d40e775fa2c..8e900ca5183 100644 --- a/kubernetes-model-generator/openapi/generator/cmd/reflection.go +++ b/kubernetes-model-generator/openapi/generator/cmd/reflection.go @@ -17,7 +17,6 @@ package main import ( "github.com/getkin/kin-openapi/openapi3" - openshiftclusternetworkoperatorv1 "github.com/openshift/cluster-network-operator/pkg/apis/network/v1" "github.com/spf13/cobra" admissionV1 "k8s.io/api/admission/v1" admissionV1Beta1 "k8s.io/api/admission/v1beta1" @@ -118,11 +117,6 @@ var reflectionRun = func(cmd *cobra.Command, args []string) { reflect.TypeOf(metricsV1Beta1.PodMetricsList{}): {true, metricsV1Beta1.SchemeGroupVersion.String(), "pods", true}, reflect.TypeOf(metricsV1Beta1.PodMetrics{}): {false, metricsV1Beta1.SchemeGroupVersion.String(), "pods", true}, }, "metrics"), - // OperatorPKI specs are not included in OpenApi - NewPathSchema(map[reflect.Type]ApiVersion{ - reflect.TypeOf(openshiftclusternetworkoperatorv1.OperatorPKIList{}): {true, openshiftclusternetworkoperatorv1.GroupVersion.String(), "operatorpkis", true}, - reflect.TypeOf(openshiftclusternetworkoperatorv1.OperatorPKI{}): {false, openshiftclusternetworkoperatorv1.GroupVersion.String(), "operatorpkis", true}, - }, "openshift-cluster-network-operator"), } generate(schemas, targetDirectory) } diff --git a/kubernetes-model-generator/openapi/schemas/openshift-cluster-network-operator.json b/kubernetes-model-generator/openapi/schemas/openshift-cluster-network-operator.json deleted file mode 100644 index 5a9bd5286b3..00000000000 --- a/kubernetes-model-generator/openapi/schemas/openshift-cluster-network-operator.json +++ /dev/null @@ -1 +0,0 @@ -{"components":{"schemas":{"com.github.openshift.cluster-network-operator.pkg.apis.network.v1.CertSpec":{"properties":{"commonName":{"type":"string"}},"type":"object"},"com.github.openshift.cluster-network-operator.pkg.apis.network.v1.OperatorPKI":{"properties":{"apiVersion":{"type":"string"},"kind":{"type":"string"},"metadata":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"$ref":"#/components/schemas/com.github.openshift.cluster-network-operator.pkg.apis.network.v1.OperatorPKISpec"},"status":{"$ref":"#/components/schemas/com.github.openshift.cluster-network-operator.pkg.apis.network.v1.OperatorPKIStatus"}},"type":"object"},"com.github.openshift.cluster-network-operator.pkg.apis.network.v1.OperatorPKIList":{"properties":{"apiVersion":{"type":"string"},"items":{"items":{"$ref":"#/components/schemas/com.github.openshift.cluster-network-operator.pkg.apis.network.v1.OperatorPKI"},"type":"array"},"kind":{"type":"string"},"metadata":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}},"type":"object"},"com.github.openshift.cluster-network-operator.pkg.apis.network.v1.OperatorPKISpec":{"properties":{"targetCert":{"$ref":"#/components/schemas/com.github.openshift.cluster-network-operator.pkg.apis.network.v1.CertSpec"}},"type":"object"},"com.github.openshift.cluster-network-operator.pkg.apis.network.v1.OperatorPKIStatus":{"type":"object"},"io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1":{"properties":{"-":{"type":"string"}},"type":"object"},"io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta":{"properties":{"continue":{"type":"string"},"remainingItemCount":{"format":"int64","type":"integer"},"resourceVersion":{"type":"string"},"selfLink":{"type":"string"}},"type":"object"},"io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry":{"properties":{"apiVersion":{"type":"string"},"fieldsType":{"type":"string"},"fieldsV1":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1"},"manager":{"type":"string"},"operation":{"type":"string"},"subresource":{"type":"string"},"time":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"}},"type":"object"},"io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta":{"properties":{"annotations":{"additionalProperties":{"type":"string"},"type":"object"},"creationTimestamp":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"deletionGracePeriodSeconds":{"format":"int64","type":"integer"},"deletionTimestamp":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"finalizers":{"items":{"type":"string"},"type":"array"},"generateName":{"type":"string"},"generation":{"format":"int64","type":"integer"},"labels":{"additionalProperties":{"type":"string"},"type":"object"},"managedFields":{"items":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry"},"type":"array"},"name":{"type":"string"},"namespace":{"type":"string"},"ownerReferences":{"items":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference"},"type":"array"},"resourceVersion":{"type":"string"},"selfLink":{"type":"string"},"uid":{"type":"string"}},"type":"object"},"io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference":{"properties":{"apiVersion":{"type":"string"},"blockOwnerDeletion":{"type":"boolean"},"controller":{"type":"boolean"},"kind":{"type":"string"},"name":{"type":"string"},"uid":{"type":"string"}},"type":"object"},"io.k8s.apimachinery.pkg.apis.meta.v1.Time":{"properties":{"Time":{"type":"string"}},"type":"object"}}},"info":{"title":"openshift-cluster-network-operator","version":"0.0.0"},"openapi":"3.0.0","paths":{"/apis/network.operator.openshift.io/v1/namespaces/{namespace}/operatorpkis":{"get":{"parameters":[{"in":"path","name":"namespace","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/com.github.openshift.cluster-network-operator.pkg.apis.network.v1.OperatorPKIList"}}},"description":"OK"},"default":{"description":""}},"x-kubernetes-group-version-kind":{"group":"network.operator.openshift.io","kind":"OperatorPKIList","version":"v1"}}},"/apis/network.operator.openshift.io/v1/namespaces/{namespace}/operatorpkis/{name}":{"get":{"parameters":[{"in":"path","name":"namespace","required":true},{"in":"path","name":"name","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/com.github.openshift.cluster-network-operator.pkg.apis.network.v1.OperatorPKI"}}},"description":"OK"},"default":{"description":""}},"x-kubernetes-group-version-kind":{"group":"network.operator.openshift.io","kind":"OperatorPKI","version":"v1"}}}}} \ No newline at end of file diff --git a/kubernetes-model-generator/openshift-model-operator/pom.xml b/kubernetes-model-generator/openshift-model-operator/pom.xml index 30d319c353d..9c6d2c546f6 100644 --- a/kubernetes-model-generator/openshift-model-operator/pom.xml +++ b/kubernetes-model-generator/openshift-model-operator/pom.xml @@ -66,14 +66,9 @@ ${openapi.schema.openshift-generated} - ${project.basedir}/../openapi/schemas/openshift-cluster-network-operator.json - - io.fabric8.openshift.api.model.operator.network - ^io\.openshift\.operator\..*$ - ^com\.github\.openshift\.cluster-network-operator\..*$ ^io\.openshift\.operator\.samples\..*$