diff --git a/kubernetes-model-generator/kubernetes-model-core/cmd/generate/generate.go b/kubernetes-model-generator/kubernetes-model-core/cmd/generate/generate.go index b0224a9e585..80b6baee55f 100644 --- a/kubernetes-model-generator/kubernetes-model-core/cmd/generate/generate.go +++ b/kubernetes-model-generator/kubernetes-model-core/cmd/generate/generate.go @@ -43,6 +43,7 @@ type Schema struct { APIGroupList metav1.APIGroupList APIResource metav1.APIResource APIResourceList metav1.APIResourceList + APIVersions metav1.APIVersions KubernetesList metav1.List ObjectMeta metav1.ObjectMeta TypeMeta metav1.TypeMeta diff --git a/kubernetes-model-generator/kubernetes-model-core/src/generated/java/io/fabric8/kubernetes/api/model/APIVersions.java b/kubernetes-model-generator/kubernetes-model-core/src/generated/java/io/fabric8/kubernetes/api/model/APIVersions.java new file mode 100644 index 00000000000..2006784df1d --- /dev/null +++ b/kubernetes-model-generator/kubernetes-model-core/src/generated/java/io/fabric8/kubernetes/api/model/APIVersions.java @@ -0,0 +1,174 @@ + +package io.fabric8.kubernetes.api.model; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import javax.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import io.fabric8.kubernetes.api.builder.Editable; +import io.fabric8.kubernetes.model.annotation.Group; +import io.fabric8.kubernetes.model.annotation.Version; +import io.sundr.builder.annotations.Buildable; +import io.sundr.transform.annotations.TemplateTransformation; +import io.sundr.transform.annotations.TemplateTransformations; +import lombok.EqualsAndHashCode; +import lombok.ToString; +import lombok.experimental.Accessors; + +@JsonDeserialize(using = com.fasterxml.jackson.databind.JsonDeserializer.None.class) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "apiVersion", + "kind", + "serverAddressByClientCIDRs", + "versions" +}) +@ToString +@EqualsAndHashCode +@Accessors(prefix = { + "_", + "" +}) +@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, lazyCollectionInitEnabled = false, builderPackage = "io.fabric8.kubernetes.api.builder") +@TemplateTransformations({ + @TemplateTransformation(value = "/manifest.vm", outputPath = "META-INF/services/io.fabric8.kubernetes.api.model.KubernetesResource", gather = true) +}) +@Version("v1") +@Group("") +@Generated("jsonschema2pojo") +public class APIVersions implements Editable , KubernetesResource +{ + + /** + * + * (Required) + * + */ + @JsonProperty("apiVersion") + private String apiVersion = "v1"; + /** + * + * (Required) + * + */ + @JsonProperty("kind") + private String kind = "APIVersions"; + @JsonProperty("serverAddressByClientCIDRs") + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private List serverAddressByClientCIDRs = new ArrayList<>(); + @JsonProperty("versions") + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private List versions = new ArrayList<>(); + @JsonIgnore + private Map additionalProperties = new LinkedHashMap(); + + /** + * No args constructor for use in serialization + * + */ + public APIVersions() { + } + + public APIVersions(String apiVersion, String kind, List serverAddressByClientCIDRs, List versions) { + super(); + this.apiVersion = apiVersion; + this.kind = kind; + this.serverAddressByClientCIDRs = serverAddressByClientCIDRs; + this.versions = versions; + } + + /** + * + * (Required) + * + */ + @JsonProperty("apiVersion") + public String getApiVersion() { + return apiVersion; + } + + /** + * + * (Required) + * + */ + @JsonProperty("apiVersion") + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + /** + * + * (Required) + * + */ + @JsonProperty("kind") + public String getKind() { + return kind; + } + + /** + * + * (Required) + * + */ + @JsonProperty("kind") + public void setKind(String kind) { + this.kind = kind; + } + + @JsonProperty("serverAddressByClientCIDRs") + @JsonInclude(JsonInclude.Include.NON_EMPTY) + public List getServerAddressByClientCIDRs() { + return serverAddressByClientCIDRs; + } + + @JsonProperty("serverAddressByClientCIDRs") + public void setServerAddressByClientCIDRs(List serverAddressByClientCIDRs) { + this.serverAddressByClientCIDRs = serverAddressByClientCIDRs; + } + + @JsonProperty("versions") + @JsonInclude(JsonInclude.Include.NON_EMPTY) + public List getVersions() { + return versions; + } + + @JsonProperty("versions") + public void setVersions(List versions) { + this.versions = versions; + } + + @JsonIgnore + public APIVersionsBuilder edit() { + return new APIVersionsBuilder(this); + } + + @JsonIgnore + public APIVersionsBuilder toBuilder() { + return edit(); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + + public void setAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + +} diff --git a/kubernetes-model-generator/kubernetes-model-core/src/generated/java/io/fabric8/kubernetes/api/model/KubeSchema.java b/kubernetes-model-generator/kubernetes-model-core/src/generated/java/io/fabric8/kubernetes/api/model/KubeSchema.java index 6d71d59e426..c9c918b88e7 100644 --- a/kubernetes-model-generator/kubernetes-model-core/src/generated/java/io/fabric8/kubernetes/api/model/KubeSchema.java +++ b/kubernetes-model-generator/kubernetes-model-core/src/generated/java/io/fabric8/kubernetes/api/model/KubeSchema.java @@ -19,6 +19,7 @@ public class KubeSchema { private APIResourceList aPIResourceList; private APIService aPIService; private APIServiceList aPIServiceList; + private APIVersions aPIVersions; private Binding binding; private ComponentStatus componentStatus; private ComponentStatusList componentStatusList; @@ -87,7 +88,7 @@ public class KubeSchema { public KubeSchema() { } - public KubeSchema(APIGroup aPIGroup, APIGroupList aPIGroupList, APIResource aPIResource, APIResourceList aPIResourceList, APIService aPIService, APIServiceList aPIServiceList, Binding binding, ComponentStatus componentStatus, ComponentStatusList componentStatusList, Condition condition, Config config, ConfigMap configMap, ConfigMapList configMapList, ContainerStatus containerStatus, CreateOptions createOptions, DeleteOptions deleteOptions, EndpointPort endpointPort, Endpoints endpoints, EndpointsList endpointsList, EnvVar envVar, Event event, EventList eventList, EventSeries eventSeries, EventSource eventSource, GetOptions getOptions, GroupKind groupKind, GroupVersionKind groupVersionKind, GroupVersionResource groupVersionResource, Info info, KubernetesList kubernetesList, LimitRangeList limitRangeList, ListOptions listOptions, MicroTime microTime, Namespace namespace, NamespaceList namespaceList, Node node, NodeList nodeList, ObjectMeta objectMeta, Patch patch, PatchOptions patchOptions, PersistentVolume persistentVolume, PersistentVolumeClaim persistentVolumeClaim, PersistentVolumeClaimList persistentVolumeClaimList, PersistentVolumeList persistentVolumeList, PodExecOptions podExecOptions, PodList podList, PodTemplateList podTemplateList, Quantity quantity, ReplicationControllerList replicationControllerList, ResourceQuota resourceQuota, ResourceQuotaList resourceQuotaList, RootPaths rootPaths, Secret secret, SecretList secretList, ServiceAccount serviceAccount, ServiceAccountList serviceAccountList, ServiceList serviceList, Status status, String time, Toleration toleration, TopologySelectorTerm topologySelectorTerm, TypeMeta typeMeta, UpdateOptions updateOptions, WatchEvent watchEvent) { + public KubeSchema(APIGroup aPIGroup, APIGroupList aPIGroupList, APIResource aPIResource, APIResourceList aPIResourceList, APIService aPIService, APIServiceList aPIServiceList, APIVersions aPIVersions, Binding binding, ComponentStatus componentStatus, ComponentStatusList componentStatusList, Condition condition, Config config, ConfigMap configMap, ConfigMapList configMapList, ContainerStatus containerStatus, CreateOptions createOptions, DeleteOptions deleteOptions, EndpointPort endpointPort, Endpoints endpoints, EndpointsList endpointsList, EnvVar envVar, Event event, EventList eventList, EventSeries eventSeries, EventSource eventSource, GetOptions getOptions, GroupKind groupKind, GroupVersionKind groupVersionKind, GroupVersionResource groupVersionResource, Info info, KubernetesList kubernetesList, LimitRangeList limitRangeList, ListOptions listOptions, MicroTime microTime, Namespace namespace, NamespaceList namespaceList, Node node, NodeList nodeList, ObjectMeta objectMeta, Patch patch, PatchOptions patchOptions, PersistentVolume persistentVolume, PersistentVolumeClaim persistentVolumeClaim, PersistentVolumeClaimList persistentVolumeClaimList, PersistentVolumeList persistentVolumeList, PodExecOptions podExecOptions, PodList podList, PodTemplateList podTemplateList, Quantity quantity, ReplicationControllerList replicationControllerList, ResourceQuota resourceQuota, ResourceQuotaList resourceQuotaList, RootPaths rootPaths, Secret secret, SecretList secretList, ServiceAccount serviceAccount, ServiceAccountList serviceAccountList, ServiceList serviceList, Status status, String time, Toleration toleration, TopologySelectorTerm topologySelectorTerm, TypeMeta typeMeta, UpdateOptions updateOptions, WatchEvent watchEvent) { super(); this.aPIGroup = aPIGroup; this.aPIGroupList = aPIGroupList; @@ -95,6 +96,7 @@ public KubeSchema(APIGroup aPIGroup, APIGroupList aPIGroupList, APIResource aPIR this.aPIResourceList = aPIResourceList; this.aPIService = aPIService; this.aPIServiceList = aPIServiceList; + this.aPIVersions = aPIVersions; this.binding = binding; this.componentStatus = componentStatus; this.componentStatusList = componentStatusList; @@ -215,6 +217,16 @@ public void setAPIServiceList(APIServiceList aPIServiceList) { this.aPIServiceList = aPIServiceList; } + @JsonProperty("APIVersions") + public APIVersions getAPIVersions() { + return aPIVersions; + } + + @JsonProperty("APIVersions") + public void setAPIVersions(APIVersions aPIVersions) { + this.aPIVersions = aPIVersions; + } + @JsonProperty("Binding") public Binding getBinding() { return binding; diff --git a/kubernetes-model-generator/kubernetes-model-core/src/generated/java/io/fabric8/kubernetes/api/model/ValidationSchema.java b/kubernetes-model-generator/kubernetes-model-core/src/generated/java/io/fabric8/kubernetes/api/model/ValidationSchema.java index 1d4ca7025a8..8ee6d47ebe3 100644 --- a/kubernetes-model-generator/kubernetes-model-core/src/generated/java/io/fabric8/kubernetes/api/model/ValidationSchema.java +++ b/kubernetes-model-generator/kubernetes-model-core/src/generated/java/io/fabric8/kubernetes/api/model/ValidationSchema.java @@ -19,6 +19,7 @@ public class ValidationSchema { private APIResourceList aPIResourceList; private APIService aPIService; private APIServiceList aPIServiceList; + private APIVersions aPIVersions; private Binding binding; private ComponentStatus componentStatus; private ComponentStatusList componentStatusList; @@ -87,7 +88,7 @@ public class ValidationSchema { public ValidationSchema() { } - public ValidationSchema(APIGroup aPIGroup, APIGroupList aPIGroupList, APIResource aPIResource, APIResourceList aPIResourceList, APIService aPIService, APIServiceList aPIServiceList, Binding binding, ComponentStatus componentStatus, ComponentStatusList componentStatusList, Condition condition, Config config, ConfigMap configMap, ConfigMapList configMapList, ContainerStatus containerStatus, CreateOptions createOptions, DeleteOptions deleteOptions, EndpointPort endpointPort, Endpoints endpoints, EndpointsList endpointsList, EnvVar envVar, Event event, EventList eventList, EventSeries eventSeries, EventSource eventSource, GetOptions getOptions, GroupKind groupKind, GroupVersionKind groupVersionKind, GroupVersionResource groupVersionResource, Info info, KubernetesList kubernetesList, LimitRangeList limitRangeList, ListOptions listOptions, MicroTime microTime, Namespace namespace, NamespaceList namespaceList, Node node, NodeList nodeList, ObjectMeta objectMeta, Patch patch, PatchOptions patchOptions, PersistentVolume persistentVolume, PersistentVolumeClaim persistentVolumeClaim, PersistentVolumeClaimList persistentVolumeClaimList, PersistentVolumeList persistentVolumeList, PodExecOptions podExecOptions, PodList podList, PodTemplateList podTemplateList, Quantity quantity, ReplicationControllerList replicationControllerList, ResourceQuota resourceQuota, ResourceQuotaList resourceQuotaList, RootPaths rootPaths, Secret secret, SecretList secretList, ServiceAccount serviceAccount, ServiceAccountList serviceAccountList, ServiceList serviceList, Status status, String time, Toleration toleration, TopologySelectorTerm topologySelectorTerm, TypeMeta typeMeta, UpdateOptions updateOptions, WatchEvent watchEvent) { + public ValidationSchema(APIGroup aPIGroup, APIGroupList aPIGroupList, APIResource aPIResource, APIResourceList aPIResourceList, APIService aPIService, APIServiceList aPIServiceList, APIVersions aPIVersions, Binding binding, ComponentStatus componentStatus, ComponentStatusList componentStatusList, Condition condition, Config config, ConfigMap configMap, ConfigMapList configMapList, ContainerStatus containerStatus, CreateOptions createOptions, DeleteOptions deleteOptions, EndpointPort endpointPort, Endpoints endpoints, EndpointsList endpointsList, EnvVar envVar, Event event, EventList eventList, EventSeries eventSeries, EventSource eventSource, GetOptions getOptions, GroupKind groupKind, GroupVersionKind groupVersionKind, GroupVersionResource groupVersionResource, Info info, KubernetesList kubernetesList, LimitRangeList limitRangeList, ListOptions listOptions, MicroTime microTime, Namespace namespace, NamespaceList namespaceList, Node node, NodeList nodeList, ObjectMeta objectMeta, Patch patch, PatchOptions patchOptions, PersistentVolume persistentVolume, PersistentVolumeClaim persistentVolumeClaim, PersistentVolumeClaimList persistentVolumeClaimList, PersistentVolumeList persistentVolumeList, PodExecOptions podExecOptions, PodList podList, PodTemplateList podTemplateList, Quantity quantity, ReplicationControllerList replicationControllerList, ResourceQuota resourceQuota, ResourceQuotaList resourceQuotaList, RootPaths rootPaths, Secret secret, SecretList secretList, ServiceAccount serviceAccount, ServiceAccountList serviceAccountList, ServiceList serviceList, Status status, String time, Toleration toleration, TopologySelectorTerm topologySelectorTerm, TypeMeta typeMeta, UpdateOptions updateOptions, WatchEvent watchEvent) { super(); this.aPIGroup = aPIGroup; this.aPIGroupList = aPIGroupList; @@ -95,6 +96,7 @@ public ValidationSchema(APIGroup aPIGroup, APIGroupList aPIGroupList, APIResourc this.aPIResourceList = aPIResourceList; this.aPIService = aPIService; this.aPIServiceList = aPIServiceList; + this.aPIVersions = aPIVersions; this.binding = binding; this.componentStatus = componentStatus; this.componentStatusList = componentStatusList; @@ -215,6 +217,16 @@ public void setAPIServiceList(APIServiceList aPIServiceList) { this.aPIServiceList = aPIServiceList; } + @JsonProperty("APIVersions") + public APIVersions getAPIVersions() { + return aPIVersions; + } + + @JsonProperty("APIVersions") + public void setAPIVersions(APIVersions aPIVersions) { + this.aPIVersions = aPIVersions; + } + @JsonProperty("Binding") public Binding getBinding() { return binding; diff --git a/kubernetes-model-generator/kubernetes-model-core/src/main/resources/schema/kube-schema.json b/kubernetes-model-generator/kubernetes-model-core/src/main/resources/schema/kube-schema.json index 15a701d6dca..59da900f808 100644 --- a/kubernetes-model-generator/kubernetes-model-core/src/main/resources/schema/kube-schema.json +++ b/kubernetes-model-generator/kubernetes-model-core/src/main/resources/schema/kube-schema.json @@ -311,6 +311,39 @@ "io.fabric8.kubernetes.api.model.KubernetesResource" ] }, + "kubernetes_apimachinery_pkg_apis_APIVersions": { + "type": "object", + "properties": { + "apiVersion": { + "type": "string", + "default": "v1", + "required": true + }, + "kind": { + "type": "string", + "default": "APIVersions", + "required": true + }, + "serverAddressByClientCIDRs": { + "type": "array", + "items": { + "$ref": "#/definitions/kubernetes_apimachinery_pkg_apis_ServerAddressByClientCIDR", + "existingJavaType": "io.fabric8.kubernetes.api.model.ServerAddressByClientCIDR" + } + }, + "versions": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": true, + "javaType": "io.fabric8.kubernetes.api.model.APIVersions", + "javaInterfaces": [ + "io.fabric8.kubernetes.api.model.KubernetesResource" + ] + }, "kubernetes_apimachinery_pkg_apis_Condition": { "type": "object", "properties": { @@ -8019,6 +8052,10 @@ "$ref": "#/definitions/kubernetes_aggregator_APIServiceList", "existingJavaType": "io.fabric8.kubernetes.api.model.APIServiceList" }, + "APIVersions": { + "$ref": "#/definitions/kubernetes_apimachinery_pkg_apis_APIVersions", + "existingJavaType": "io.fabric8.kubernetes.api.model.APIVersions" + }, "Binding": { "$ref": "#/definitions/kubernetes_core_Binding", "existingJavaType": "io.fabric8.kubernetes.api.model.Binding" diff --git a/kubernetes-model-generator/kubernetes-model-core/src/main/resources/schema/validation-schema.json b/kubernetes-model-generator/kubernetes-model-core/src/main/resources/schema/validation-schema.json index 4b41305a757..9e0a4d9c6c2 100644 --- a/kubernetes-model-generator/kubernetes-model-core/src/main/resources/schema/validation-schema.json +++ b/kubernetes-model-generator/kubernetes-model-core/src/main/resources/schema/validation-schema.json @@ -311,6 +311,39 @@ "io.fabric8.kubernetes.api.model.KubernetesResource" ] }, + "kubernetes_apimachinery_pkg_apis_APIVersions": { + "type": "object", + "properties": { + "apiVersion": { + "type": "string", + "default": "v1", + "required": true + }, + "kind": { + "type": "string", + "default": "APIVersions", + "required": true + }, + "serverAddressByClientCIDRs": { + "type": "array", + "items": { + "$ref": "#/definitions/kubernetes_apimachinery_pkg_apis_ServerAddressByClientCIDR", + "existingJavaType": "io.fabric8.kubernetes.api.model.ServerAddressByClientCIDR" + } + }, + "versions": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": true, + "javaType": "io.fabric8.kubernetes.api.model.APIVersions", + "javaInterfaces": [ + "io.fabric8.kubernetes.api.model.KubernetesResource" + ] + }, "kubernetes_apimachinery_pkg_apis_Condition": { "type": "object", "properties": { @@ -8019,6 +8052,10 @@ "$ref": "#/definitions/kubernetes_aggregator_APIServiceList", "existingJavaType": "io.fabric8.kubernetes.api.model.APIServiceList" }, + "APIVersions": { + "$ref": "#/definitions/kubernetes_apimachinery_pkg_apis_APIVersions", + "existingJavaType": "io.fabric8.kubernetes.api.model.APIVersions" + }, "Binding": { "$ref": "#/definitions/kubernetes_core_Binding", "existingJavaType": "io.fabric8.kubernetes.api.model.Binding" @@ -8513,6 +8550,34 @@ }, "additionalProperties": true }, + "apiversions": { + "properties": { + "apiVersion": { + "type": "string", + "default": "v1", + "required": true + }, + "kind": { + "type": "string", + "default": "APIVersions", + "required": true + }, + "serverAddressByClientCIDRs": { + "type": "array", + "items": { + "$ref": "#/definitions/kubernetes_apimachinery_pkg_apis_ServerAddressByClientCIDR", + "existingJavaType": "io.fabric8.kubernetes.api.model.ServerAddressByClientCIDR" + } + }, + "versions": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": true + }, "apparmorprofile": { "properties": { "localhostProfile": { diff --git a/kubernetes-model-generator/kubernetes-model-core/src/test/java/io/fabric8/kubernetes/api/model/APIVersionsTest.java b/kubernetes-model-generator/kubernetes-model-core/src/test/java/io/fabric8/kubernetes/api/model/APIVersionsTest.java new file mode 100644 index 00000000000..4cde37c7ca4 --- /dev/null +++ b/kubernetes-model-generator/kubernetes-model-core/src/test/java/io/fabric8/kubernetes/api/model/APIVersionsTest.java @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2015 Red Hat, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.fabric8.kubernetes.api.model; + +import com.fasterxml.jackson.databind.ObjectMapper; +import org.assertj.core.api.InstanceOfAssertFactories; +import org.junit.jupiter.api.Test; + +import java.io.IOException; +import java.util.Collections; +import java.util.Scanner; + +import static org.assertj.core.api.Assertions.assertThat; + +class APIVersionsTest { + private final ObjectMapper mapper = new ObjectMapper(); + + @Test + void deserializationAndSerializationShouldWorkAsExpected() throws IOException { + // Given + String originalJson = new Scanner(getClass().getResourceAsStream("/valid-apiversions.json")) + .useDelimiter("\\A") + .next(); + + // When + final APIVersions apiVersions = mapper.readValue(originalJson, APIVersions.class); + final String serializedJson = mapper.writeValueAsString(apiVersions); + + // Then + assertThat(serializedJson).isNotNull(); + assertThat(apiVersions) + .isNotNull() + .hasFieldOrPropertyWithValue("versions", Collections.singletonList("v1")) + .extracting(APIVersions::getServerAddressByClientCIDRs) + .asInstanceOf(InstanceOfAssertFactories.list(ServerAddressByClientCIDR.class)) + .singleElement() + .hasFieldOrPropertyWithValue("clientCIDR", "0.0.0.0/0") + .hasFieldOrPropertyWithValue("serverAddress", "192.168.39.244:8443"); + } + + @Test + void builderShouldCreateObject() { + // Given + APIVersionsBuilder apiVersionsBuilder = new APIVersionsBuilder() + .addToVersions("v1") + .addNewServerAddressByClientCIDR() + .withClientCIDR("0.0.0.0/0") + .withServerAddress("192.168.39.244:8443") + .endServerAddressByClientCIDR(); + // When + APIVersions apiVersions = apiVersionsBuilder.build(); + + // Then + assertThat(apiVersions) + .isNotNull() + .hasFieldOrPropertyWithValue("versions", Collections.singletonList("v1")) + .extracting(APIVersions::getServerAddressByClientCIDRs) + .asInstanceOf(InstanceOfAssertFactories.list(ServerAddressByClientCIDR.class)) + .singleElement() + .hasFieldOrPropertyWithValue("clientCIDR", "0.0.0.0/0") + .hasFieldOrPropertyWithValue("serverAddress", "192.168.39.244:8443"); + } +} diff --git a/kubernetes-model-generator/kubernetes-model-core/src/test/resources/valid-apiversions.json b/kubernetes-model-generator/kubernetes-model-core/src/test/resources/valid-apiversions.json new file mode 100644 index 00000000000..2111d73b966 --- /dev/null +++ b/kubernetes-model-generator/kubernetes-model-core/src/test/resources/valid-apiversions.json @@ -0,0 +1,12 @@ +{ + "kind": "APIVersions", + "versions": [ + "v1" + ], + "serverAddressByClientCIDRs": [ + { + "clientCIDR": "0.0.0.0/0", + "serverAddress": "192.168.39.244:8443" + } + ] +}