Skip to content

Commit

Permalink
refactor: openshift-model-machine generated from OpenAPI schemas
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Nuri <[email protected]>
  • Loading branch information
manusa authored Oct 2, 2024
1 parent 64cd032 commit 5f7cc88
Show file tree
Hide file tree
Showing 100 changed files with 8,435 additions and 2,231 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ package main

import (
"github.com/getkin/kin-openapi/openapi3"
openshiftmachinev1 "github.com/openshift/api/machine/v1"
openshiftmachinev1alpha1 "github.com/openshift/api/machine/v1alpha1"
openshiftclusternetworkoperatorv1 "github.com/openshift/cluster-network-operator/pkg/apis/network/v1"
"github.com/spf13/cobra"
admissionV1 "k8s.io/api/admission/v1"
Expand Down Expand Up @@ -120,12 +118,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"),
// Provider Specs are not included in OpenAPI https://docs.openshift.com/container-platform/4.16/machine_management/index.html#machine-mgmt-intro-managing-compute_overview-of-machine-management
NewPathSchema(map[reflect.Type]ApiVersion{
reflect.TypeOf(openshiftmachinev1alpha1.OpenstackProviderSpec{}): {false, openshiftmachinev1alpha1.GroupVersion.String(), "openstackproviderspecs", true},
reflect.TypeOf(openshiftmachinev1.NutanixMachineProviderConfig{}): {false, openshiftmachinev1.GroupVersion.String(), "nutanixmachineproviderconfigs", true},
reflect.TypeOf(openshiftmachinev1.PowerVSMachineProviderConfig{}): {false, openshiftmachinev1.GroupVersion.String(), "powervsmachineproviderconfigs", true},
}, "openshift-machine"),
// OperatorPKI specs are not included in OpenApi
NewPathSchema(map[reflect.Type]ApiVersion{
reflect.TypeOf(openshiftclusternetworkoperatorv1.OperatorPKIList{}): {true, openshiftclusternetworkoperatorv1.GroupVersion.String(), "operatorpkis", true},
Expand Down

This file was deleted.

9 changes: 1 addition & 8 deletions kubernetes-model-generator/openshift-model-machine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,10 @@
<configuration >
<settings combine.self="append">
<schemas>
<schema>${openapi.schema.openshift-latest}</schema>
<schema>${project.basedir}/../openapi/schemas/openshift-machine.json</schema>
<schema>${openapi.schema.openshift-generated}</schema>
</schemas>
<packageMappings combine.self="append">
<io.k8s.api>io.fabric8.kubernetes.api.model</io.k8s.api>
<io.openshift.machine>io.fabric8.openshift.api.model.machine</io.openshift.machine>
<com.github.openshift.api.machine>io.fabric8.openshift.api.model.machine</com.github.openshift.api.machine>
</packageMappings>
<includeGenerationRegexes>
<includeGenerationRegex>^io\.openshift\.machine\..*$</includeGenerationRegex>
<includeGenerationRegex>^com\.github\.openshift\.api\.machine\..*$</includeGenerationRegex>
</includeGenerationRegexes>
</settings>
</configuration>
Expand Down
Loading

0 comments on commit 5f7cc88

Please sign in to comment.