Skip to content

Commit

Permalink
refactor: openshift-model-operatorhub 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 committed Sep 18, 2024
1 parent cce22ee commit b50415c
Show file tree
Hide file tree
Showing 555 changed files with 73,152 additions and 1,939 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/windows-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ jobs:
matrix:
java: [17]
steps:
- name: Support long filenames in git
run: git config --system core.longpaths true
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ generate-openapi-classes:
cd kubernetes-model-generator/openshift-model && mvn -Pgenerate clean install
cd kubernetes-model-generator/openshift-model-operator && mvn -Pgenerate clean install
cd kubernetes-model-generator/openshift-model-miscellaneous && mvn -Pgenerate clean install
cd kubernetes-model-generator/openshift-model-operatorhub && mvn -Pgenerate clean install

# Legacy generation of the model: TODO: remove
.PHONY: generate-model-legacy
Expand Down
1 change: 0 additions & 1 deletion kubernetes-model-generator/generateModel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ ABSOLUTE_BASEDIR=$(realpath "$BASEDIR")

# Array for all existing modules
declare -a modules=(
"openshift-model-operatorhub"
"openshift-model-console"
"openshift-model-clusterautoscaling"
"openshift-model-hive"
Expand Down
27 changes: 0 additions & 27 deletions kubernetes-model-generator/openshift-model-operatorhub/Makefile

This file was deleted.

This file was deleted.

69 changes: 22 additions & 47 deletions kubernetes-model-generator/openshift-model-operatorhub/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,7 @@
<dependencies>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>openshift-model</artifactId>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-model-apps</artifactId>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-model-admissionregistration</artifactId>
<artifactId>kubernetes-model-core</artifactId>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
Expand All @@ -58,50 +50,33 @@
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>attach-artifacts</id>
<configuration>
<skipAttach>false</skipAttach>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>generate</id>
<build>
<plugins>
<plugin>
<groupId>org.jsonschema2pojo</groupId>
<artifactId>jsonschema2pojo-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>generate-sources</phase>
<configuration>
<target>
<echo>Removing the duplicate generated class</echo>
<delete
file="${generate.targetDirectory}/io/fabric8/openshift/api/model/operatorhub/v1alpha1/OperatorVersion.java"
verbose="true" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<groupId>io.fabric8</groupId>
<artifactId>openapi-model-generator-maven-plugin</artifactId>
<configuration >
<settings combine.self="append">
<schemas>
<schema>${openapi.schema.openshift-latest}</schema>
</schemas>
<packageMappings combine.self="append">
<io.k8s.api>io.fabric8.kubernetes.api.model</io.k8s.api>
<io.openshift.operatorhub>io.fabric8.openshift.api.model.operatorhub</io.openshift.operatorhub>
<com.coreos.operators>io.fabric8.openshift.api.model.operatorhub</com.coreos.operators>
<com.github.operator-framework.api.pkg.operators>io.fabric8.openshift.api.model.operatorhub</com.github.operator-framework.api.pkg.operators>
<com.github.operator-framework.operator-lifecycle-manager.pkg.package-server.apis.operators>io.fabric8.openshift.api.model.operatorhub.lifecyclemanager</com.github.operator-framework.operator-lifecycle-manager.pkg.package-server.apis.operators>
</packageMappings>
<includeGenerationRegexes>
<includeGenerationRegex>^com\.coreos\.operators\..*$</includeGenerationRegex>
<includeGenerationRegex>^com\.github\.operator-framework\.api\.pkg\.operators\.v1alpha1\..*$</includeGenerationRegex>
<includeGenerationRegex>^com\.github\.operator-framework\.operator-lifecycle-manager\.pkg\.package-server\.apis\.operators\..*$</includeGenerationRegex>
</includeGenerationRegexes>
</settings>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
Loading

0 comments on commit b50415c

Please sign in to comment.