diff --git a/Makefile b/Makefile index 68fcaf09e2b..a58d77b9e72 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/kubernetes-model-generator/generateModel.sh b/kubernetes-model-generator/generateModel.sh index 865c686d30c..35cb02674f8 100755 --- a/kubernetes-model-generator/generateModel.sh +++ b/kubernetes-model-generator/generateModel.sh @@ -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" diff --git a/kubernetes-model-generator/kubernetes-model-resource/Makefile b/kubernetes-model-generator/kubernetes-model-resource/Makefile deleted file mode 100644 index c09a7003874..00000000000 --- a/kubernetes-model-generator/kubernetes-model-resource/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -# -# 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. -# - -SHELL := /bin/bash - -all: build - -build: gobuild - mvn -Pgenerate clean install -DskipTests - -gobuild: - CGO_ENABLED=0 GO15VENDOREXPERIMENT=1 go build -a ./cmd/generate/generate.go - ./generate > src/main/resources/schema/kube-schema.json - ./generate validation > src/main/resources/schema/validation-schema.json diff --git a/kubernetes-model-generator/kubernetes-model-resource/cmd/generate/generate.go b/kubernetes-model-generator/kubernetes-model-resource/cmd/generate/generate.go deleted file mode 100644 index d0f63b64625..00000000000 --- a/kubernetes-model-generator/kubernetes-model-resource/cmd/generate/generate.go +++ /dev/null @@ -1,93 +0,0 @@ -/** - * 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 main - -import ( - "bytes" - "encoding/json" - "fmt" - v1alpha2resource "k8s.io/api/resource/v1alpha2" - "k8s.io/apimachinery/pkg/runtime" - - "log" - "reflect" - "strings" - "time" - - "os" - - "github.com/fabric8io/kubernetes-client/kubernetes-model-generator/pkg/schemagen" -) - -type Schema struct { - ResourceClaim v1alpha2resource.ResourceClaim - ResourceClaimList v1alpha2resource.ResourceClaimList - ResourceClass v1alpha2resource.ResourceClass - PodSchedulingContext v1alpha2resource.PodSchedulingContext - PodSchedulingContextList v1alpha2resource.PodSchedulingContextList - ResourceClassList v1alpha2resource.ResourceClassList - ResourceClaimTemplate v1alpha2resource.ResourceClaimTemplate - ResourceClaimTemplateList v1alpha2resource.ResourceClaimTemplateList - ResourceSlice v1alpha2resource.ResourceSlice - ResourceSliceList v1alpha2resource.ResourceSliceList - ResourceClaimParameters v1alpha2resource.ResourceClaimParameters - ResourceClaimParametersList v1alpha2resource.ResourceClaimParametersList - ResourceClassParameters v1alpha2resource.ResourceClassParameters - ResourceClassParametersList v1alpha2resource.ResourceClassParametersList -} - -func main() { - packages := []schemagen.PackageDescriptor{ - {"k8s.io/apimachinery/pkg/api/resource", "", "io.fabric8.kubernetes.api.model", "kubernetes_resource_", false}, - {"k8s.io/apimachinery/pkg/version", "", "io.fabric8.kubernetes.api.model.version", "kubernetes_apimachinery_pkg_version_", false}, - {"k8s.io/apimachinery/pkg/apis/meta/v1", "", "io.fabric8.kubernetes.api.model", "kubernetes_apimachinery_", false}, - {"k8s.io/api/core/v1", "", "io.fabric8.kubernetes.api.model", "kubernetes_core_", false}, - {"k8s.io/api/resource/v1alpha2", "resource.k8s.io", "io.fabric8.kubernetes.api.model.resource.v1alpha2", "kubernetes_resource_v1alpha2_", true}, - } - - typeMap := map[reflect.Type]reflect.Type{ - reflect.TypeOf(time.Time{}): reflect.TypeOf(""), - reflect.TypeOf(struct{}{}): reflect.TypeOf(""), - } - manualTypeMap := map[reflect.Type]string { - reflect.TypeOf(runtime.RawExtension{}): "java.util.Map", - } - schema, err := schemagen.GenerateSchema(reflect.TypeOf(Schema{}), packages, typeMap, manualTypeMap, "resource") - if err != nil { - fmt.Fprintf(os.Stderr, "An error occurred: %v", err) - return - } - - args := os.Args[1:] - if len(args) < 1 || args[0] != "validation" { - schema.Resources = nil - } - - b, err := json.Marshal(&schema) - if err != nil { - log.Fatal(err) - } - result := string(b) - result = strings.Replace(result, "\"additionalProperty\":", "\"additionalProperties\":", -1) - - var out bytes.Buffer - err = json.Indent(&out, []byte(result), "", " ") - if err != nil { - log.Fatal(err) - } - - fmt.Println(out.String()) -} diff --git a/kubernetes-model-generator/kubernetes-model-resource/pom.xml b/kubernetes-model-generator/kubernetes-model-resource/pom.xml index 52a1933d393..f583052b068 100644 --- a/kubernetes-model-generator/kubernetes-model-resource/pom.xml +++ b/kubernetes-model-generator/kubernetes-model-resource/pom.xml @@ -43,10 +43,6 @@ io.fabric8 kubernetes-model-core - - io.fabric8 - kubernetes-model-common - org.assertj assertj-core @@ -54,31 +50,36 @@ - - - - org.codehaus.mojo - build-helper-maven-plugin - - - attach-artifacts - - false - - - - - - - generate - org.jsonschema2pojo - jsonschema2pojo-maven-plugin + io.fabric8 + openapi-model-generator-maven-plugin + + + + ${openapi.schema.kubernetes-latest} + + + io.fabric8.kubernetes.api.model.resource + + + ^io\.k8s\.api\.resource\..*$ + + + + ^io\.k8s\.api\.resource\.resource\.v1alpha2\.VendorParameters$ + + + diff --git a/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/KubeSchema.java b/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/KubeSchema.java deleted file mode 100644 index 015088af471..00000000000 --- a/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/KubeSchema.java +++ /dev/null @@ -1,225 +0,0 @@ - -package io.fabric8.kubernetes.api.model; - -import java.util.LinkedHashMap; -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.JsonProperty; -import io.fabric8.kubernetes.api.model.resource.v1alpha2.PodSchedulingContext; -import io.fabric8.kubernetes.api.model.resource.v1alpha2.PodSchedulingContextList; -import io.fabric8.kubernetes.api.model.resource.v1alpha2.ResourceClaim; -import io.fabric8.kubernetes.api.model.resource.v1alpha2.ResourceClaimList; -import io.fabric8.kubernetes.api.model.resource.v1alpha2.ResourceClaimParameters; -import io.fabric8.kubernetes.api.model.resource.v1alpha2.ResourceClaimParametersList; -import io.fabric8.kubernetes.api.model.resource.v1alpha2.ResourceClaimTemplate; -import io.fabric8.kubernetes.api.model.resource.v1alpha2.ResourceClaimTemplateList; -import io.fabric8.kubernetes.api.model.resource.v1alpha2.ResourceClass; -import io.fabric8.kubernetes.api.model.resource.v1alpha2.ResourceClassList; -import io.fabric8.kubernetes.api.model.resource.v1alpha2.ResourceClassParameters; -import io.fabric8.kubernetes.api.model.resource.v1alpha2.ResourceClassParametersList; -import io.fabric8.kubernetes.api.model.resource.v1alpha2.ResourceSlice; -import io.fabric8.kubernetes.api.model.resource.v1alpha2.ResourceSliceList; - -@Generated("jsonschema2pojo") -public class KubeSchema { - - private PodSchedulingContext podSchedulingContext; - private PodSchedulingContextList podSchedulingContextList; - private ResourceClaim resourceClaim; - private ResourceClaimList resourceClaimList; - private ResourceClaimParameters resourceClaimParameters; - private ResourceClaimParametersList resourceClaimParametersList; - private ResourceClaimTemplate resourceClaimTemplate; - private ResourceClaimTemplateList resourceClaimTemplateList; - private ResourceClass resourceClass; - private ResourceClassList resourceClassList; - private ResourceClassParameters resourceClassParameters; - private ResourceClassParametersList resourceClassParametersList; - private ResourceSlice resourceSlice; - private ResourceSliceList resourceSliceList; - @JsonIgnore - private Map additionalProperties = new LinkedHashMap(); - - /** - * No args constructor for use in serialization - * - */ - public KubeSchema() { - } - - public KubeSchema(PodSchedulingContext podSchedulingContext, PodSchedulingContextList podSchedulingContextList, ResourceClaim resourceClaim, ResourceClaimList resourceClaimList, ResourceClaimParameters resourceClaimParameters, ResourceClaimParametersList resourceClaimParametersList, ResourceClaimTemplate resourceClaimTemplate, ResourceClaimTemplateList resourceClaimTemplateList, ResourceClass resourceClass, ResourceClassList resourceClassList, ResourceClassParameters resourceClassParameters, ResourceClassParametersList resourceClassParametersList, ResourceSlice resourceSlice, ResourceSliceList resourceSliceList) { - super(); - this.podSchedulingContext = podSchedulingContext; - this.podSchedulingContextList = podSchedulingContextList; - this.resourceClaim = resourceClaim; - this.resourceClaimList = resourceClaimList; - this.resourceClaimParameters = resourceClaimParameters; - this.resourceClaimParametersList = resourceClaimParametersList; - this.resourceClaimTemplate = resourceClaimTemplate; - this.resourceClaimTemplateList = resourceClaimTemplateList; - this.resourceClass = resourceClass; - this.resourceClassList = resourceClassList; - this.resourceClassParameters = resourceClassParameters; - this.resourceClassParametersList = resourceClassParametersList; - this.resourceSlice = resourceSlice; - this.resourceSliceList = resourceSliceList; - } - - @JsonProperty("PodSchedulingContext") - public PodSchedulingContext getPodSchedulingContext() { - return podSchedulingContext; - } - - @JsonProperty("PodSchedulingContext") - public void setPodSchedulingContext(PodSchedulingContext podSchedulingContext) { - this.podSchedulingContext = podSchedulingContext; - } - - @JsonProperty("PodSchedulingContextList") - public PodSchedulingContextList getPodSchedulingContextList() { - return podSchedulingContextList; - } - - @JsonProperty("PodSchedulingContextList") - public void setPodSchedulingContextList(PodSchedulingContextList podSchedulingContextList) { - this.podSchedulingContextList = podSchedulingContextList; - } - - @JsonProperty("ResourceClaim") - public ResourceClaim getResourceClaim() { - return resourceClaim; - } - - @JsonProperty("ResourceClaim") - public void setResourceClaim(ResourceClaim resourceClaim) { - this.resourceClaim = resourceClaim; - } - - @JsonProperty("ResourceClaimList") - public ResourceClaimList getResourceClaimList() { - return resourceClaimList; - } - - @JsonProperty("ResourceClaimList") - public void setResourceClaimList(ResourceClaimList resourceClaimList) { - this.resourceClaimList = resourceClaimList; - } - - @JsonProperty("ResourceClaimParameters") - public ResourceClaimParameters getResourceClaimParameters() { - return resourceClaimParameters; - } - - @JsonProperty("ResourceClaimParameters") - public void setResourceClaimParameters(ResourceClaimParameters resourceClaimParameters) { - this.resourceClaimParameters = resourceClaimParameters; - } - - @JsonProperty("ResourceClaimParametersList") - public ResourceClaimParametersList getResourceClaimParametersList() { - return resourceClaimParametersList; - } - - @JsonProperty("ResourceClaimParametersList") - public void setResourceClaimParametersList(ResourceClaimParametersList resourceClaimParametersList) { - this.resourceClaimParametersList = resourceClaimParametersList; - } - - @JsonProperty("ResourceClaimTemplate") - public ResourceClaimTemplate getResourceClaimTemplate() { - return resourceClaimTemplate; - } - - @JsonProperty("ResourceClaimTemplate") - public void setResourceClaimTemplate(ResourceClaimTemplate resourceClaimTemplate) { - this.resourceClaimTemplate = resourceClaimTemplate; - } - - @JsonProperty("ResourceClaimTemplateList") - public ResourceClaimTemplateList getResourceClaimTemplateList() { - return resourceClaimTemplateList; - } - - @JsonProperty("ResourceClaimTemplateList") - public void setResourceClaimTemplateList(ResourceClaimTemplateList resourceClaimTemplateList) { - this.resourceClaimTemplateList = resourceClaimTemplateList; - } - - @JsonProperty("ResourceClass") - public ResourceClass getResourceClass() { - return resourceClass; - } - - @JsonProperty("ResourceClass") - public void setResourceClass(ResourceClass resourceClass) { - this.resourceClass = resourceClass; - } - - @JsonProperty("ResourceClassList") - public ResourceClassList getResourceClassList() { - return resourceClassList; - } - - @JsonProperty("ResourceClassList") - public void setResourceClassList(ResourceClassList resourceClassList) { - this.resourceClassList = resourceClassList; - } - - @JsonProperty("ResourceClassParameters") - public ResourceClassParameters getResourceClassParameters() { - return resourceClassParameters; - } - - @JsonProperty("ResourceClassParameters") - public void setResourceClassParameters(ResourceClassParameters resourceClassParameters) { - this.resourceClassParameters = resourceClassParameters; - } - - @JsonProperty("ResourceClassParametersList") - public ResourceClassParametersList getResourceClassParametersList() { - return resourceClassParametersList; - } - - @JsonProperty("ResourceClassParametersList") - public void setResourceClassParametersList(ResourceClassParametersList resourceClassParametersList) { - this.resourceClassParametersList = resourceClassParametersList; - } - - @JsonProperty("ResourceSlice") - public ResourceSlice getResourceSlice() { - return resourceSlice; - } - - @JsonProperty("ResourceSlice") - public void setResourceSlice(ResourceSlice resourceSlice) { - this.resourceSlice = resourceSlice; - } - - @JsonProperty("ResourceSliceList") - public ResourceSliceList getResourceSliceList() { - return resourceSliceList; - } - - @JsonProperty("ResourceSliceList") - public void setResourceSliceList(ResourceSliceList resourceSliceList) { - this.resourceSliceList = resourceSliceList; - } - - @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-resource/src/generated/java/io/fabric8/kubernetes/api/model/ValidationSchema.java b/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/ValidationSchema.java deleted file mode 100644 index 0bac79d9515..00000000000 --- a/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/ValidationSchema.java +++ /dev/null @@ -1,225 +0,0 @@ - -package io.fabric8.kubernetes.api.model; - -import java.util.LinkedHashMap; -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.JsonProperty; -import io.fabric8.kubernetes.api.model.resource.v1alpha2.PodSchedulingContext; -import io.fabric8.kubernetes.api.model.resource.v1alpha2.PodSchedulingContextList; -import io.fabric8.kubernetes.api.model.resource.v1alpha2.ResourceClaim; -import io.fabric8.kubernetes.api.model.resource.v1alpha2.ResourceClaimList; -import io.fabric8.kubernetes.api.model.resource.v1alpha2.ResourceClaimParameters; -import io.fabric8.kubernetes.api.model.resource.v1alpha2.ResourceClaimParametersList; -import io.fabric8.kubernetes.api.model.resource.v1alpha2.ResourceClaimTemplate; -import io.fabric8.kubernetes.api.model.resource.v1alpha2.ResourceClaimTemplateList; -import io.fabric8.kubernetes.api.model.resource.v1alpha2.ResourceClass; -import io.fabric8.kubernetes.api.model.resource.v1alpha2.ResourceClassList; -import io.fabric8.kubernetes.api.model.resource.v1alpha2.ResourceClassParameters; -import io.fabric8.kubernetes.api.model.resource.v1alpha2.ResourceClassParametersList; -import io.fabric8.kubernetes.api.model.resource.v1alpha2.ResourceSlice; -import io.fabric8.kubernetes.api.model.resource.v1alpha2.ResourceSliceList; - -@Generated("jsonschema2pojo") -public class ValidationSchema { - - private PodSchedulingContext podSchedulingContext; - private PodSchedulingContextList podSchedulingContextList; - private ResourceClaim resourceClaim; - private ResourceClaimList resourceClaimList; - private ResourceClaimParameters resourceClaimParameters; - private ResourceClaimParametersList resourceClaimParametersList; - private ResourceClaimTemplate resourceClaimTemplate; - private ResourceClaimTemplateList resourceClaimTemplateList; - private ResourceClass resourceClass; - private ResourceClassList resourceClassList; - private ResourceClassParameters resourceClassParameters; - private ResourceClassParametersList resourceClassParametersList; - private ResourceSlice resourceSlice; - private ResourceSliceList resourceSliceList; - @JsonIgnore - private Map additionalProperties = new LinkedHashMap(); - - /** - * No args constructor for use in serialization - * - */ - public ValidationSchema() { - } - - public ValidationSchema(PodSchedulingContext podSchedulingContext, PodSchedulingContextList podSchedulingContextList, ResourceClaim resourceClaim, ResourceClaimList resourceClaimList, ResourceClaimParameters resourceClaimParameters, ResourceClaimParametersList resourceClaimParametersList, ResourceClaimTemplate resourceClaimTemplate, ResourceClaimTemplateList resourceClaimTemplateList, ResourceClass resourceClass, ResourceClassList resourceClassList, ResourceClassParameters resourceClassParameters, ResourceClassParametersList resourceClassParametersList, ResourceSlice resourceSlice, ResourceSliceList resourceSliceList) { - super(); - this.podSchedulingContext = podSchedulingContext; - this.podSchedulingContextList = podSchedulingContextList; - this.resourceClaim = resourceClaim; - this.resourceClaimList = resourceClaimList; - this.resourceClaimParameters = resourceClaimParameters; - this.resourceClaimParametersList = resourceClaimParametersList; - this.resourceClaimTemplate = resourceClaimTemplate; - this.resourceClaimTemplateList = resourceClaimTemplateList; - this.resourceClass = resourceClass; - this.resourceClassList = resourceClassList; - this.resourceClassParameters = resourceClassParameters; - this.resourceClassParametersList = resourceClassParametersList; - this.resourceSlice = resourceSlice; - this.resourceSliceList = resourceSliceList; - } - - @JsonProperty("PodSchedulingContext") - public PodSchedulingContext getPodSchedulingContext() { - return podSchedulingContext; - } - - @JsonProperty("PodSchedulingContext") - public void setPodSchedulingContext(PodSchedulingContext podSchedulingContext) { - this.podSchedulingContext = podSchedulingContext; - } - - @JsonProperty("PodSchedulingContextList") - public PodSchedulingContextList getPodSchedulingContextList() { - return podSchedulingContextList; - } - - @JsonProperty("PodSchedulingContextList") - public void setPodSchedulingContextList(PodSchedulingContextList podSchedulingContextList) { - this.podSchedulingContextList = podSchedulingContextList; - } - - @JsonProperty("ResourceClaim") - public ResourceClaim getResourceClaim() { - return resourceClaim; - } - - @JsonProperty("ResourceClaim") - public void setResourceClaim(ResourceClaim resourceClaim) { - this.resourceClaim = resourceClaim; - } - - @JsonProperty("ResourceClaimList") - public ResourceClaimList getResourceClaimList() { - return resourceClaimList; - } - - @JsonProperty("ResourceClaimList") - public void setResourceClaimList(ResourceClaimList resourceClaimList) { - this.resourceClaimList = resourceClaimList; - } - - @JsonProperty("ResourceClaimParameters") - public ResourceClaimParameters getResourceClaimParameters() { - return resourceClaimParameters; - } - - @JsonProperty("ResourceClaimParameters") - public void setResourceClaimParameters(ResourceClaimParameters resourceClaimParameters) { - this.resourceClaimParameters = resourceClaimParameters; - } - - @JsonProperty("ResourceClaimParametersList") - public ResourceClaimParametersList getResourceClaimParametersList() { - return resourceClaimParametersList; - } - - @JsonProperty("ResourceClaimParametersList") - public void setResourceClaimParametersList(ResourceClaimParametersList resourceClaimParametersList) { - this.resourceClaimParametersList = resourceClaimParametersList; - } - - @JsonProperty("ResourceClaimTemplate") - public ResourceClaimTemplate getResourceClaimTemplate() { - return resourceClaimTemplate; - } - - @JsonProperty("ResourceClaimTemplate") - public void setResourceClaimTemplate(ResourceClaimTemplate resourceClaimTemplate) { - this.resourceClaimTemplate = resourceClaimTemplate; - } - - @JsonProperty("ResourceClaimTemplateList") - public ResourceClaimTemplateList getResourceClaimTemplateList() { - return resourceClaimTemplateList; - } - - @JsonProperty("ResourceClaimTemplateList") - public void setResourceClaimTemplateList(ResourceClaimTemplateList resourceClaimTemplateList) { - this.resourceClaimTemplateList = resourceClaimTemplateList; - } - - @JsonProperty("ResourceClass") - public ResourceClass getResourceClass() { - return resourceClass; - } - - @JsonProperty("ResourceClass") - public void setResourceClass(ResourceClass resourceClass) { - this.resourceClass = resourceClass; - } - - @JsonProperty("ResourceClassList") - public ResourceClassList getResourceClassList() { - return resourceClassList; - } - - @JsonProperty("ResourceClassList") - public void setResourceClassList(ResourceClassList resourceClassList) { - this.resourceClassList = resourceClassList; - } - - @JsonProperty("ResourceClassParameters") - public ResourceClassParameters getResourceClassParameters() { - return resourceClassParameters; - } - - @JsonProperty("ResourceClassParameters") - public void setResourceClassParameters(ResourceClassParameters resourceClassParameters) { - this.resourceClassParameters = resourceClassParameters; - } - - @JsonProperty("ResourceClassParametersList") - public ResourceClassParametersList getResourceClassParametersList() { - return resourceClassParametersList; - } - - @JsonProperty("ResourceClassParametersList") - public void setResourceClassParametersList(ResourceClassParametersList resourceClassParametersList) { - this.resourceClassParametersList = resourceClassParametersList; - } - - @JsonProperty("ResourceSlice") - public ResourceSlice getResourceSlice() { - return resourceSlice; - } - - @JsonProperty("ResourceSlice") - public void setResourceSlice(ResourceSlice resourceSlice) { - this.resourceSlice = resourceSlice; - } - - @JsonProperty("ResourceSliceList") - public ResourceSliceList getResourceSliceList() { - return resourceSliceList; - } - - @JsonProperty("ResourceSliceList") - public void setResourceSliceList(ResourceSliceList resourceSliceList) { - this.resourceSliceList = resourceSliceList; - } - - @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-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/DriverAllocationResult.java b/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/DriverAllocationResult.java index 1104fae2d96..32f0db77c84 100644 --- a/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/DriverAllocationResult.java +++ b/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/DriverAllocationResult.java @@ -13,6 +13,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.fabric8.kubernetes.api.builder.Editable; import io.fabric8.kubernetes.api.model.Container; +import io.fabric8.kubernetes.api.model.GenericKubernetesResource; import io.fabric8.kubernetes.api.model.IntOrString; import io.fabric8.kubernetes.api.model.KubernetesResource; import io.fabric8.kubernetes.api.model.LabelSelector; @@ -22,6 +23,7 @@ import io.fabric8.kubernetes.api.model.PersistentVolumeClaim; import io.fabric8.kubernetes.api.model.PodTemplateSpec; import io.fabric8.kubernetes.api.model.ResourceRequirements; +import io.fabric8.kubernetes.api.model.runtime.RawExtension; import io.sundr.builder.annotations.Buildable; import io.sundr.builder.annotations.BuildableReference; import lombok.EqualsAndHashCode; @@ -49,7 +51,9 @@ @BuildableReference(IntOrString.class), @BuildableReference(ObjectReference.class), @BuildableReference(LocalObjectReference.class), - @BuildableReference(PersistentVolumeClaim.class) + @BuildableReference(PersistentVolumeClaim.class), + @BuildableReference(GenericKubernetesResource.class), + @BuildableReference(RawExtension.class) }) @Generated("jsonschema2pojo") public class DriverAllocationResult implements Editable , KubernetesResource @@ -58,10 +62,9 @@ public class DriverAllocationResult implements Editable vendorRequestParameters = new LinkedHashMap<>(); + private KubernetesResource vendorRequestParameters; @JsonIgnore - private Map additionalProperties = new LinkedHashMap(); + private Map additionalProperties = new LinkedHashMap(); /** * No args constructor for use in serialization @@ -70,7 +73,7 @@ public class DriverAllocationResult implements Editable vendorRequestParameters) { + public DriverAllocationResult(NamedResourcesAllocationResult namedResources, KubernetesResource vendorRequestParameters) { super(); this.namedResources = namedResources; this.vendorRequestParameters = vendorRequestParameters; @@ -87,13 +90,12 @@ public void setNamedResources(NamedResourcesAllocationResult namedResources) { } @JsonProperty("vendorRequestParameters") - @JsonInclude(JsonInclude.Include.NON_EMPTY) - public Map getVendorRequestParameters() { + public KubernetesResource getVendorRequestParameters() { return vendorRequestParameters; } @JsonProperty("vendorRequestParameters") - public void setVendorRequestParameters(Map vendorRequestParameters) { + public void setVendorRequestParameters(KubernetesResource vendorRequestParameters) { this.vendorRequestParameters = vendorRequestParameters; } @@ -108,16 +110,16 @@ public DriverAllocationResultBuilder toBuilder() { } @JsonAnyGetter - public Map getAdditionalProperties() { + public Map getAdditionalProperties() { return this.additionalProperties; } @JsonAnySetter - public void setAdditionalProperty(java.lang.String name, java.lang.Object value) { + public void setAdditionalProperty(String name, Object value) { this.additionalProperties.put(name, value); } - public void setAdditionalProperties(Map additionalProperties) { + public void setAdditionalProperties(Map additionalProperties) { this.additionalProperties = additionalProperties; } diff --git a/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/DriverRequests.java b/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/DriverRequests.java index 87aad1083fd..47b558b0916 100644 --- a/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/DriverRequests.java +++ b/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/DriverRequests.java @@ -15,6 +15,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.fabric8.kubernetes.api.builder.Editable; import io.fabric8.kubernetes.api.model.Container; +import io.fabric8.kubernetes.api.model.GenericKubernetesResource; import io.fabric8.kubernetes.api.model.IntOrString; import io.fabric8.kubernetes.api.model.KubernetesResource; import io.fabric8.kubernetes.api.model.LabelSelector; @@ -24,6 +25,7 @@ import io.fabric8.kubernetes.api.model.PersistentVolumeClaim; import io.fabric8.kubernetes.api.model.PodTemplateSpec; import io.fabric8.kubernetes.api.model.ResourceRequirements; +import io.fabric8.kubernetes.api.model.runtime.RawExtension; import io.sundr.builder.annotations.Buildable; import io.sundr.builder.annotations.BuildableReference; import lombok.EqualsAndHashCode; @@ -52,22 +54,23 @@ @BuildableReference(IntOrString.class), @BuildableReference(ObjectReference.class), @BuildableReference(LocalObjectReference.class), - @BuildableReference(PersistentVolumeClaim.class) + @BuildableReference(PersistentVolumeClaim.class), + @BuildableReference(GenericKubernetesResource.class), + @BuildableReference(RawExtension.class) }) @Generated("jsonschema2pojo") public class DriverRequests implements Editable , KubernetesResource { @JsonProperty("driverName") - private java.lang.String driverName; + private String driverName; @JsonProperty("requests") @JsonInclude(JsonInclude.Include.NON_EMPTY) private List requests = new ArrayList<>(); @JsonProperty("vendorParameters") - @JsonInclude(JsonInclude.Include.NON_EMPTY) - private Map vendorParameters = new LinkedHashMap<>(); + private KubernetesResource vendorParameters; @JsonIgnore - private Map additionalProperties = new LinkedHashMap(); + private Map additionalProperties = new LinkedHashMap(); /** * No args constructor for use in serialization @@ -76,7 +79,7 @@ public class DriverRequests implements Editable , Kuberne public DriverRequests() { } - public DriverRequests(java.lang.String driverName, List requests, Map vendorParameters) { + public DriverRequests(String driverName, List requests, KubernetesResource vendorParameters) { super(); this.driverName = driverName; this.requests = requests; @@ -84,12 +87,12 @@ public DriverRequests(java.lang.String driverName, List request } @JsonProperty("driverName") - public java.lang.String getDriverName() { + public String getDriverName() { return driverName; } @JsonProperty("driverName") - public void setDriverName(java.lang.String driverName) { + public void setDriverName(String driverName) { this.driverName = driverName; } @@ -105,13 +108,12 @@ public void setRequests(List requests) { } @JsonProperty("vendorParameters") - @JsonInclude(JsonInclude.Include.NON_EMPTY) - public Map getVendorParameters() { + public KubernetesResource getVendorParameters() { return vendorParameters; } @JsonProperty("vendorParameters") - public void setVendorParameters(Map vendorParameters) { + public void setVendorParameters(KubernetesResource vendorParameters) { this.vendorParameters = vendorParameters; } @@ -126,16 +128,16 @@ public DriverRequestsBuilder toBuilder() { } @JsonAnyGetter - public Map getAdditionalProperties() { + public Map getAdditionalProperties() { return this.additionalProperties; } @JsonAnySetter - public void setAdditionalProperty(java.lang.String name, java.lang.Object value) { + public void setAdditionalProperty(String name, Object value) { this.additionalProperties.put(name, value); } - public void setAdditionalProperties(Map additionalProperties) { + public void setAdditionalProperties(Map additionalProperties) { this.additionalProperties = additionalProperties; } diff --git a/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/PodSchedulingContext.java b/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/PodSchedulingContext.java index faeb986a398..4ca882cc4f7 100644 --- a/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/PodSchedulingContext.java +++ b/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/PodSchedulingContext.java @@ -18,6 +18,7 @@ import io.fabric8.kubernetes.api.model.LabelSelector; import io.fabric8.kubernetes.api.model.LocalObjectReference; import io.fabric8.kubernetes.api.model.Namespaced; +import io.fabric8.kubernetes.api.model.ObjectMeta; import io.fabric8.kubernetes.api.model.ObjectReference; import io.fabric8.kubernetes.api.model.PersistentVolumeClaim; import io.fabric8.kubernetes.api.model.PodTemplateSpec; @@ -48,7 +49,7 @@ "" }) @Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, lazyCollectionInitEnabled = false, builderPackage = "io.fabric8.kubernetes.api.builder", refs = { - @BuildableReference(io.fabric8.kubernetes.api.model.ObjectMeta.class), + @BuildableReference(ObjectMeta.class), @BuildableReference(LabelSelector.class), @BuildableReference(Container.class), @BuildableReference(PodTemplateSpec.class), @@ -82,7 +83,7 @@ public class PodSchedulingContext implements Editable , HasMetada @JsonProperty("kind") private String kind = "ResourceClaim"; @JsonProperty("metadata") - private io.fabric8.kubernetes.api.model.ObjectMeta metadata; + private ObjectMeta metadata; @JsonProperty("spec") private ResourceClaimSpec spec; @JsonProperty("status") @@ -97,7 +98,7 @@ public class ResourceClaim implements Editable , HasMetada public ResourceClaim() { } - public ResourceClaim(String apiVersion, String kind, io.fabric8.kubernetes.api.model.ObjectMeta metadata, ResourceClaimSpec spec, ResourceClaimStatus status) { + public ResourceClaim(String apiVersion, String kind, ObjectMeta metadata, ResourceClaimSpec spec, ResourceClaimStatus status) { super(); this.apiVersion = apiVersion; this.kind = kind; @@ -147,12 +148,12 @@ public void setKind(String kind) { } @JsonProperty("metadata") - public io.fabric8.kubernetes.api.model.ObjectMeta getMetadata() { + public ObjectMeta getMetadata() { return metadata; } @JsonProperty("metadata") - public void setMetadata(io.fabric8.kubernetes.api.model.ObjectMeta metadata) { + public void setMetadata(ObjectMeta metadata) { this.metadata = metadata; } diff --git a/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/ResourceClaimParameters.java b/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/ResourceClaimParameters.java index 0194a9dd43c..3dcccee30f7 100644 --- a/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/ResourceClaimParameters.java +++ b/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/ResourceClaimParameters.java @@ -20,6 +20,7 @@ import io.fabric8.kubernetes.api.model.LabelSelector; import io.fabric8.kubernetes.api.model.LocalObjectReference; import io.fabric8.kubernetes.api.model.Namespaced; +import io.fabric8.kubernetes.api.model.ObjectMeta; import io.fabric8.kubernetes.api.model.ObjectReference; import io.fabric8.kubernetes.api.model.PersistentVolumeClaim; import io.fabric8.kubernetes.api.model.PodTemplateSpec; @@ -51,7 +52,7 @@ "" }) @Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, lazyCollectionInitEnabled = false, builderPackage = "io.fabric8.kubernetes.api.builder", refs = { - @BuildableReference(io.fabric8.kubernetes.api.model.ObjectMeta.class), + @BuildableReference(ObjectMeta.class), @BuildableReference(LabelSelector.class), @BuildableReference(Container.class), @BuildableReference(PodTemplateSpec.class), @@ -90,7 +91,7 @@ public class ResourceClaimParameters implements Editable driverRequests, ResourceClaimParametersReference generatedFrom, String kind, io.fabric8.kubernetes.api.model.ObjectMeta metadata, Boolean shareable) { + public ResourceClaimParameters(String apiVersion, List driverRequests, ResourceClaimParametersReference generatedFrom, String kind, ObjectMeta metadata, Boolean shareable) { super(); this.apiVersion = apiVersion; this.driverRequests = driverRequests; @@ -175,12 +176,12 @@ public void setKind(String kind) { } @JsonProperty("metadata") - public io.fabric8.kubernetes.api.model.ObjectMeta getMetadata() { + public ObjectMeta getMetadata() { return metadata; } @JsonProperty("metadata") - public void setMetadata(io.fabric8.kubernetes.api.model.ObjectMeta metadata) { + public void setMetadata(ObjectMeta metadata) { this.metadata = metadata; } diff --git a/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/ResourceClaimTemplate.java b/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/ResourceClaimTemplate.java index e48060de76a..950ddedb247 100644 --- a/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/ResourceClaimTemplate.java +++ b/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/ResourceClaimTemplate.java @@ -18,6 +18,7 @@ import io.fabric8.kubernetes.api.model.LabelSelector; import io.fabric8.kubernetes.api.model.LocalObjectReference; import io.fabric8.kubernetes.api.model.Namespaced; +import io.fabric8.kubernetes.api.model.ObjectMeta; import io.fabric8.kubernetes.api.model.ObjectReference; import io.fabric8.kubernetes.api.model.PersistentVolumeClaim; import io.fabric8.kubernetes.api.model.PodTemplateSpec; @@ -47,7 +48,7 @@ "" }) @Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, lazyCollectionInitEnabled = false, builderPackage = "io.fabric8.kubernetes.api.builder", refs = { - @BuildableReference(io.fabric8.kubernetes.api.model.ObjectMeta.class), + @BuildableReference(ObjectMeta.class), @BuildableReference(LabelSelector.class), @BuildableReference(Container.class), @BuildableReference(PodTemplateSpec.class), @@ -81,7 +82,7 @@ public class ResourceClaimTemplate implements Editable , HasMetada @JsonProperty("kind") private String kind = "ResourceClass"; @JsonProperty("metadata") - private io.fabric8.kubernetes.api.model.ObjectMeta metadata; + private ObjectMeta metadata; @JsonProperty("parametersRef") private ResourceClassParametersReference parametersRef; @JsonProperty("structuredParameters") @@ -103,7 +104,7 @@ public class ResourceClass implements Editable , HasMetada public ResourceClass() { } - public ResourceClass(String apiVersion, String driverName, String kind, io.fabric8.kubernetes.api.model.ObjectMeta metadata, ResourceClassParametersReference parametersRef, Boolean structuredParameters, NodeSelector suitableNodes) { + public ResourceClass(String apiVersion, String driverName, String kind, ObjectMeta metadata, ResourceClassParametersReference parametersRef, Boolean structuredParameters, NodeSelector suitableNodes) { super(); this.apiVersion = apiVersion; this.driverName = driverName; @@ -165,12 +166,12 @@ public void setKind(String kind) { } @JsonProperty("metadata") - public io.fabric8.kubernetes.api.model.ObjectMeta getMetadata() { + public ObjectMeta getMetadata() { return metadata; } @JsonProperty("metadata") - public void setMetadata(io.fabric8.kubernetes.api.model.ObjectMeta metadata) { + public void setMetadata(ObjectMeta metadata) { this.metadata = metadata; } diff --git a/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/ResourceClassParameters.java b/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/ResourceClassParameters.java index 83dd5de0caf..52240799d97 100644 --- a/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/ResourceClassParameters.java +++ b/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/ResourceClassParameters.java @@ -20,6 +20,7 @@ import io.fabric8.kubernetes.api.model.LabelSelector; import io.fabric8.kubernetes.api.model.LocalObjectReference; import io.fabric8.kubernetes.api.model.Namespaced; +import io.fabric8.kubernetes.api.model.ObjectMeta; import io.fabric8.kubernetes.api.model.ObjectReference; import io.fabric8.kubernetes.api.model.PersistentVolumeClaim; import io.fabric8.kubernetes.api.model.PodTemplateSpec; @@ -51,7 +52,7 @@ "" }) @Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, lazyCollectionInitEnabled = false, builderPackage = "io.fabric8.kubernetes.api.builder", refs = { - @BuildableReference(io.fabric8.kubernetes.api.model.ObjectMeta.class), + @BuildableReference(ObjectMeta.class), @BuildableReference(LabelSelector.class), @BuildableReference(Container.class), @BuildableReference(PodTemplateSpec.class), @@ -90,7 +91,7 @@ public class ResourceClassParameters implements Editable vendorParameters = new ArrayList<>(); @@ -104,7 +105,7 @@ public class ResourceClassParameters implements Editable filters, ResourceClassParametersReference generatedFrom, String kind, io.fabric8.kubernetes.api.model.ObjectMeta metadata, List vendorParameters) { + public ResourceClassParameters(String apiVersion, List filters, ResourceClassParametersReference generatedFrom, String kind, ObjectMeta metadata, List vendorParameters) { super(); this.apiVersion = apiVersion; this.filters = filters; @@ -176,12 +177,12 @@ public void setKind(String kind) { } @JsonProperty("metadata") - public io.fabric8.kubernetes.api.model.ObjectMeta getMetadata() { + public ObjectMeta getMetadata() { return metadata; } @JsonProperty("metadata") - public void setMetadata(io.fabric8.kubernetes.api.model.ObjectMeta metadata) { + public void setMetadata(ObjectMeta metadata) { this.metadata = metadata; } diff --git a/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/ResourceRequest.java b/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/ResourceRequest.java index 7e65b406b40..e7a8b5d5f06 100644 --- a/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/ResourceRequest.java +++ b/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/ResourceRequest.java @@ -13,6 +13,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.fabric8.kubernetes.api.builder.Editable; import io.fabric8.kubernetes.api.model.Container; +import io.fabric8.kubernetes.api.model.GenericKubernetesResource; import io.fabric8.kubernetes.api.model.IntOrString; import io.fabric8.kubernetes.api.model.KubernetesResource; import io.fabric8.kubernetes.api.model.LabelSelector; @@ -22,6 +23,7 @@ import io.fabric8.kubernetes.api.model.PersistentVolumeClaim; import io.fabric8.kubernetes.api.model.PodTemplateSpec; import io.fabric8.kubernetes.api.model.ResourceRequirements; +import io.fabric8.kubernetes.api.model.runtime.RawExtension; import io.sundr.builder.annotations.Buildable; import io.sundr.builder.annotations.BuildableReference; import lombok.EqualsAndHashCode; @@ -49,7 +51,9 @@ @BuildableReference(IntOrString.class), @BuildableReference(ObjectReference.class), @BuildableReference(LocalObjectReference.class), - @BuildableReference(PersistentVolumeClaim.class) + @BuildableReference(PersistentVolumeClaim.class), + @BuildableReference(GenericKubernetesResource.class), + @BuildableReference(RawExtension.class) }) @Generated("jsonschema2pojo") public class ResourceRequest implements Editable , KubernetesResource @@ -58,10 +62,9 @@ public class ResourceRequest implements Editable , Kuber @JsonProperty("namedResources") private NamedResourcesRequest namedResources; @JsonProperty("vendorParameters") - @JsonInclude(JsonInclude.Include.NON_EMPTY) - private Map vendorParameters = new LinkedHashMap<>(); + private KubernetesResource vendorParameters; @JsonIgnore - private Map additionalProperties = new LinkedHashMap(); + private Map additionalProperties = new LinkedHashMap(); /** * No args constructor for use in serialization @@ -70,7 +73,7 @@ public class ResourceRequest implements Editable , Kuber public ResourceRequest() { } - public ResourceRequest(NamedResourcesRequest namedResources, Map vendorParameters) { + public ResourceRequest(NamedResourcesRequest namedResources, KubernetesResource vendorParameters) { super(); this.namedResources = namedResources; this.vendorParameters = vendorParameters; @@ -87,13 +90,12 @@ public void setNamedResources(NamedResourcesRequest namedResources) { } @JsonProperty("vendorParameters") - @JsonInclude(JsonInclude.Include.NON_EMPTY) - public Map getVendorParameters() { + public KubernetesResource getVendorParameters() { return vendorParameters; } @JsonProperty("vendorParameters") - public void setVendorParameters(Map vendorParameters) { + public void setVendorParameters(KubernetesResource vendorParameters) { this.vendorParameters = vendorParameters; } @@ -108,16 +110,16 @@ public ResourceRequestBuilder toBuilder() { } @JsonAnyGetter - public Map getAdditionalProperties() { + public Map getAdditionalProperties() { return this.additionalProperties; } @JsonAnySetter - public void setAdditionalProperty(java.lang.String name, java.lang.Object value) { + public void setAdditionalProperty(String name, Object value) { this.additionalProperties.put(name, value); } - public void setAdditionalProperties(Map additionalProperties) { + public void setAdditionalProperties(Map additionalProperties) { this.additionalProperties = additionalProperties; } diff --git a/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/ResourceSlice.java b/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/ResourceSlice.java index b7ed3c5f351..0b70e0ecc61 100644 --- a/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/ResourceSlice.java +++ b/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/ResourceSlice.java @@ -17,6 +17,7 @@ import io.fabric8.kubernetes.api.model.IntOrString; import io.fabric8.kubernetes.api.model.LabelSelector; import io.fabric8.kubernetes.api.model.LocalObjectReference; +import io.fabric8.kubernetes.api.model.ObjectMeta; import io.fabric8.kubernetes.api.model.ObjectReference; import io.fabric8.kubernetes.api.model.PersistentVolumeClaim; import io.fabric8.kubernetes.api.model.PodTemplateSpec; @@ -48,7 +49,7 @@ "" }) @Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, lazyCollectionInitEnabled = false, builderPackage = "io.fabric8.kubernetes.api.builder", refs = { - @BuildableReference(io.fabric8.kubernetes.api.model.ObjectMeta.class), + @BuildableReference(ObjectMeta.class), @BuildableReference(LabelSelector.class), @BuildableReference(Container.class), @BuildableReference(PodTemplateSpec.class), @@ -84,7 +85,7 @@ public class ResourceSlice implements Editable , HasMetada @JsonProperty("kind") private String kind = "ResourceSlice"; @JsonProperty("metadata") - private io.fabric8.kubernetes.api.model.ObjectMeta metadata; + private ObjectMeta metadata; @JsonProperty("namedResources") private NamedResourcesResources namedResources; @JsonProperty("nodeName") @@ -99,7 +100,7 @@ public class ResourceSlice implements Editable , HasMetada public ResourceSlice() { } - public ResourceSlice(String apiVersion, String driverName, String kind, io.fabric8.kubernetes.api.model.ObjectMeta metadata, NamedResourcesResources namedResources, String nodeName) { + public ResourceSlice(String apiVersion, String driverName, String kind, ObjectMeta metadata, NamedResourcesResources namedResources, String nodeName) { super(); this.apiVersion = apiVersion; this.driverName = driverName; @@ -160,12 +161,12 @@ public void setKind(String kind) { } @JsonProperty("metadata") - public io.fabric8.kubernetes.api.model.ObjectMeta getMetadata() { + public ObjectMeta getMetadata() { return metadata; } @JsonProperty("metadata") - public void setMetadata(io.fabric8.kubernetes.api.model.ObjectMeta metadata) { + public void setMetadata(ObjectMeta metadata) { this.metadata = metadata; } diff --git a/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/StructuredResourceHandle.java b/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/StructuredResourceHandle.java index 15fca8203af..ea7ca40976f 100644 --- a/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/StructuredResourceHandle.java +++ b/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/StructuredResourceHandle.java @@ -15,6 +15,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.fabric8.kubernetes.api.builder.Editable; import io.fabric8.kubernetes.api.model.Container; +import io.fabric8.kubernetes.api.model.GenericKubernetesResource; import io.fabric8.kubernetes.api.model.IntOrString; import io.fabric8.kubernetes.api.model.KubernetesResource; import io.fabric8.kubernetes.api.model.LabelSelector; @@ -24,6 +25,7 @@ import io.fabric8.kubernetes.api.model.PersistentVolumeClaim; import io.fabric8.kubernetes.api.model.PodTemplateSpec; import io.fabric8.kubernetes.api.model.ResourceRequirements; +import io.fabric8.kubernetes.api.model.runtime.RawExtension; import io.sundr.builder.annotations.Buildable; import io.sundr.builder.annotations.BuildableReference; import lombok.EqualsAndHashCode; @@ -53,25 +55,25 @@ @BuildableReference(IntOrString.class), @BuildableReference(ObjectReference.class), @BuildableReference(LocalObjectReference.class), - @BuildableReference(PersistentVolumeClaim.class) + @BuildableReference(PersistentVolumeClaim.class), + @BuildableReference(GenericKubernetesResource.class), + @BuildableReference(RawExtension.class) }) @Generated("jsonschema2pojo") public class StructuredResourceHandle implements Editable , KubernetesResource { @JsonProperty("nodeName") - private java.lang.String nodeName; + private String nodeName; @JsonProperty("results") @JsonInclude(JsonInclude.Include.NON_EMPTY) private List results = new ArrayList<>(); @JsonProperty("vendorClaimParameters") - @JsonInclude(JsonInclude.Include.NON_EMPTY) - private Map vendorClaimParameters = new LinkedHashMap<>(); + private KubernetesResource vendorClaimParameters; @JsonProperty("vendorClassParameters") - @JsonInclude(JsonInclude.Include.NON_EMPTY) - private Map vendorClassParameters = new LinkedHashMap<>(); + private KubernetesResource vendorClassParameters; @JsonIgnore - private Map additionalProperties = new LinkedHashMap(); + private Map additionalProperties = new LinkedHashMap(); /** * No args constructor for use in serialization @@ -80,7 +82,7 @@ public class StructuredResourceHandle implements Editable results, Map vendorClaimParameters, Map vendorClassParameters) { + public StructuredResourceHandle(String nodeName, List results, KubernetesResource vendorClaimParameters, KubernetesResource vendorClassParameters) { super(); this.nodeName = nodeName; this.results = results; @@ -89,12 +91,12 @@ public StructuredResourceHandle(java.lang.String nodeName, List results) { } @JsonProperty("vendorClaimParameters") - @JsonInclude(JsonInclude.Include.NON_EMPTY) - public Map getVendorClaimParameters() { + public KubernetesResource getVendorClaimParameters() { return vendorClaimParameters; } @JsonProperty("vendorClaimParameters") - public void setVendorClaimParameters(Map vendorClaimParameters) { + public void setVendorClaimParameters(KubernetesResource vendorClaimParameters) { this.vendorClaimParameters = vendorClaimParameters; } @JsonProperty("vendorClassParameters") - @JsonInclude(JsonInclude.Include.NON_EMPTY) - public Map getVendorClassParameters() { + public KubernetesResource getVendorClassParameters() { return vendorClassParameters; } @JsonProperty("vendorClassParameters") - public void setVendorClassParameters(Map vendorClassParameters) { + public void setVendorClassParameters(KubernetesResource vendorClassParameters) { this.vendorClassParameters = vendorClassParameters; } @@ -142,16 +142,16 @@ public StructuredResourceHandleBuilder toBuilder() { } @JsonAnyGetter - public Map getAdditionalProperties() { + public Map getAdditionalProperties() { return this.additionalProperties; } @JsonAnySetter - public void setAdditionalProperty(java.lang.String name, java.lang.Object value) { + public void setAdditionalProperty(String name, Object value) { this.additionalProperties.put(name, value); } - public void setAdditionalProperties(Map additionalProperties) { + public void setAdditionalProperties(Map additionalProperties) { this.additionalProperties = additionalProperties; } diff --git a/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/VendorParameters.java b/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/VendorParameters.java deleted file mode 100644 index f48c62aafe9..00000000000 --- a/kubernetes-model-generator/kubernetes-model-resource/src/generated/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/VendorParameters.java +++ /dev/null @@ -1,124 +0,0 @@ - -package io.fabric8.kubernetes.api.model.resource.v1alpha2; - -import java.util.LinkedHashMap; -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.api.model.Container; -import io.fabric8.kubernetes.api.model.IntOrString; -import io.fabric8.kubernetes.api.model.KubernetesResource; -import io.fabric8.kubernetes.api.model.LabelSelector; -import io.fabric8.kubernetes.api.model.LocalObjectReference; -import io.fabric8.kubernetes.api.model.ObjectMeta; -import io.fabric8.kubernetes.api.model.ObjectReference; -import io.fabric8.kubernetes.api.model.PersistentVolumeClaim; -import io.fabric8.kubernetes.api.model.PodTemplateSpec; -import io.fabric8.kubernetes.api.model.ResourceRequirements; -import io.sundr.builder.annotations.Buildable; -import io.sundr.builder.annotations.BuildableReference; -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({ - "driverName", - "parameters" -}) -@ToString -@EqualsAndHashCode -@Accessors(prefix = { - "_", - "" -}) -@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, lazyCollectionInitEnabled = false, builderPackage = "io.fabric8.kubernetes.api.builder", refs = { - @BuildableReference(ObjectMeta.class), - @BuildableReference(LabelSelector.class), - @BuildableReference(Container.class), - @BuildableReference(PodTemplateSpec.class), - @BuildableReference(ResourceRequirements.class), - @BuildableReference(IntOrString.class), - @BuildableReference(ObjectReference.class), - @BuildableReference(LocalObjectReference.class), - @BuildableReference(PersistentVolumeClaim.class) -}) -@Generated("jsonschema2pojo") -public class VendorParameters implements Editable , KubernetesResource -{ - - @JsonProperty("driverName") - private java.lang.String driverName; - @JsonProperty("parameters") - @JsonInclude(JsonInclude.Include.NON_EMPTY) - private Map parameters = new LinkedHashMap<>(); - @JsonIgnore - private Map additionalProperties = new LinkedHashMap(); - - /** - * No args constructor for use in serialization - * - */ - public VendorParameters() { - } - - public VendorParameters(java.lang.String driverName, Map parameters) { - super(); - this.driverName = driverName; - this.parameters = parameters; - } - - @JsonProperty("driverName") - public java.lang.String getDriverName() { - return driverName; - } - - @JsonProperty("driverName") - public void setDriverName(java.lang.String driverName) { - this.driverName = driverName; - } - - @JsonProperty("parameters") - @JsonInclude(JsonInclude.Include.NON_EMPTY) - public Map getParameters() { - return parameters; - } - - @JsonProperty("parameters") - public void setParameters(Map parameters) { - this.parameters = parameters; - } - - @JsonIgnore - public VendorParametersBuilder edit() { - return new VendorParametersBuilder(this); - } - - @JsonIgnore - public VendorParametersBuilder toBuilder() { - return edit(); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(java.lang.String name, java.lang.Object value) { - this.additionalProperties.put(name, value); - } - - public void setAdditionalProperties(Map additionalProperties) { - this.additionalProperties = additionalProperties; - } - -} diff --git a/kubernetes-model-generator/kubernetes-model-resource/src/main/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/VendorParameters.java b/kubernetes-model-generator/kubernetes-model-resource/src/main/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/VendorParameters.java new file mode 100644 index 00000000000..ddeefe752a9 --- /dev/null +++ b/kubernetes-model-generator/kubernetes-model-resource/src/main/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/VendorParameters.java @@ -0,0 +1,140 @@ +/* + * 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.resource.v1alpha2; + +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.api.model.Container; +import io.fabric8.kubernetes.api.model.IntOrString; +import io.fabric8.kubernetes.api.model.KubernetesResource; +import io.fabric8.kubernetes.api.model.LabelSelector; +import io.fabric8.kubernetes.api.model.LocalObjectReference; +import io.fabric8.kubernetes.api.model.ObjectMeta; +import io.fabric8.kubernetes.api.model.ObjectReference; +import io.fabric8.kubernetes.api.model.PersistentVolumeClaim; +import io.fabric8.kubernetes.api.model.PodTemplateSpec; +import io.fabric8.kubernetes.api.model.ResourceRequirements; +import io.sundr.builder.annotations.Buildable; +import io.sundr.builder.annotations.BuildableReference; +import lombok.EqualsAndHashCode; +import lombok.ToString; +import lombok.experimental.Accessors; + +import java.util.LinkedHashMap; +import java.util.Map; + +import javax.annotation.Generated; + +@JsonDeserialize(using = com.fasterxml.jackson.databind.JsonDeserializer.None.class) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "driverName", + "parameters" +}) +@ToString +@EqualsAndHashCode +@Accessors(prefix = { + "_", + "" +}) +@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, lazyCollectionInitEnabled = false, builderPackage = "io.fabric8.kubernetes.api.builder", refs = { + @BuildableReference(ObjectMeta.class), + @BuildableReference(LabelSelector.class), + @BuildableReference(Container.class), + @BuildableReference(PodTemplateSpec.class), + @BuildableReference(ResourceRequirements.class), + @BuildableReference(IntOrString.class), + @BuildableReference(ObjectReference.class), + @BuildableReference(LocalObjectReference.class), + @BuildableReference(PersistentVolumeClaim.class) +}) +@Generated("jsonschema2pojo") +public class VendorParameters implements Editable, KubernetesResource { + + @JsonProperty("driverName") + private java.lang.String driverName; + @JsonProperty("parameters") + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private Map parameters = new LinkedHashMap<>(); + @JsonIgnore + private Map additionalProperties = new LinkedHashMap(); + + /** + * No args constructor for use in serialization + * + */ + public VendorParameters() { + } + + public VendorParameters(java.lang.String driverName, Map parameters) { + super(); + this.driverName = driverName; + this.parameters = parameters; + } + + @JsonProperty("driverName") + public java.lang.String getDriverName() { + return driverName; + } + + @JsonProperty("driverName") + public void setDriverName(java.lang.String driverName) { + this.driverName = driverName; + } + + @JsonProperty("parameters") + @JsonInclude(JsonInclude.Include.NON_EMPTY) + public Map getParameters() { + return parameters; + } + + @JsonProperty("parameters") + public void setParameters(Map parameters) { + this.parameters = parameters; + } + + @JsonIgnore + public VendorParametersBuilder edit() { + return new VendorParametersBuilder(this); + } + + @JsonIgnore + public VendorParametersBuilder toBuilder() { + return edit(); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(java.lang.String name, java.lang.Object value) { + this.additionalProperties.put(name, value); + } + + public void setAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + +} diff --git a/kubernetes-model-generator/kubernetes-model-resource/src/test/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/ResourceClaimParametersTest.java b/kubernetes-model-generator/kubernetes-model-resource/src/test/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/ResourceClaimParametersTest.java index 1158f706325..c6b7812a205 100644 --- a/kubernetes-model-generator/kubernetes-model-resource/src/test/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/ResourceClaimParametersTest.java +++ b/kubernetes-model-generator/kubernetes-model-resource/src/test/java/io/fabric8/kubernetes/api/model/resource/v1alpha2/ResourceClaimParametersTest.java @@ -16,6 +16,7 @@ package io.fabric8.kubernetes.api.model.resource.v1alpha2; import com.fasterxml.jackson.databind.ObjectMapper; +import io.fabric8.kubernetes.api.model.GenericKubernetesResourceBuilder; import io.fabric8.kubernetes.api.model.Namespaced; import org.assertj.core.api.InstanceOfAssertFactories; import org.junit.jupiter.api.Test; @@ -42,7 +43,8 @@ void apiGroup() { @Test void deserializationAndSerializationShouldWorkAsExpected() throws IOException { // Given - String originalJson = new Scanner(getClass().getResourceAsStream("/valid-resourceclaimparameters.json")) + String originalJson = new Scanner( + ResourceClaimParametersTest.class.getResourceAsStream("/valid-resourceclaimparameters.json")) .useDelimiter("\\A") .next(); @@ -65,15 +67,15 @@ void deserializationAndSerializationShouldWorkAsExpected() throws IOException { .hasFieldOrPropertyWithValue("driverName", "driverNameValue") .hasFieldOrPropertyWithValue("vendorParameters.apiVersion", "example.com/v1") .hasFieldOrPropertyWithValue("vendorParameters.kind", "CustomType") - .hasFieldOrPropertyWithValue("vendorParameters.spec.replicas", 1) - .hasFieldOrPropertyWithValue("vendorParameters.status.available", 1) + .hasFieldOrPropertyWithValue("vendorParameters.additionalProperties.spec.replicas", 1) + .hasFieldOrPropertyWithValue("vendorParameters.additionalProperties.status.available", 1) .extracting("requests") .asInstanceOf(InstanceOfAssertFactories.LIST) .singleElement(InstanceOfAssertFactories.type(ResourceRequest.class)) .hasFieldOrPropertyWithValue("vendorParameters.apiVersion", "example.com/v1") .hasFieldOrPropertyWithValue("vendorParameters.kind", "CustomType") - .hasFieldOrPropertyWithValue("vendorParameters.spec.replicas", 1) - .hasFieldOrPropertyWithValue("vendorParameters.status.available", 1) + .hasFieldOrPropertyWithValue("vendorParameters.additionalProperties.spec.replicas", 1) + .hasFieldOrPropertyWithValue("vendorParameters.additionalProperties.status.available", 1) .hasFieldOrPropertyWithValue("namedResources.selector", "selectorValue"); } @@ -90,16 +92,20 @@ void builderShouldCreateObject() { .withShareable() .addNewDriverRequest() .withDriverName("driverNameValue") - .addToVendorParameters("apiVersion", "example.com/v1") - .addToVendorParameters("kind", "CustomType") - .addToVendorParameters("spec", Collections.singletonMap("replicas", 1)) - .addToVendorParameters("status", Collections.singletonMap("available", 1)) + .withVendorParameters(new GenericKubernetesResourceBuilder() + .withApiVersion("example.com/v1") + .withKind("CustomType") + .addToAdditionalProperties("spec", Collections.singletonMap("replicas", 1)) + .addToAdditionalProperties("status", Collections.singletonMap("available", 1)) + .build()) .addNewRequest() .withNewNamedResources("selectorValue") - .addToVendorParameters("apiVersion", "example.com/v1") - .addToVendorParameters("kind", "CustomType") - .addToVendorParameters("spec", Collections.singletonMap("replicas", 1)) - .addToVendorParameters("status", Collections.singletonMap("available", 1)) + .withVendorParameters(new GenericKubernetesResourceBuilder() + .withApiVersion("example.com/v1") + .withKind("CustomType") + .addToAdditionalProperties("spec", Collections.singletonMap("replicas", 1)) + .addToAdditionalProperties("status", Collections.singletonMap("available", 1)) + .build()) .endRequest() .endDriverRequest(); @@ -120,15 +126,15 @@ void builderShouldCreateObject() { .hasFieldOrPropertyWithValue("driverName", "driverNameValue") .hasFieldOrPropertyWithValue("vendorParameters.apiVersion", "example.com/v1") .hasFieldOrPropertyWithValue("vendorParameters.kind", "CustomType") - .hasFieldOrPropertyWithValue("vendorParameters.spec.replicas", 1) - .hasFieldOrPropertyWithValue("vendorParameters.status.available", 1) + .hasFieldOrPropertyWithValue("vendorParameters.additionalProperties.spec.replicas", 1) + .hasFieldOrPropertyWithValue("vendorParameters.additionalProperties.status.available", 1) .extracting("requests") .asInstanceOf(InstanceOfAssertFactories.LIST) .singleElement(InstanceOfAssertFactories.type(ResourceRequest.class)) .hasFieldOrPropertyWithValue("vendorParameters.apiVersion", "example.com/v1") .hasFieldOrPropertyWithValue("vendorParameters.kind", "CustomType") - .hasFieldOrPropertyWithValue("vendorParameters.spec.replicas", 1) - .hasFieldOrPropertyWithValue("vendorParameters.status.available", 1) + .hasFieldOrPropertyWithValue("vendorParameters.additionalProperties.spec.replicas", 1) + .hasFieldOrPropertyWithValue("vendorParameters.additionalProperties.status.available", 1) .hasFieldOrPropertyWithValue("namedResources.selector", "selectorValue"); } } diff --git a/kubernetes-model-generator/openapi/maven-plugin/src/test/java/io/fabric8/kubernetes/schema/generator/model/KubernetesTest.java b/kubernetes-model-generator/openapi/maven-plugin/src/test/java/io/fabric8/kubernetes/schema/generator/model/KubernetesTest.java index 3dad5580f25..ee1e10f5639 100644 --- a/kubernetes-model-generator/openapi/maven-plugin/src/test/java/io/fabric8/kubernetes/schema/generator/model/KubernetesTest.java +++ b/kubernetes-model-generator/openapi/maven-plugin/src/test/java/io/fabric8/kubernetes/schema/generator/model/KubernetesTest.java @@ -57,39 +57,4 @@ void kustomize() { .generate(); } - @Test - void policy() { - new ModelGenerator(baseSettings - .clearSchemas() - .schema(new File("../schemas/kubernetes-1.21.14.json")) - .schema(new File("../schemas/kubernetes-1.30.0.json")) - .includeGenerationRegex("^io\\.k8s\\.api\\.policy\\..*$") - .packageMapping("io.k8s.api.policy", "io.fabric8.kubernetes.api.model.policy") - .build()) - .generate(); - } - - @Test - void resource() { - new ModelGenerator(baseSettings - .clearSchemas() - .schema(new File("../schemas/kubernetes-1.30.0.json")) - .includeGenerationRegex("^io\\.k8s\\.api\\.resource\\..*$") - .packageMapping("io.k8s.api.resource", "io.fabric8.kubernetes.api.model.resource") - .build()) - .generate(); - } - - @Test - void scheduling() { - new ModelGenerator(baseSettings - .clearSchemas() - .schema(new File("../schemas/kubernetes-1.21.14.json")) - .schema(new File("../schemas/kubernetes-1.30.0.json")) - .includeGenerationRegex("^io\\.k8s\\.api\\.scheduling\\..*$") - .packageMapping("io.k8s.api.scheduling", "io.fabric8.kubernetes.api.model.scheduling") - .build()) - .generate(); - } - }