Skip to content

Commit

Permalink
refactor: io.istio 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 authored Oct 28, 2024
1 parent 28564a9 commit ed694c4
Show file tree
Hide file tree
Showing 467 changed files with 15,310 additions and 27,843 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ openapi-generate-java-classes:
cd kubernetes-model-generator && mvn $(MAVEN_ARGS) -Pgenerate clean install
# TODO: run generate from extensions module root once all extensions are migrated
cd extensions && mvn $(MAVEN_ARGS) -N clean install
cd extensions/istio && mvn $(MAVEN_ARGS) -N clean install
cd extensions/istio/model && mvn $(MAVEN_ARGS) -Pgenerate clean install
cd extensions/knative && mvn $(MAVEN_ARGS) -N clean install
cd extensions/knative/model && mvn $(MAVEN_ARGS) -Pgenerate clean install
cd extensions/tekton && mvn $(MAVEN_ARGS) -N clean install
Expand Down
18 changes: 18 additions & 0 deletions doc/MIGRATION-v7.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- [Removed deprecated types for network.openshift.io (OpenShift-SDN-only)](#openshift-network-removed)
- [Renamed clusterautoscaling to autoscaling](#openshift-clusterautoscaling-to-autoscaling)
- [Renamed machineconfig to machineconfiguration](#openshift-machineconfig-to-machineconfiguration)
- [Istio Extension](#istio-extension)
- [Tekton Extension](#tekton-extension)
- [Vertical Pod Autoscaler Extension](#vertical-pod-autoscaler-extension)
- [MockWebServer is based on Vert.x](#mockwebserver-vertx)
Expand Down Expand Up @@ -108,6 +109,23 @@ The package has also been renamed from `io.fabric8.openshift.api.model.machineco

The OpenShiftClient DSL entry-point remains the same: `OpenShiftClient.machineConfigurations()`.

### Istio Extension <a href="#istio-extension" id="istio-extension"/>

All the model modules for the Istio extension have been merged into a single module `io.fabric8:istio-model`.
You will be able to find the packages from `io:fabric8:istio-model-v1alpha3` and `io:fabric8:istio-model-v1beta1` in the new module artifact.

Many of the classes have also been moved to a nested `api` package following the Go types structure.
The following packages are now available:
- `io.fabric8.istio.api.api.meta.v1alpha1`
- `io.fabric8.istio.api.api.type.v1beta1`
- `io.fabric8.istio.api.api.analysis.v1alpha1`
- `io.fabric8.istio.api.api.extensions.v1alpha1`
- `io.fabric8.istio.api.api.networking.v1alpha3`
- `io.fabric8.istio.api.api.networking.v1beta1`
- `io.fabric8.istio.api.api.security.v1alpha1`
- `io.fabric8.istio.api.api.security.v1beta1`
- `io.fabric8.istio.api.api.telemetry.v1alpha1`

### Tekton Extension <a href="#tekton-extension" id="tekton-extension"/>

All the model modules for the Tekton extension have been merged into a single module `io.fabric8:tekton-model`.
Expand Down
25 changes: 1 addition & 24 deletions extensions/istio/client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,9 @@
</properties>

<dependencies>
<dependency>
<groupId>io.sundr</groupId>
<artifactId>builder-annotations</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.sundr</groupId>
<artifactId>transform-annotations</artifactId>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>istio-model-v1alpha3</artifactId>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>istio-model-v1beta1</artifactId>
<artifactId>istio-model</artifactId>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
Expand All @@ -78,16 +65,6 @@
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-client-api</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
*/
package io.fabric8.istio.api.examples.v1beta1;

import io.fabric8.istio.api.security.v1beta1.AuthorizationPolicyAction;
import io.fabric8.istio.api.api.security.v1beta1.AuthorizationPolicyAction;
import io.fabric8.istio.api.api.security.v1beta1.ConditionBuilder;
import io.fabric8.istio.api.api.security.v1beta1.OperationBuilder;
import io.fabric8.istio.api.api.security.v1beta1.RuleBuilder;
import io.fabric8.istio.api.api.security.v1beta1.RuleFromBuilder;
import io.fabric8.istio.api.api.security.v1beta1.RuleToBuilder;
import io.fabric8.istio.api.api.security.v1beta1.SourceBuilder;
import io.fabric8.istio.api.api.type.v1beta1.WorkloadSelectorBuilder;
import io.fabric8.istio.api.security.v1beta1.AuthorizationPolicyBuilder;
import io.fabric8.istio.api.security.v1beta1.AuthorizationPolicyList;
import io.fabric8.istio.api.security.v1beta1.ConditionBuilder;
import io.fabric8.istio.api.security.v1beta1.OperationBuilder;
import io.fabric8.istio.api.security.v1beta1.RuleBuilder;
import io.fabric8.istio.api.security.v1beta1.RuleFromBuilder;
import io.fabric8.istio.api.security.v1beta1.RuleToBuilder;
import io.fabric8.istio.api.security.v1beta1.SourceBuilder;
import io.fabric8.istio.api.type.v1beta1.WorkloadSelectorBuilder;
import io.fabric8.istio.client.IstioClient;
import io.fabric8.kubernetes.client.KubernetesClientException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
*/
package io.fabric8.istio.api.examples.v1beta1;

import io.fabric8.istio.api.api.networking.v1alpha3.LoadBalancerSettingsBuilder;
import io.fabric8.istio.api.api.networking.v1alpha3.LoadBalancerSettingsSimple;
import io.fabric8.istio.api.api.networking.v1alpha3.LoadBalancerSettingsSimpleLB;
import io.fabric8.istio.api.networking.v1beta1.DestinationRuleBuilder;
import io.fabric8.istio.api.networking.v1beta1.DestinationRuleList;
import io.fabric8.istio.api.networking.v1beta1.LoadBalancerSettingsBuilder;
import io.fabric8.istio.api.networking.v1beta1.LoadBalancerSettingsSimple;
import io.fabric8.istio.api.networking.v1beta1.LoadBalancerSettingsSimpleLB;
import io.fabric8.istio.client.IstioClient;
import io.fabric8.kubernetes.client.KubernetesClientException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
*/
package io.fabric8.istio.api.examples.v1beta1;

import io.fabric8.istio.api.api.networking.v1alpha3.PortBuilder;
import io.fabric8.istio.api.api.networking.v1alpha3.ServerBuilder;
import io.fabric8.istio.api.api.networking.v1alpha3.ServerTLSSettingsBuilder;
import io.fabric8.istio.api.networking.v1beta1.GatewayBuilder;
import io.fabric8.istio.api.networking.v1beta1.GatewayList;
import io.fabric8.istio.api.networking.v1beta1.PortBuilder;
import io.fabric8.istio.api.networking.v1beta1.ServerBuilder;
import io.fabric8.istio.api.networking.v1beta1.ServerTLSSettingsBuilder;
import io.fabric8.istio.client.IstioClient;
import io.fabric8.kubernetes.client.KubernetesClientException;

Expand Down Expand Up @@ -49,7 +49,7 @@ public static void createResource(IstioClient client) {
.withNewSpec()
.withSelector(Collections.singletonMap("app", "my-gateway-controller"))
.withServers(new ServerBuilder()
.withPort(new PortBuilder().withNumber(80).withProtocol("HTTP").withName("http").build())
.withPort(new PortBuilder().withNumber(80L).withProtocol("HTTP").withName("http").build())
.withHosts("uk.bookinfo.com", "eu.bookinfo.com")
.withTls(new ServerTLSSettingsBuilder().withHttpsRedirect(true).build())
.build())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
*/
package io.fabric8.istio.api.examples.v1beta1;

import io.fabric8.istio.api.api.security.v1beta1.PeerAuthenticationMutualTLSBuilder;
import io.fabric8.istio.api.api.security.v1beta1.PeerAuthenticationMutualTLSMode;
import io.fabric8.istio.api.api.type.v1beta1.WorkloadSelectorBuilder;
import io.fabric8.istio.api.security.v1beta1.PeerAuthenticationBuilder;
import io.fabric8.istio.api.security.v1beta1.PeerAuthenticationList;
import io.fabric8.istio.api.security.v1beta1.PeerAuthenticationMutualTLSBuilder;
import io.fabric8.istio.api.security.v1beta1.PeerAuthenticationMutualTLSMode;
import io.fabric8.istio.api.type.v1beta1.WorkloadSelectorBuilder;
import io.fabric8.istio.client.IstioClient;
import io.fabric8.kubernetes.client.KubernetesClientException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
*/
package io.fabric8.istio.api.examples.v1beta1;

import io.fabric8.istio.api.api.networking.v1alpha3.ServiceEntryLocation;
import io.fabric8.istio.api.api.networking.v1alpha3.ServicePortBuilder;
import io.fabric8.istio.api.networking.v1beta1.ServiceEntryBuilder;
import io.fabric8.istio.api.networking.v1beta1.ServiceEntryList;
import io.fabric8.istio.api.networking.v1beta1.ServiceEntryLocation;
import io.fabric8.istio.api.networking.v1beta1.ServicePortBuilder;
import io.fabric8.istio.client.IstioClient;
import io.fabric8.kubernetes.client.KubernetesClientException;

Expand Down Expand Up @@ -46,7 +46,7 @@ public static void createResource(IstioClient client) {
.withNewSpec()
.withHosts("api.dropboxapi.com", "www.googleapis.com")
.withLocation(ServiceEntryLocation.MESH_INTERNAL)
.withPorts(new ServicePortBuilder().withName("https").withProtocol("TLS").withNumber(443).build())
.withPorts(new ServicePortBuilder().withName("https").withProtocol("TLS").withNumber(443L).build())
.endSpec()
.build());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package io.fabric8.istio.api.examples.v1beta1;

import io.fabric8.istio.api.networking.v1beta1.IstioEgressListenerBuilder;
import io.fabric8.istio.api.api.networking.v1alpha3.IstioEgressListenerBuilder;
import io.fabric8.istio.api.networking.v1beta1.SidecarBuilder;
import io.fabric8.istio.api.networking.v1beta1.SidecarList;
import io.fabric8.istio.client.IstioClient;
Expand Down
25 changes: 0 additions & 25 deletions extensions/istio/generateModel.sh

This file was deleted.

1 change: 0 additions & 1 deletion extensions/istio/generator-v1alpha3/.gitignore

This file was deleted.

28 changes: 0 additions & 28 deletions extensions/istio/generator-v1alpha3/Makefile

This file was deleted.

Loading

0 comments on commit ed694c4

Please sign in to comment.