Skip to content

Commit

Permalink
refactor: kubernetes-model-coordination generated from OpenAPI schemas
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Nuri <marc@marcnuri.com>
  • Loading branch information
manusa committed Jul 26, 2024
1 parent 4c25ed3 commit 1acdcb7
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 743 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ generate-openapi-classes:
cd kubernetes-model-generator/kubernetes-model-autoscaling && mvn -Pgenerate clean install
cd kubernetes-model-generator/kubernetes-model-batch && mvn -Pgenerate clean install
cd kubernetes-model-generator/kubernetes-model-certificates && mvn -Pgenerate clean install
cd kubernetes-model-generator/kubernetes-model-coordination && 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=(
"kubernetes-model-coordination"
"kubernetes-model-discovery"
"kubernetes-model-events"
"kubernetes-model-extensions"
Expand Down
27 changes: 0 additions & 27 deletions kubernetes-model-generator/kubernetes-model-coordination/Makefile

This file was deleted.

This file was deleted.

58 changes: 18 additions & 40 deletions kubernetes-model-generator/kubernetes-model-coordination/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,54 +41,32 @@
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-model-core</artifactId>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-model-common</artifactId>
</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/kubernetes/api/model/coordination/v1/LeaseSpec.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.kubernetes-latest}</schema>
</schemas>
<packageMappings combine.self="append">
<io.k8s.api.coordination>io.fabric8.kubernetes.api.model.coordination</io.k8s.api.coordination>
</packageMappings>
<skipGenerationRegexes>
<skipGenerationRegex>^io\.k8s\.api\.coordination\.v1\.LeaseSpec$</skipGenerationRegex>
</skipGenerationRegexes>
<includeGenerationRegexes>
<includeGenerationRegex>^io\.k8s\.api\.coordination\..*$</includeGenerationRegex>
</includeGenerationRegexes>
</settings>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
Loading

0 comments on commit 1acdcb7

Please sign in to comment.