Skip to content

Commit

Permalink
refactor: kubernetes-model-admissionregistration generated from OpenA…
Browse files Browse the repository at this point in the history
…PI schemas

Signed-off-by: Marc Nuri <[email protected]>
  • Loading branch information
manusa committed Jul 23, 2024
1 parent 32fb1b5 commit 0f19068
Show file tree
Hide file tree
Showing 48 changed files with 1,058 additions and 2,262 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ generate-openapi-classes:
cd kubernetes-model-generator/openapi/maven-plugin && mvn clean verify
cd kubernetes-model-generator/kubernetes-model-core && mvn -Pgenerate clean install
cd kubernetes-model-generator/kubernetes-model-rbac && mvn -Pgenerate clean install
cd kubernetes-model-generator/kubernetes-model-admissionregistration && 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-admissionregistration"
"kubernetes-model-apiextensions"
"kubernetes-model-apps"
"kubernetes-model-autoscaling"
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -57,52 +57,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/kubernetes/api/model/admission/v1/AdmissionRequest.java" verbose="true" />
<delete
file="${generate.targetDirectory}/io/fabric8/kubernetes/api/model/admission/v1beta1/AdmissionRequest.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>${project.basedir}/../openapi/schemas/kubernetes-1.21.14.json</schema>
<schema>${openapi.schema.kubernetes-latest}</schema>
<schema>${project.basedir}/../openapi/schemas/admission-registration.json</schema>
</schemas>
<packageMappings combine.self="append">
<io.k8s.api>io.fabric8.kubernetes.api.model</io.k8s.api>
<io.k8s.api.authentication.v1>io.fabric8.kubernetes.api.model.authentication</io.k8s.api.authentication.v1>
</packageMappings>
<includeGenerationRegexes>
<includeGenerationRegex>^io\.k8s\.api\.admission\..*$</includeGenerationRegex>
<includeGenerationRegex>^io\.k8s\.api\.admissionregistration\..*$</includeGenerationRegex>
<includeGenerationRegex>^io\.k8s\.api\.authentication\..*$</includeGenerationRegex>
<includeGenerationRegex>^io\.k8s\.api\.authorization\..*$</includeGenerationRegex>
</includeGenerationRegexes>
</settings>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
Loading

0 comments on commit 0f19068

Please sign in to comment.