From 71eea9a62635e982b48497928df5dbbf5b31b316 Mon Sep 17 00:00:00 2001 From: Marc Nuri Date: Fri, 20 Sep 2024 15:56:27 +0200 Subject: [PATCH] refactor: openshift-model-clusterautoscaling generated from OpenAPI schemas Signed-off-by: Marc Nuri --- Makefile | 1 + doc/MIGRATION-v7.md | 12 ++ kubernetes-model-generator/generateModel.sh | 1 - .../pom.xml | 45 ++-- .../autoscaling}/v1/ClusterAutoscaler.java | 21 +- .../v1/ClusterAutoscalerList.java | 12 +- .../v1/ClusterAutoscalerSpec.java | 32 ++- .../v1/ClusterAutoscalerSpecRLCores.java} | 14 +- .../v1/ClusterAutoscalerSpecRLGpus.java} | 14 +- .../v1/ClusterAutoscalerSpecRLMemory.java} | 51 ++++- .../ClusterAutoscalerSpecResourceLimits.java} | 32 +-- .../v1/ClusterAutoscalerSpecScaleDown.java} | 14 +- .../v1beta1/MachineAutoscaler.java | 13 +- .../v1beta1/MachineAutoscalerList.java | 12 +- .../v1beta1/MachineAutoscalerSpec.java | 10 +- .../MachineAutoscalerSpecScaleTargetRef.java} | 14 +- .../v1beta1/MachineAutoscalerStatus.java | 10 +- .../MachineAutoscalerStatusLastTargetRef.java | 136 ++++++++++++ .../main/resources/schema/kube-schema.json | 0 .../resources/schema/validation-schema.json | 0 .../Makefile | 27 --- .../cmd/generate/generate.go | 101 --------- .../kubernetes/api/model/KubeSchema.java | 204 ------------------ .../api/model/ValidationSchema.java | 204 ------------------ kubernetes-model-generator/pom.xml | 2 +- openshift-client-api/pom.xml | 4 +- pom.xml | 2 +- uberjar/pom.xml | 2 +- 28 files changed, 325 insertions(+), 665 deletions(-) rename kubernetes-model-generator/{openshift-model-clusterautoscaling => openshift-model-autoscaling}/pom.xml (66%) rename kubernetes-model-generator/{openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling => openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling}/v1/ClusterAutoscaler.java (88%) rename kubernetes-model-generator/{openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling => openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling}/v1/ClusterAutoscalerList.java (90%) rename kubernetes-model-generator/{openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling => openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling}/v1/ClusterAutoscalerSpec.java (86%) rename kubernetes-model-generator/{openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1/ResourceRange.java => openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1/ClusterAutoscalerSpecRLCores.java} (87%) rename kubernetes-model-generator/{openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1/GPULimit.java => openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1/ClusterAutoscalerSpecRLGpus.java} (88%) rename kubernetes-model-generator/{openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1/ClusterAutoscalerStatus.java => openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1/ClusterAutoscalerSpecRLMemory.java} (70%) rename kubernetes-model-generator/{openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1/ResourceLimits.java => openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1/ClusterAutoscalerSpecResourceLimits.java} (77%) rename kubernetes-model-generator/{openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1/ScaleDownConfig.java => openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1/ClusterAutoscalerSpecScaleDown.java} (89%) rename kubernetes-model-generator/{openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling => openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling}/v1beta1/MachineAutoscaler.java (91%) rename kubernetes-model-generator/{openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling => openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling}/v1beta1/MachineAutoscalerList.java (90%) rename kubernetes-model-generator/{openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling => openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling}/v1beta1/MachineAutoscalerSpec.java (92%) rename kubernetes-model-generator/{openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1beta1/CrossVersionObjectReference.java => openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1beta1/MachineAutoscalerSpecScaleTargetRef.java} (87%) rename kubernetes-model-generator/{openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling => openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling}/v1beta1/MachineAutoscalerStatus.java (90%) create mode 100644 kubernetes-model-generator/openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1beta1/MachineAutoscalerStatusLastTargetRef.java rename kubernetes-model-generator/{openshift-model-clusterautoscaling => openshift-model-autoscaling}/src/main/resources/schema/kube-schema.json (100%) rename kubernetes-model-generator/{openshift-model-clusterautoscaling => openshift-model-autoscaling}/src/main/resources/schema/validation-schema.json (100%) delete mode 100644 kubernetes-model-generator/openshift-model-clusterautoscaling/Makefile delete mode 100644 kubernetes-model-generator/openshift-model-clusterautoscaling/cmd/generate/generate.go delete mode 100644 kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/kubernetes/api/model/KubeSchema.java delete mode 100644 kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/kubernetes/api/model/ValidationSchema.java diff --git a/Makefile b/Makefile index cf2584ae187..3b93c7a721d 100644 --- a/Makefile +++ b/Makefile @@ -62,6 +62,7 @@ generate-openapi-classes: cd kubernetes-model-generator/openshift-model-miscellaneous && mvn -Pgenerate clean install cd kubernetes-model-generator/openshift-model-operatorhub && mvn -Pgenerate clean install cd kubernetes-model-generator/openshift-model-console && mvn -Pgenerate clean install + cd kubernetes-model-generator/openshift-model-autoscaling && mvn -Pgenerate clean install # Legacy generation of the model: TODO: remove .PHONY: generate-model-legacy diff --git a/doc/MIGRATION-v7.md b/doc/MIGRATION-v7.md index a1c7c8749ee..ada9902ba59 100644 --- a/doc/MIGRATION-v7.md +++ b/doc/MIGRATION-v7.md @@ -8,6 +8,7 @@ - [Moved packages](#model-changes-moved-packages) - [Service Catalog removed (operator.openshift.io)](#service-catalog-removed) - [Removed deprecated types for network.openshift.io (OpenShift-SDN-only)](#openshift-network-removed) + - [Renamed clusterautoscaling to autoscaling](#openshift-clusterautoscaling-to-autoscaling) - [Deprecations and Removals](#deprecations-and-removals) - [Service Catalog API (extension) removed](#service-catalog-extension) @@ -32,6 +33,11 @@ annotations, you need to switch to [Official OSGi Component annotations](https:/ ## Model Changes +The way we generate the Kubernetes model types/classes has changed. +We've moved from a reflection-based approach from the Go types, to a mixed approach leveraging the OpenAPI schemas that are publicly available. + +This change has had several impacts on the generated classes, including: + ### kubernetes-model artifact removed The Maven artifact `io.fabric8:kubernetes-model` has been removed from the project and is no longer published. @@ -69,6 +75,12 @@ The moved types include: - OperatorPKI (`openshift-model-operator`) - ProjectHelmChartRepository (`openshift-model-miscellaneous`) +### Renamed clusterautoscaling to autoscaling + +The module `openshift-model-clusterautoscaling` has been renamed to `openshift-model-autoscaling` to match the API group name. + +The package has also been renamed from `io.fabric8.openshift.api.model.clusterautoscaling` to `io.fabric8.openshift.api.model.autoscaling`. + ## Deprecations and Removals ### Service Catalog API (extension) removed diff --git a/kubernetes-model-generator/generateModel.sh b/kubernetes-model-generator/generateModel.sh index 4e3fe531d7f..20c1db12dd4 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=( - "openshift-model-clusterautoscaling" "openshift-model-hive" "openshift-model-machine" "openshift-model-installer" diff --git a/kubernetes-model-generator/openshift-model-clusterautoscaling/pom.xml b/kubernetes-model-generator/openshift-model-autoscaling/pom.xml similarity index 66% rename from kubernetes-model-generator/openshift-model-clusterautoscaling/pom.xml rename to kubernetes-model-generator/openshift-model-autoscaling/pom.xml index 293fd4ba9ee..ec287d8a492 100644 --- a/kubernetes-model-generator/openshift-model-clusterautoscaling/pom.xml +++ b/kubernetes-model-generator/openshift-model-autoscaling/pom.xml @@ -26,7 +26,7 @@ 7.0-SNAPSHOT - openshift-model-clusterautoscaling + openshift-model-autoscaling bundle Fabric8 :: OpenShift Cluster Autoscaler Operator Model @@ -43,41 +43,30 @@ io.fabric8 kubernetes-model-core - - io.fabric8 - kubernetes-model-common - - - io.fabric8 - openshift-model - - - - - 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.openshift-latest} + + + io.fabric8.kubernetes.api.model + io.fabric8.openshift.api.model.autoscaling + + + ^io\.openshift\.autoscaling\..*$ + + + diff --git a/kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1/ClusterAutoscaler.java b/kubernetes-model-generator/openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1/ClusterAutoscaler.java similarity index 88% rename from kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1/ClusterAutoscaler.java rename to kubernetes-model-generator/openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1/ClusterAutoscaler.java index b5eeaed7069..2858922411d 100644 --- a/kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1/ClusterAutoscaler.java +++ b/kubernetes-model-generator/openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1/ClusterAutoscaler.java @@ -1,5 +1,5 @@ -package io.fabric8.openshift.api.model.clusterautoscaling.v1; +package io.fabric8.openshift.api.model.autoscaling.v1; import java.util.LinkedHashMap; import java.util.Map; @@ -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; @@ -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,11 +82,12 @@ public class ClusterAutoscaler implements Editable , H @JsonProperty("kind") private String kind = "ClusterAutoscaler"; @JsonProperty("metadata") - private io.fabric8.kubernetes.api.model.ObjectMeta metadata; + private ObjectMeta metadata; @JsonProperty("spec") private ClusterAutoscalerSpec spec; @JsonProperty("status") - private ClusterAutoscalerStatus status; + @JsonDeserialize(using = io.fabric8.kubernetes.internal.KubernetesDeserializer.class) + private Object status; @JsonIgnore private Map additionalProperties = new LinkedHashMap(); @@ -96,7 +98,7 @@ public class ClusterAutoscaler implements Editable , H public ClusterAutoscaler() { } - public ClusterAutoscaler(String apiVersion, String kind, io.fabric8.kubernetes.api.model.ObjectMeta metadata, ClusterAutoscalerSpec spec, ClusterAutoscalerStatus status) { + public ClusterAutoscaler(String apiVersion, String kind, ObjectMeta metadata, ClusterAutoscalerSpec spec, Object status) { super(); this.apiVersion = apiVersion; this.kind = kind; @@ -146,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; } @@ -166,12 +168,13 @@ public void setSpec(ClusterAutoscalerSpec spec) { } @JsonProperty("status") - public ClusterAutoscalerStatus getStatus() { + public Object getStatus() { return status; } @JsonProperty("status") - public void setStatus(ClusterAutoscalerStatus status) { + @JsonDeserialize(using = io.fabric8.kubernetes.internal.KubernetesDeserializer.class) + public void setStatus(Object status) { this.status = status; } diff --git a/kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1/ClusterAutoscalerList.java b/kubernetes-model-generator/openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1/ClusterAutoscalerList.java similarity index 90% rename from kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1/ClusterAutoscalerList.java rename to kubernetes-model-generator/openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1/ClusterAutoscalerList.java index b74cc2f87ce..b443a4eb8ac 100644 --- a/kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1/ClusterAutoscalerList.java +++ b/kubernetes-model-generator/openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1/ClusterAutoscalerList.java @@ -1,5 +1,5 @@ -package io.fabric8.openshift.api.model.clusterautoscaling.v1; +package io.fabric8.openshift.api.model.autoscaling.v1; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -67,7 +67,7 @@ @Version("v1") @Group("autoscaling.openshift.io") @Generated("jsonschema2pojo") -public class ClusterAutoscalerList implements Editable , KubernetesResource, KubernetesResourceList +public class ClusterAutoscalerList implements Editable , KubernetesResource, KubernetesResourceList { /** @@ -79,7 +79,7 @@ public class ClusterAutoscalerList implements Editable items = new ArrayList<>(); + private List items = new ArrayList<>(); /** * * (Required) @@ -99,7 +99,7 @@ public class ClusterAutoscalerList implements Editable items, String kind, ListMeta metadata) { + public ClusterAutoscalerList(String apiVersion, List items, String kind, ListMeta metadata) { super(); this.apiVersion = apiVersion; this.items = items; @@ -129,12 +129,12 @@ public void setApiVersion(String apiVersion) { @JsonProperty("items") @JsonInclude(JsonInclude.Include.NON_EMPTY) - public List getItems() { + public List getItems() { return items; } @JsonProperty("items") - public void setItems(List items) { + public void setItems(List items) { this.items = items; } diff --git a/kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1/ClusterAutoscalerSpec.java b/kubernetes-model-generator/openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1/ClusterAutoscalerSpec.java similarity index 86% rename from kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1/ClusterAutoscalerSpec.java rename to kubernetes-model-generator/openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1/ClusterAutoscalerSpec.java index 647e496eaf5..ef06289e13a 100644 --- a/kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1/ClusterAutoscalerSpec.java +++ b/kubernetes-model-generator/openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1/ClusterAutoscalerSpec.java @@ -1,5 +1,5 @@ -package io.fabric8.openshift.api.model.clusterautoscaling.v1; +package io.fabric8.openshift.api.model.autoscaling.v1; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -35,6 +35,7 @@ @JsonPropertyOrder({ "balanceSimilarNodeGroups", "balancingIgnoredLabels", + "expanders", "ignoreDaemonsetsUtilization", "logVerbosity", "maxNodeProvisionTime", @@ -70,6 +71,9 @@ public class ClusterAutoscalerSpec implements Editable balancingIgnoredLabels = new ArrayList<>(); + @JsonProperty("expanders") + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private List expanders = new ArrayList<>(); @JsonProperty("ignoreDaemonsetsUtilization") private Boolean ignoreDaemonsetsUtilization; @JsonProperty("logVerbosity") @@ -81,9 +85,9 @@ public class ClusterAutoscalerSpec implements Editable balancingIgnoredLabels, Boolean ignoreDaemonsetsUtilization, Integer logVerbosity, String maxNodeProvisionTime, Integer maxPodGracePeriod, Integer podPriorityThreshold, ResourceLimits resourceLimits, ScaleDownConfig scaleDown, Boolean skipNodesWithLocalStorage) { + public ClusterAutoscalerSpec(Boolean balanceSimilarNodeGroups, List balancingIgnoredLabels, List expanders, Boolean ignoreDaemonsetsUtilization, Integer logVerbosity, String maxNodeProvisionTime, Integer maxPodGracePeriod, Integer podPriorityThreshold, ClusterAutoscalerSpecResourceLimits resourceLimits, ClusterAutoscalerSpecScaleDown scaleDown, Boolean skipNodesWithLocalStorage) { super(); this.balanceSimilarNodeGroups = balanceSimilarNodeGroups; this.balancingIgnoredLabels = balancingIgnoredLabels; + this.expanders = expanders; this.ignoreDaemonsetsUtilization = ignoreDaemonsetsUtilization; this.logVerbosity = logVerbosity; this.maxNodeProvisionTime = maxNodeProvisionTime; @@ -131,6 +136,17 @@ public void setBalancingIgnoredLabels(List balancingIgnoredLabels) { this.balancingIgnoredLabels = balancingIgnoredLabels; } + @JsonProperty("expanders") + @JsonInclude(JsonInclude.Include.NON_EMPTY) + public List getExpanders() { + return expanders; + } + + @JsonProperty("expanders") + public void setExpanders(List expanders) { + this.expanders = expanders; + } + @JsonProperty("ignoreDaemonsetsUtilization") public Boolean getIgnoreDaemonsetsUtilization() { return ignoreDaemonsetsUtilization; @@ -182,22 +198,22 @@ public void setPodPriorityThreshold(Integer podPriorityThreshold) { } @JsonProperty("resourceLimits") - public ResourceLimits getResourceLimits() { + public ClusterAutoscalerSpecResourceLimits getResourceLimits() { return resourceLimits; } @JsonProperty("resourceLimits") - public void setResourceLimits(ResourceLimits resourceLimits) { + public void setResourceLimits(ClusterAutoscalerSpecResourceLimits resourceLimits) { this.resourceLimits = resourceLimits; } @JsonProperty("scaleDown") - public ScaleDownConfig getScaleDown() { + public ClusterAutoscalerSpecScaleDown getScaleDown() { return scaleDown; } @JsonProperty("scaleDown") - public void setScaleDown(ScaleDownConfig scaleDown) { + public void setScaleDown(ClusterAutoscalerSpecScaleDown scaleDown) { this.scaleDown = scaleDown; } diff --git a/kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1/ResourceRange.java b/kubernetes-model-generator/openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1/ClusterAutoscalerSpecRLCores.java similarity index 87% rename from kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1/ResourceRange.java rename to kubernetes-model-generator/openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1/ClusterAutoscalerSpecRLCores.java index 589b97ce8a4..4088ee811de 100644 --- a/kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1/ResourceRange.java +++ b/kubernetes-model-generator/openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1/ClusterAutoscalerSpecRLCores.java @@ -1,5 +1,5 @@ -package io.fabric8.openshift.api.model.clusterautoscaling.v1; +package io.fabric8.openshift.api.model.autoscaling.v1; import java.util.LinkedHashMap; import java.util.Map; @@ -52,7 +52,7 @@ @BuildableReference(PersistentVolumeClaim.class) }) @Generated("jsonschema2pojo") -public class ResourceRange implements Editable , KubernetesResource +public class ClusterAutoscalerSpecRLCores implements Editable , KubernetesResource { @JsonProperty("max") @@ -66,10 +66,10 @@ public class ResourceRange implements Editable , Kubernete * No args constructor for use in serialization * */ - public ResourceRange() { + public ClusterAutoscalerSpecRLCores() { } - public ResourceRange(Integer max, Integer min) { + public ClusterAutoscalerSpecRLCores(Integer max, Integer min) { super(); this.max = max; this.min = min; @@ -96,12 +96,12 @@ public void setMin(Integer min) { } @JsonIgnore - public ResourceRangeBuilder edit() { - return new ResourceRangeBuilder(this); + public ClusterAutoscalerSpecRLCoresBuilder edit() { + return new ClusterAutoscalerSpecRLCoresBuilder(this); } @JsonIgnore - public ResourceRangeBuilder toBuilder() { + public ClusterAutoscalerSpecRLCoresBuilder toBuilder() { return edit(); } diff --git a/kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1/GPULimit.java b/kubernetes-model-generator/openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1/ClusterAutoscalerSpecRLGpus.java similarity index 88% rename from kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1/GPULimit.java rename to kubernetes-model-generator/openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1/ClusterAutoscalerSpecRLGpus.java index 8983c5a96b0..8b43af1cc68 100644 --- a/kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1/GPULimit.java +++ b/kubernetes-model-generator/openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1/ClusterAutoscalerSpecRLGpus.java @@ -1,5 +1,5 @@ -package io.fabric8.openshift.api.model.clusterautoscaling.v1; +package io.fabric8.openshift.api.model.autoscaling.v1; import java.util.LinkedHashMap; import java.util.Map; @@ -53,7 +53,7 @@ @BuildableReference(PersistentVolumeClaim.class) }) @Generated("jsonschema2pojo") -public class GPULimit implements Editable , KubernetesResource +public class ClusterAutoscalerSpecRLGpus implements Editable , KubernetesResource { @JsonProperty("max") @@ -69,10 +69,10 @@ public class GPULimit implements Editable , KubernetesResource * No args constructor for use in serialization * */ - public GPULimit() { + public ClusterAutoscalerSpecRLGpus() { } - public GPULimit(Integer max, Integer min, String type) { + public ClusterAutoscalerSpecRLGpus(Integer max, Integer min, String type) { super(); this.max = max; this.min = min; @@ -110,12 +110,12 @@ public void setType(String type) { } @JsonIgnore - public GPULimitBuilder edit() { - return new GPULimitBuilder(this); + public ClusterAutoscalerSpecRLGpusBuilder edit() { + return new ClusterAutoscalerSpecRLGpusBuilder(this); } @JsonIgnore - public GPULimitBuilder toBuilder() { + public ClusterAutoscalerSpecRLGpusBuilder toBuilder() { return edit(); } diff --git a/kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1/ClusterAutoscalerStatus.java b/kubernetes-model-generator/openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1/ClusterAutoscalerSpecRLMemory.java similarity index 70% rename from kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1/ClusterAutoscalerStatus.java rename to kubernetes-model-generator/openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1/ClusterAutoscalerSpecRLMemory.java index a7cbc651c0f..7e2095feb7c 100644 --- a/kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1/ClusterAutoscalerStatus.java +++ b/kubernetes-model-generator/openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1/ClusterAutoscalerSpecRLMemory.java @@ -1,5 +1,5 @@ -package io.fabric8.openshift.api.model.clusterautoscaling.v1; +package io.fabric8.openshift.api.model.autoscaling.v1; import java.util.LinkedHashMap; import java.util.Map; @@ -8,6 +8,7 @@ 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; @@ -30,7 +31,8 @@ @JsonDeserialize(using = com.fasterxml.jackson.databind.JsonDeserializer.None.class) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ - + "max", + "min" }) @ToString @EqualsAndHashCode @@ -50,19 +52,56 @@ @BuildableReference(PersistentVolumeClaim.class) }) @Generated("jsonschema2pojo") -public class ClusterAutoscalerStatus implements Editable , KubernetesResource +public class ClusterAutoscalerSpecRLMemory implements Editable , KubernetesResource { + @JsonProperty("max") + private Integer max; + @JsonProperty("min") + private Integer min; @JsonIgnore private Map additionalProperties = new LinkedHashMap(); + /** + * No args constructor for use in serialization + * + */ + public ClusterAutoscalerSpecRLMemory() { + } + + public ClusterAutoscalerSpecRLMemory(Integer max, Integer min) { + super(); + this.max = max; + this.min = min; + } + + @JsonProperty("max") + public Integer getMax() { + return max; + } + + @JsonProperty("max") + public void setMax(Integer max) { + this.max = max; + } + + @JsonProperty("min") + public Integer getMin() { + return min; + } + + @JsonProperty("min") + public void setMin(Integer min) { + this.min = min; + } + @JsonIgnore - public ClusterAutoscalerStatusBuilder edit() { - return new ClusterAutoscalerStatusBuilder(this); + public ClusterAutoscalerSpecRLMemoryBuilder edit() { + return new ClusterAutoscalerSpecRLMemoryBuilder(this); } @JsonIgnore - public ClusterAutoscalerStatusBuilder toBuilder() { + public ClusterAutoscalerSpecRLMemoryBuilder toBuilder() { return edit(); } diff --git a/kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1/ResourceLimits.java b/kubernetes-model-generator/openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1/ClusterAutoscalerSpecResourceLimits.java similarity index 77% rename from kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1/ResourceLimits.java rename to kubernetes-model-generator/openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1/ClusterAutoscalerSpecResourceLimits.java index a39a2da5ee0..23258739d08 100644 --- a/kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1/ResourceLimits.java +++ b/kubernetes-model-generator/openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1/ClusterAutoscalerSpecResourceLimits.java @@ -1,5 +1,5 @@ -package io.fabric8.openshift.api.model.clusterautoscaling.v1; +package io.fabric8.openshift.api.model.autoscaling.v1; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -56,18 +56,18 @@ @BuildableReference(PersistentVolumeClaim.class) }) @Generated("jsonschema2pojo") -public class ResourceLimits implements Editable , KubernetesResource +public class ClusterAutoscalerSpecResourceLimits implements Editable , KubernetesResource { @JsonProperty("cores") - private ResourceRange cores; + private ClusterAutoscalerSpecRLCores cores; @JsonProperty("gpus") @JsonInclude(JsonInclude.Include.NON_EMPTY) - private List gpus = new ArrayList<>(); + private List gpus = new ArrayList<>(); @JsonProperty("maxNodesTotal") private Integer maxNodesTotal; @JsonProperty("memory") - private ResourceRange memory; + private ClusterAutoscalerSpecRLMemory memory; @JsonIgnore private Map additionalProperties = new LinkedHashMap(); @@ -75,10 +75,10 @@ public class ResourceLimits implements Editable , Kuberne * No args constructor for use in serialization * */ - public ResourceLimits() { + public ClusterAutoscalerSpecResourceLimits() { } - public ResourceLimits(ResourceRange cores, List gpus, Integer maxNodesTotal, ResourceRange memory) { + public ClusterAutoscalerSpecResourceLimits(ClusterAutoscalerSpecRLCores cores, List gpus, Integer maxNodesTotal, ClusterAutoscalerSpecRLMemory memory) { super(); this.cores = cores; this.gpus = gpus; @@ -87,23 +87,23 @@ public ResourceLimits(ResourceRange cores, List gpus, Integer maxNodes } @JsonProperty("cores") - public ResourceRange getCores() { + public ClusterAutoscalerSpecRLCores getCores() { return cores; } @JsonProperty("cores") - public void setCores(ResourceRange cores) { + public void setCores(ClusterAutoscalerSpecRLCores cores) { this.cores = cores; } @JsonProperty("gpus") @JsonInclude(JsonInclude.Include.NON_EMPTY) - public List getGpus() { + public List getGpus() { return gpus; } @JsonProperty("gpus") - public void setGpus(List gpus) { + public void setGpus(List gpus) { this.gpus = gpus; } @@ -118,22 +118,22 @@ public void setMaxNodesTotal(Integer maxNodesTotal) { } @JsonProperty("memory") - public ResourceRange getMemory() { + public ClusterAutoscalerSpecRLMemory getMemory() { return memory; } @JsonProperty("memory") - public void setMemory(ResourceRange memory) { + public void setMemory(ClusterAutoscalerSpecRLMemory memory) { this.memory = memory; } @JsonIgnore - public ResourceLimitsBuilder edit() { - return new ResourceLimitsBuilder(this); + public ClusterAutoscalerSpecResourceLimitsBuilder edit() { + return new ClusterAutoscalerSpecResourceLimitsBuilder(this); } @JsonIgnore - public ResourceLimitsBuilder toBuilder() { + public ClusterAutoscalerSpecResourceLimitsBuilder toBuilder() { return edit(); } diff --git a/kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1/ScaleDownConfig.java b/kubernetes-model-generator/openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1/ClusterAutoscalerSpecScaleDown.java similarity index 89% rename from kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1/ScaleDownConfig.java rename to kubernetes-model-generator/openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1/ClusterAutoscalerSpecScaleDown.java index aa93ee29a67..9e0cbae3e87 100644 --- a/kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1/ScaleDownConfig.java +++ b/kubernetes-model-generator/openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1/ClusterAutoscalerSpecScaleDown.java @@ -1,5 +1,5 @@ -package io.fabric8.openshift.api.model.clusterautoscaling.v1; +package io.fabric8.openshift.api.model.autoscaling.v1; import java.util.LinkedHashMap; import java.util.Map; @@ -56,7 +56,7 @@ @BuildableReference(PersistentVolumeClaim.class) }) @Generated("jsonschema2pojo") -public class ScaleDownConfig implements Editable , KubernetesResource +public class ClusterAutoscalerSpecScaleDown implements Editable , KubernetesResource { @JsonProperty("delayAfterAdd") @@ -78,10 +78,10 @@ public class ScaleDownConfig implements Editable , Kuber * No args constructor for use in serialization * */ - public ScaleDownConfig() { + public ClusterAutoscalerSpecScaleDown() { } - public ScaleDownConfig(String delayAfterAdd, String delayAfterDelete, String delayAfterFailure, Boolean enabled, String unneededTime, String utilizationThreshold) { + public ClusterAutoscalerSpecScaleDown(String delayAfterAdd, String delayAfterDelete, String delayAfterFailure, Boolean enabled, String unneededTime, String utilizationThreshold) { super(); this.delayAfterAdd = delayAfterAdd; this.delayAfterDelete = delayAfterDelete; @@ -152,12 +152,12 @@ public void setUtilizationThreshold(String utilizationThreshold) { } @JsonIgnore - public ScaleDownConfigBuilder edit() { - return new ScaleDownConfigBuilder(this); + public ClusterAutoscalerSpecScaleDownBuilder edit() { + return new ClusterAutoscalerSpecScaleDownBuilder(this); } @JsonIgnore - public ScaleDownConfigBuilder toBuilder() { + public ClusterAutoscalerSpecScaleDownBuilder toBuilder() { return edit(); } diff --git a/kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1beta1/MachineAutoscaler.java b/kubernetes-model-generator/openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1beta1/MachineAutoscaler.java similarity index 91% rename from kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1beta1/MachineAutoscaler.java rename to kubernetes-model-generator/openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1beta1/MachineAutoscaler.java index acf505b45df..301a680179a 100644 --- a/kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1beta1/MachineAutoscaler.java +++ b/kubernetes-model-generator/openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1beta1/MachineAutoscaler.java @@ -1,5 +1,5 @@ -package io.fabric8.openshift.api.model.clusterautoscaling.v1beta1; +package io.fabric8.openshift.api.model.autoscaling.v1beta1; import java.util.LinkedHashMap; import java.util.Map; @@ -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 MachineAutoscaler implements Editable , H @JsonProperty("kind") private String kind = "MachineAutoscaler"; @JsonProperty("metadata") - private io.fabric8.kubernetes.api.model.ObjectMeta metadata; + private ObjectMeta metadata; @JsonProperty("spec") private MachineAutoscalerSpec spec; @JsonProperty("status") @@ -97,7 +98,7 @@ public class MachineAutoscaler implements Editable , H public MachineAutoscaler() { } - public MachineAutoscaler(String apiVersion, String kind, io.fabric8.kubernetes.api.model.ObjectMeta metadata, MachineAutoscalerSpec spec, MachineAutoscalerStatus status) { + public MachineAutoscaler(String apiVersion, String kind, ObjectMeta metadata, MachineAutoscalerSpec spec, MachineAutoscalerStatus 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/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1beta1/MachineAutoscalerList.java b/kubernetes-model-generator/openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1beta1/MachineAutoscalerList.java similarity index 90% rename from kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1beta1/MachineAutoscalerList.java rename to kubernetes-model-generator/openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1beta1/MachineAutoscalerList.java index b655d592fe3..41b0054bdab 100644 --- a/kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1beta1/MachineAutoscalerList.java +++ b/kubernetes-model-generator/openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1beta1/MachineAutoscalerList.java @@ -1,5 +1,5 @@ -package io.fabric8.openshift.api.model.clusterautoscaling.v1beta1; +package io.fabric8.openshift.api.model.autoscaling.v1beta1; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -67,7 +67,7 @@ @Version("v1beta1") @Group("autoscaling.openshift.io") @Generated("jsonschema2pojo") -public class MachineAutoscalerList implements Editable , KubernetesResource, KubernetesResourceList +public class MachineAutoscalerList implements Editable , KubernetesResource, KubernetesResourceList { /** @@ -79,7 +79,7 @@ public class MachineAutoscalerList implements Editable items = new ArrayList<>(); + private List items = new ArrayList<>(); /** * * (Required) @@ -99,7 +99,7 @@ public class MachineAutoscalerList implements Editable items, String kind, ListMeta metadata) { + public MachineAutoscalerList(String apiVersion, List items, String kind, ListMeta metadata) { super(); this.apiVersion = apiVersion; this.items = items; @@ -129,12 +129,12 @@ public void setApiVersion(String apiVersion) { @JsonProperty("items") @JsonInclude(JsonInclude.Include.NON_EMPTY) - public List getItems() { + public List getItems() { return items; } @JsonProperty("items") - public void setItems(List items) { + public void setItems(List items) { this.items = items; } diff --git a/kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1beta1/MachineAutoscalerSpec.java b/kubernetes-model-generator/openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1beta1/MachineAutoscalerSpec.java similarity index 92% rename from kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1beta1/MachineAutoscalerSpec.java rename to kubernetes-model-generator/openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1beta1/MachineAutoscalerSpec.java index dd183b4c6a0..272e6fe337f 100644 --- a/kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/openshift/api/model/clusterautoscaling/v1beta1/MachineAutoscalerSpec.java +++ b/kubernetes-model-generator/openshift-model-autoscaling/src/generated/java/io/fabric8/openshift/api/model/autoscaling/v1beta1/MachineAutoscalerSpec.java @@ -1,5 +1,5 @@ -package io.fabric8.openshift.api.model.clusterautoscaling.v1beta1; +package io.fabric8.openshift.api.model.autoscaling.v1beta1; import java.util.LinkedHashMap; import java.util.Map; @@ -61,7 +61,7 @@ public class MachineAutoscalerSpec implements Editable additionalProperties = new LinkedHashMap(); @@ -72,7 +72,7 @@ public class MachineAutoscalerSpec implements Editable , KubernetesResource +public class MachineAutoscalerSpecScaleTargetRef implements Editable , KubernetesResource { @JsonProperty("apiVersion") @@ -69,10 +69,10 @@ public class CrossVersionObjectReference implements Editable additionalProperties = new LinkedHashMap(); @@ -66,18 +66,18 @@ public class MachineAutoscalerStatus implements Editable , KubernetesResource +{ + + @JsonProperty("apiVersion") + private String apiVersion; + @JsonProperty("kind") + private String kind; + @JsonProperty("name") + private String name; + @JsonIgnore + private Map additionalProperties = new LinkedHashMap(); + + /** + * No args constructor for use in serialization + * + */ + public MachineAutoscalerStatusLastTargetRef() { + } + + public MachineAutoscalerStatusLastTargetRef(String apiVersion, String kind, String name) { + super(); + this.apiVersion = apiVersion; + this.kind = kind; + this.name = name; + } + + @JsonProperty("apiVersion") + public String getApiVersion() { + return apiVersion; + } + + @JsonProperty("apiVersion") + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + @JsonProperty("kind") + public String getKind() { + return kind; + } + + @JsonProperty("kind") + public void setKind(String kind) { + this.kind = kind; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("name") + public void setName(String name) { + this.name = name; + } + + @JsonIgnore + public MachineAutoscalerStatusLastTargetRefBuilder edit() { + return new MachineAutoscalerStatusLastTargetRefBuilder(this); + } + + @JsonIgnore + public MachineAutoscalerStatusLastTargetRefBuilder 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/openshift-model-clusterautoscaling/src/main/resources/schema/kube-schema.json b/kubernetes-model-generator/openshift-model-autoscaling/src/main/resources/schema/kube-schema.json similarity index 100% rename from kubernetes-model-generator/openshift-model-clusterautoscaling/src/main/resources/schema/kube-schema.json rename to kubernetes-model-generator/openshift-model-autoscaling/src/main/resources/schema/kube-schema.json diff --git a/kubernetes-model-generator/openshift-model-clusterautoscaling/src/main/resources/schema/validation-schema.json b/kubernetes-model-generator/openshift-model-autoscaling/src/main/resources/schema/validation-schema.json similarity index 100% rename from kubernetes-model-generator/openshift-model-clusterautoscaling/src/main/resources/schema/validation-schema.json rename to kubernetes-model-generator/openshift-model-autoscaling/src/main/resources/schema/validation-schema.json diff --git a/kubernetes-model-generator/openshift-model-clusterautoscaling/Makefile b/kubernetes-model-generator/openshift-model-clusterautoscaling/Makefile deleted file mode 100644 index c09a7003874..00000000000 --- a/kubernetes-model-generator/openshift-model-clusterautoscaling/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/openshift-model-clusterautoscaling/cmd/generate/generate.go b/kubernetes-model-generator/openshift-model-clusterautoscaling/cmd/generate/generate.go deleted file mode 100644 index 9b40605c74b..00000000000 --- a/kubernetes-model-generator/openshift-model-clusterautoscaling/cmd/generate/generate.go +++ /dev/null @@ -1,101 +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" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - apimachineryversion "k8s.io/apimachinery/pkg/version" - runtime "k8s.io/apimachinery/pkg/runtime" - "log" - "reflect" - "strings" - "time" - clusterautoscalerv1beta1 "github.com/openshift/cluster-autoscaler-operator/pkg/apis/autoscaling/v1beta1" - clusterautoscalerv1 "github.com/openshift/cluster-autoscaler-operator/pkg/apis/autoscaling/v1" - - "os" - - "github.com/fabric8io/kubernetes-client/kubernetes-model-generator/pkg/schemagen" -) - -type Schema struct { - Info apimachineryversion.Info - APIGroup metav1.APIGroup - APIGroupList metav1.APIGroupList - BaseKubernetesList metav1.List - ObjectMeta metav1.ObjectMeta - TypeMeta metav1.TypeMeta - Status metav1.Status - Patch metav1.Patch - Time metav1.Time - ClusterAutoscaler clusterautoscalerv1.ClusterAutoscaler - ClusterAutoscalerList clusterautoscalerv1.ClusterAutoscalerList - V1beta1MachineAutoscaler clusterautoscalerv1beta1.MachineAutoscaler - V1beta1MachineAutoscalerList clusterautoscalerv1beta1.MachineAutoscalerList -} - -func main() { - packages := []schemagen.PackageDescriptor{ - {"k8s.io/api/core/v1", "", "io.fabric8.kubernetes.api.model", "kubernetes_core_", false}, - {"k8s.io/apimachinery/pkg/api/resource", "", "io.fabric8.kubernetes.api.model", "kubernetes_resource_", false}, - {"k8s.io/apimachinery/pkg/util/intstr", "", "io.fabric8.kubernetes.api.model", "kubernetes_apimachinery_pkg_util_intstr_", false}, - {"k8s.io/apimachinery/pkg/runtime", "", "io.fabric8.openshift.api.model.runtime", "kubernetes_apimachinery_pkg_runtime_", false}, - {"k8s.io/apimachinery/pkg/version", "", "io.fabric8.kubernetes.api.model.version", "kubernetes_apimachinery_pkg_version_", false}, - {"k8s.io/kubernetes/pkg/util", "", "io.fabric8.kubernetes.api.model", "kubernetes_util_", false}, - {"k8s.io/kubernetes/pkg/api/errors", "", "io.fabric8.kubernetes.api.model", "kubernetes_errors_", false}, - {"k8s.io/kubernetes/pkg/api/unversioned", "", "io.fabric8.kubernetes.api.model", "api_", false}, - {"k8s.io/apimachinery/pkg/apis/meta/v1", "", "io.fabric8.kubernetes.api.model", "kubernetes_apimachinery_", false}, - {"github.com/openshift/api/config/v1", "", "io.fabric8.openshift.api.model", "os_config_v1_", false}, - {"github.com/openshift/cluster-autoscaler-operator/pkg/apis/autoscaling/v1", "autoscaling", "io.fabric8.openshift.api.model.clusterautoscaling.v1", "os_clusterautoscaling_v1_", true}, - {"github.com/openshift/cluster-autoscaler-operator/pkg/apis/autoscaling/v1beta1", "autoscaling", "io.fabric8.openshift.api.model.clusterautoscaling.v1beta1", "os_clusterautoscaling_v1beta1_", 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,"clusterautoscaling") - 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/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/kubernetes/api/model/KubeSchema.java b/kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/kubernetes/api/model/KubeSchema.java deleted file mode 100644 index 4713d49822b..00000000000 --- a/kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/kubernetes/api/model/KubeSchema.java +++ /dev/null @@ -1,204 +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.version.Info; -import io.fabric8.openshift.api.model.clusterautoscaling.v1.ClusterAutoscaler; -import io.fabric8.openshift.api.model.clusterautoscaling.v1.ClusterAutoscalerList; -import io.fabric8.openshift.api.model.clusterautoscaling.v1beta1.MachineAutoscaler; -import io.fabric8.openshift.api.model.clusterautoscaling.v1beta1.MachineAutoscalerList; - -@Generated("jsonschema2pojo") -public class KubeSchema { - - private APIGroup aPIGroup; - private APIGroupList aPIGroupList; - private KubernetesList baseKubernetesList; - private ClusterAutoscaler clusterAutoscaler; - private ClusterAutoscalerList clusterAutoscalerList; - private Info info; - private ObjectMeta objectMeta; - private Patch patch; - private Status status; - private String time; - private TypeMeta typeMeta; - private MachineAutoscaler v1beta1MachineAutoscaler; - private MachineAutoscalerList v1beta1MachineAutoscalerList; - @JsonIgnore - private Map additionalProperties = new LinkedHashMap(); - - /** - * No args constructor for use in serialization - * - */ - public KubeSchema() { - } - - public KubeSchema(APIGroup aPIGroup, APIGroupList aPIGroupList, KubernetesList baseKubernetesList, ClusterAutoscaler clusterAutoscaler, ClusterAutoscalerList clusterAutoscalerList, Info info, ObjectMeta objectMeta, Patch patch, Status status, String time, TypeMeta typeMeta, MachineAutoscaler v1beta1MachineAutoscaler, MachineAutoscalerList v1beta1MachineAutoscalerList) { - super(); - this.aPIGroup = aPIGroup; - this.aPIGroupList = aPIGroupList; - this.baseKubernetesList = baseKubernetesList; - this.clusterAutoscaler = clusterAutoscaler; - this.clusterAutoscalerList = clusterAutoscalerList; - this.info = info; - this.objectMeta = objectMeta; - this.patch = patch; - this.status = status; - this.time = time; - this.typeMeta = typeMeta; - this.v1beta1MachineAutoscaler = v1beta1MachineAutoscaler; - this.v1beta1MachineAutoscalerList = v1beta1MachineAutoscalerList; - } - - @JsonProperty("APIGroup") - public APIGroup getAPIGroup() { - return aPIGroup; - } - - @JsonProperty("APIGroup") - public void setAPIGroup(APIGroup aPIGroup) { - this.aPIGroup = aPIGroup; - } - - @JsonProperty("APIGroupList") - public APIGroupList getAPIGroupList() { - return aPIGroupList; - } - - @JsonProperty("APIGroupList") - public void setAPIGroupList(APIGroupList aPIGroupList) { - this.aPIGroupList = aPIGroupList; - } - - @JsonProperty("BaseKubernetesList") - public KubernetesList getBaseKubernetesList() { - return baseKubernetesList; - } - - @JsonProperty("BaseKubernetesList") - public void setBaseKubernetesList(KubernetesList baseKubernetesList) { - this.baseKubernetesList = baseKubernetesList; - } - - @JsonProperty("ClusterAutoscaler") - public ClusterAutoscaler getClusterAutoscaler() { - return clusterAutoscaler; - } - - @JsonProperty("ClusterAutoscaler") - public void setClusterAutoscaler(ClusterAutoscaler clusterAutoscaler) { - this.clusterAutoscaler = clusterAutoscaler; - } - - @JsonProperty("ClusterAutoscalerList") - public ClusterAutoscalerList getClusterAutoscalerList() { - return clusterAutoscalerList; - } - - @JsonProperty("ClusterAutoscalerList") - public void setClusterAutoscalerList(ClusterAutoscalerList clusterAutoscalerList) { - this.clusterAutoscalerList = clusterAutoscalerList; - } - - @JsonProperty("Info") - public Info getInfo() { - return info; - } - - @JsonProperty("Info") - public void setInfo(Info info) { - this.info = info; - } - - @JsonProperty("ObjectMeta") - public ObjectMeta getObjectMeta() { - return objectMeta; - } - - @JsonProperty("ObjectMeta") - public void setObjectMeta(ObjectMeta objectMeta) { - this.objectMeta = objectMeta; - } - - @JsonProperty("Patch") - public Patch getPatch() { - return patch; - } - - @JsonProperty("Patch") - public void setPatch(Patch patch) { - this.patch = patch; - } - - @JsonProperty("Status") - public Status getStatus() { - return status; - } - - @JsonProperty("Status") - public void setStatus(Status status) { - this.status = status; - } - - @JsonProperty("Time") - public String getTime() { - return time; - } - - @JsonProperty("Time") - public void setTime(String time) { - this.time = time; - } - - @JsonProperty("TypeMeta") - public TypeMeta getTypeMeta() { - return typeMeta; - } - - @JsonProperty("TypeMeta") - public void setTypeMeta(TypeMeta typeMeta) { - this.typeMeta = typeMeta; - } - - @JsonProperty("V1beta1MachineAutoscaler") - public MachineAutoscaler getV1beta1MachineAutoscaler() { - return v1beta1MachineAutoscaler; - } - - @JsonProperty("V1beta1MachineAutoscaler") - public void setV1beta1MachineAutoscaler(MachineAutoscaler v1beta1MachineAutoscaler) { - this.v1beta1MachineAutoscaler = v1beta1MachineAutoscaler; - } - - @JsonProperty("V1beta1MachineAutoscalerList") - public MachineAutoscalerList getV1beta1MachineAutoscalerList() { - return v1beta1MachineAutoscalerList; - } - - @JsonProperty("V1beta1MachineAutoscalerList") - public void setV1beta1MachineAutoscalerList(MachineAutoscalerList v1beta1MachineAutoscalerList) { - this.v1beta1MachineAutoscalerList = v1beta1MachineAutoscalerList; - } - - @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/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/kubernetes/api/model/ValidationSchema.java b/kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/kubernetes/api/model/ValidationSchema.java deleted file mode 100644 index 42feec69984..00000000000 --- a/kubernetes-model-generator/openshift-model-clusterautoscaling/src/generated/java/io/fabric8/kubernetes/api/model/ValidationSchema.java +++ /dev/null @@ -1,204 +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.version.Info; -import io.fabric8.openshift.api.model.clusterautoscaling.v1.ClusterAutoscaler; -import io.fabric8.openshift.api.model.clusterautoscaling.v1.ClusterAutoscalerList; -import io.fabric8.openshift.api.model.clusterautoscaling.v1beta1.MachineAutoscaler; -import io.fabric8.openshift.api.model.clusterautoscaling.v1beta1.MachineAutoscalerList; - -@Generated("jsonschema2pojo") -public class ValidationSchema { - - private APIGroup aPIGroup; - private APIGroupList aPIGroupList; - private KubernetesList baseKubernetesList; - private ClusterAutoscaler clusterAutoscaler; - private ClusterAutoscalerList clusterAutoscalerList; - private Info info; - private ObjectMeta objectMeta; - private Patch patch; - private Status status; - private String time; - private TypeMeta typeMeta; - private MachineAutoscaler v1beta1MachineAutoscaler; - private MachineAutoscalerList v1beta1MachineAutoscalerList; - @JsonIgnore - private Map additionalProperties = new LinkedHashMap(); - - /** - * No args constructor for use in serialization - * - */ - public ValidationSchema() { - } - - public ValidationSchema(APIGroup aPIGroup, APIGroupList aPIGroupList, KubernetesList baseKubernetesList, ClusterAutoscaler clusterAutoscaler, ClusterAutoscalerList clusterAutoscalerList, Info info, ObjectMeta objectMeta, Patch patch, Status status, String time, TypeMeta typeMeta, MachineAutoscaler v1beta1MachineAutoscaler, MachineAutoscalerList v1beta1MachineAutoscalerList) { - super(); - this.aPIGroup = aPIGroup; - this.aPIGroupList = aPIGroupList; - this.baseKubernetesList = baseKubernetesList; - this.clusterAutoscaler = clusterAutoscaler; - this.clusterAutoscalerList = clusterAutoscalerList; - this.info = info; - this.objectMeta = objectMeta; - this.patch = patch; - this.status = status; - this.time = time; - this.typeMeta = typeMeta; - this.v1beta1MachineAutoscaler = v1beta1MachineAutoscaler; - this.v1beta1MachineAutoscalerList = v1beta1MachineAutoscalerList; - } - - @JsonProperty("APIGroup") - public APIGroup getAPIGroup() { - return aPIGroup; - } - - @JsonProperty("APIGroup") - public void setAPIGroup(APIGroup aPIGroup) { - this.aPIGroup = aPIGroup; - } - - @JsonProperty("APIGroupList") - public APIGroupList getAPIGroupList() { - return aPIGroupList; - } - - @JsonProperty("APIGroupList") - public void setAPIGroupList(APIGroupList aPIGroupList) { - this.aPIGroupList = aPIGroupList; - } - - @JsonProperty("BaseKubernetesList") - public KubernetesList getBaseKubernetesList() { - return baseKubernetesList; - } - - @JsonProperty("BaseKubernetesList") - public void setBaseKubernetesList(KubernetesList baseKubernetesList) { - this.baseKubernetesList = baseKubernetesList; - } - - @JsonProperty("ClusterAutoscaler") - public ClusterAutoscaler getClusterAutoscaler() { - return clusterAutoscaler; - } - - @JsonProperty("ClusterAutoscaler") - public void setClusterAutoscaler(ClusterAutoscaler clusterAutoscaler) { - this.clusterAutoscaler = clusterAutoscaler; - } - - @JsonProperty("ClusterAutoscalerList") - public ClusterAutoscalerList getClusterAutoscalerList() { - return clusterAutoscalerList; - } - - @JsonProperty("ClusterAutoscalerList") - public void setClusterAutoscalerList(ClusterAutoscalerList clusterAutoscalerList) { - this.clusterAutoscalerList = clusterAutoscalerList; - } - - @JsonProperty("Info") - public Info getInfo() { - return info; - } - - @JsonProperty("Info") - public void setInfo(Info info) { - this.info = info; - } - - @JsonProperty("ObjectMeta") - public ObjectMeta getObjectMeta() { - return objectMeta; - } - - @JsonProperty("ObjectMeta") - public void setObjectMeta(ObjectMeta objectMeta) { - this.objectMeta = objectMeta; - } - - @JsonProperty("Patch") - public Patch getPatch() { - return patch; - } - - @JsonProperty("Patch") - public void setPatch(Patch patch) { - this.patch = patch; - } - - @JsonProperty("Status") - public Status getStatus() { - return status; - } - - @JsonProperty("Status") - public void setStatus(Status status) { - this.status = status; - } - - @JsonProperty("Time") - public String getTime() { - return time; - } - - @JsonProperty("Time") - public void setTime(String time) { - this.time = time; - } - - @JsonProperty("TypeMeta") - public TypeMeta getTypeMeta() { - return typeMeta; - } - - @JsonProperty("TypeMeta") - public void setTypeMeta(TypeMeta typeMeta) { - this.typeMeta = typeMeta; - } - - @JsonProperty("V1beta1MachineAutoscaler") - public MachineAutoscaler getV1beta1MachineAutoscaler() { - return v1beta1MachineAutoscaler; - } - - @JsonProperty("V1beta1MachineAutoscaler") - public void setV1beta1MachineAutoscaler(MachineAutoscaler v1beta1MachineAutoscaler) { - this.v1beta1MachineAutoscaler = v1beta1MachineAutoscaler; - } - - @JsonProperty("V1beta1MachineAutoscalerList") - public MachineAutoscalerList getV1beta1MachineAutoscalerList() { - return v1beta1MachineAutoscalerList; - } - - @JsonProperty("V1beta1MachineAutoscalerList") - public void setV1beta1MachineAutoscalerList(MachineAutoscalerList v1beta1MachineAutoscalerList) { - this.v1beta1MachineAutoscalerList = v1beta1MachineAutoscalerList; - } - - @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/pom.xml b/kubernetes-model-generator/pom.xml index 371e3cf754f..4a320142f16 100644 --- a/kubernetes-model-generator/pom.xml +++ b/kubernetes-model-generator/pom.xml @@ -57,7 +57,7 @@ kubernetes-model-storageclass kubernetes-model-kustomize openshift-model - openshift-model-clusterautoscaling + openshift-model-autoscaling openshift-model-config openshift-model-hive openshift-model-installer diff --git a/openshift-client-api/pom.xml b/openshift-client-api/pom.xml index ff2a647d053..a9032d98c8f 100644 --- a/openshift-client-api/pom.xml +++ b/openshift-client-api/pom.xml @@ -57,7 +57,7 @@ io.fabric8 - openshift-model-clusterautoscaling + openshift-model-autoscaling io.fabric8 @@ -111,7 +111,7 @@ io.fabric8 openshift-model-installer - + io.sundr diff --git a/pom.xml b/pom.xml index d6e086de849..4723f171d61 100644 --- a/pom.xml +++ b/pom.xml @@ -377,7 +377,7 @@ io.fabric8 - openshift-model-clusterautoscaling + openshift-model-autoscaling ${project.version} diff --git a/uberjar/pom.xml b/uberjar/pom.xml index 4755c3806f1..a7110675ff2 100644 --- a/uberjar/pom.xml +++ b/uberjar/pom.xml @@ -140,7 +140,7 @@ io.fabric8 - openshift-model-clusterautoscaling + openshift-model-autoscaling io.fabric8