Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: kubernetes-model-resource generated from OpenAPI schemas #6257

Merged
merged 1 commit into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ generate-openapi-classes:
cd kubernetes-model-generator/kubernetes-model-policy && mvn -Pgenerate clean install
cd kubernetes-model-generator/kubernetes-model-scheduling && mvn -Pgenerate clean install
cd kubernetes-model-generator/kubernetes-model-storageclass && mvn -Pgenerate clean install
cd kubernetes-model-generator/kubernetes-model-resource && 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-resource"
"kubernetes-model-kustomize"
"openshift-model-config"
"openshift-model"
Expand Down
27 changes: 0 additions & 27 deletions kubernetes-model-generator/kubernetes-model-resource/Makefile

This file was deleted.

This file was deleted.

47 changes: 24 additions & 23 deletions kubernetes-model-generator/kubernetes-model-resource/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,42 +43,43 @@
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-model-core</artifactId>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-model-common</artifactId>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</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>
<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.resource>io.fabric8.kubernetes.api.model.resource</io.k8s.api.resource>
</packageMappings>
<includeGenerationRegexes>
<includeGenerationRegex>^io\.k8s\.api\.resource\..*$</includeGenerationRegex>
</includeGenerationRegexes>
<skipGenerationRegexes>
<!--
Needs a manual override to avoid issues with Sundrio generating duplicate methods in the builder.
Since the parameters field is typed as KubernetesResource when using the new openapi-genarator,
Sundrio will generate withNewXxx methods for each class extending KubernetesResource.
Sundrio seems to have a bug when some of these classes share a name and generates stuff twice.
-->
<skipGenerationRegex>^io\.k8s\.api\.resource\.resource\.v1alpha2\.VendorParameters$</skipGenerationRegex>
</skipGenerationRegexes>
</settings>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
Loading
Loading