From f8e3b59ebe27f4a73f0cf6b734e23d6619f5c2c6 Mon Sep 17 00:00:00 2001 From: Marc Nuri Date: Thu, 29 Aug 2024 14:54:43 +0200 Subject: [PATCH] refactor: kubernetes-model-kustomize generated from OpenAPI schemas Signed-off-by: Marc Nuri --- Makefile | 1 + kubernetes-model-generator/generateModel.sh | 1 - .../kubernetes-model-kustomize/Makefile | 27 ---- .../cmd/generate/generate.go | 83 ----------- .../kubernetes-model-kustomize/pom.xml | 40 ++---- .../kubernetes/api/model/KubeSchema.java | 56 -------- .../api/model/ValidationSchema.java | 56 -------- .../kustomize/v1beta1/ConfigMapArgs.java | 22 ++- .../model/kustomize/v1beta1/FieldOptions.java | 22 ++- .../kustomize/v1beta1/FieldSelector.java | 22 ++- .../model/kustomize/v1beta1/FieldSpec.java | 39 ++--- .../kustomize/v1beta1/GeneratorOptions.java | 22 ++- .../model/kustomize/v1beta1/HelmChart.java | 48 ++++++- .../kustomize/v1beta1/HelmChartArgs.java | 34 ++++- .../model/kustomize/v1beta1/HelmGlobals.java | 22 ++- .../api/model/kustomize/v1beta1/Image.java | 22 ++- .../kustomize/v1beta1/Kustomization.java | 54 +++---- .../api/model/kustomize/v1beta1/Label.java | 22 ++- .../kustomize/v1beta1/LegacySortOptions.java | 22 ++- .../model/kustomize/v1beta1/ObjectMeta.java | 134 ------------------ .../api/model/kustomize/v1beta1/Patch.java | 22 ++- .../kustomize/v1beta1/ReplacementField.java | 22 ++- .../api/model/kustomize/v1beta1/Replica.java | 22 ++- .../model/kustomize/v1beta1/SecretArgs.java | 22 ++- .../api/model/kustomize/v1beta1/Selector.java | 39 ++--- .../model/kustomize/v1beta1/SortOptions.java | 22 ++- .../kustomize/v1beta1/SourceSelector.java | 39 ++--- .../api/model/kustomize/v1beta1/Target.java | 39 ++--- .../kustomize/v1beta1/TargetSelector.java | 22 ++- .../api/model/kustomize/v1beta1/Var.java | 22 ++- .../openapi/generator/main.go | 4 + .../generator/model/KubernetesTest.java | 60 -------- .../openapi/schemas/kustomize.json | 2 +- 33 files changed, 517 insertions(+), 569 deletions(-) delete mode 100644 kubernetes-model-generator/kubernetes-model-kustomize/Makefile delete mode 100644 kubernetes-model-generator/kubernetes-model-kustomize/cmd/generate/generate.go delete mode 100644 kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/KubeSchema.java delete mode 100644 kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/ValidationSchema.java delete mode 100644 kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/ObjectMeta.java delete mode 100644 kubernetes-model-generator/openapi/maven-plugin/src/test/java/io/fabric8/kubernetes/schema/generator/model/KubernetesTest.java diff --git a/Makefile b/Makefile index a58d77b9e72..8604183aed9 100644 --- a/Makefile +++ b/Makefile @@ -55,6 +55,7 @@ generate-openapi-classes: 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 + cd kubernetes-model-generator/kubernetes-model-kustomize && 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 35cb02674f8..19908aa215e 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-kustomize" "openshift-model-config" "openshift-model" "openshift-model-operator" diff --git a/kubernetes-model-generator/kubernetes-model-kustomize/Makefile b/kubernetes-model-generator/kubernetes-model-kustomize/Makefile deleted file mode 100644 index c09a7003874..00000000000 --- a/kubernetes-model-generator/kubernetes-model-kustomize/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-kustomize/cmd/generate/generate.go b/kubernetes-model-generator/kubernetes-model-kustomize/cmd/generate/generate.go deleted file mode 100644 index f0f50a9fe98..00000000000 --- a/kubernetes-model-generator/kubernetes-model-kustomize/cmd/generate/generate.go +++ /dev/null @@ -1,83 +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" - "log" - "reflect" - kustomizeapi "sigs.k8s.io/kustomize/api/types" - "strings" - "time" - - "os" - - "github.com/fabric8io/kubernetes-client/kubernetes-model-generator/pkg/schemagen" -) - -type Schema struct { - Kustomization kustomizeapi.Kustomization -} - -func main() { - packages := []schemagen.PackageDescriptor{ - {"sigs.k8s.io/kustomize/api/types", "", "io.fabric8.kubernetes.api.model.kustomize.v1beta1", "kubernetes_kustomize_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(map[string]interface{}{}).Elem(): "java.lang.Object", - } - - schema, err := schemagen.GenerateSchema(reflect.TypeOf(Schema{}), packages, typeMap, manualTypeMap, "kustomize") - if err != nil { - fmt.Fprintf(os.Stderr, "An error occurred: %v", err) - return - } - - // Remove group and version as it's not an API resource - for _, resource := range schema.Resources { - if prop, ok := resource.Properties["apiVersion"]; ok { - prop.Default = "" - } - } - - 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-kustomize/pom.xml b/kubernetes-model-generator/kubernetes-model-kustomize/pom.xml index 44379cdc11d..ad02ab37984 100644 --- a/kubernetes-model-generator/kubernetes-model-kustomize/pom.xml +++ b/kubernetes-model-generator/kubernetes-model-kustomize/pom.xml @@ -43,11 +43,6 @@ io.fabric8 kubernetes-model-core - - io.fabric8 - kubernetes-model-common - - com.fasterxml.jackson.dataformat jackson-dataformat-yaml @@ -55,33 +50,26 @@ - - - - org.codehaus.mojo - build-helper-maven-plugin - - - attach-artifacts - - false - - - - - - - generate - org.jsonschema2pojo - jsonschema2pojo-maven-plugin - - io.fabric8.kubernetes.jsonschema2pojo.KubernetesCoreTypeAnnotator + io.fabric8 + openapi-model-generator-maven-plugin + + + + ${project.basedir}/../openapi/schemas/kustomize.json + + + io.fabric8.kubernetes.api.model.kustomize.v1beta1 + + + ^io\.k8s\.sigs\.kustomize\.api\..*$ + + diff --git a/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/KubeSchema.java b/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/KubeSchema.java deleted file mode 100644 index 9ff61ee975f..00000000000 --- a/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/KubeSchema.java +++ /dev/null @@ -1,56 +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.kustomize.v1beta1.Kustomization; - -@Generated("jsonschema2pojo") -public class KubeSchema { - - private Kustomization kustomization; - @JsonIgnore - private Map additionalProperties = new LinkedHashMap(); - - /** - * No args constructor for use in serialization - * - */ - public KubeSchema() { - } - - public KubeSchema(Kustomization kustomization) { - super(); - this.kustomization = kustomization; - } - - @JsonProperty("Kustomization") - public Kustomization getKustomization() { - return kustomization; - } - - @JsonProperty("Kustomization") - public void setKustomization(Kustomization kustomization) { - this.kustomization = kustomization; - } - - @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-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/ValidationSchema.java b/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/ValidationSchema.java deleted file mode 100644 index 2c01df5f0bb..00000000000 --- a/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/ValidationSchema.java +++ /dev/null @@ -1,56 +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.kustomize.v1beta1.Kustomization; - -@Generated("jsonschema2pojo") -public class ValidationSchema { - - private Kustomization kustomization; - @JsonIgnore - private Map additionalProperties = new LinkedHashMap(); - - /** - * No args constructor for use in serialization - * - */ - public ValidationSchema() { - } - - public ValidationSchema(Kustomization kustomization) { - super(); - this.kustomization = kustomization; - } - - @JsonProperty("Kustomization") - public Kustomization getKustomization() { - return kustomization; - } - - @JsonProperty("Kustomization") - public void setKustomization(Kustomization kustomization) { - this.kustomization = kustomization; - } - - @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-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/ConfigMapArgs.java b/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/ConfigMapArgs.java index ef7882c6d2b..969aaf16ccc 100644 --- a/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/ConfigMapArgs.java +++ b/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/ConfigMapArgs.java @@ -14,8 +14,18 @@ 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; @@ -38,7 +48,17 @@ "_", "" }) -@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, lazyCollectionInitEnabled = false, builderPackage = "io.fabric8.kubernetes.api.builder") +@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 ConfigMapArgs implements Editable , KubernetesResource { diff --git a/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/FieldOptions.java b/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/FieldOptions.java index 20e32ea29b2..de40ecebefb 100644 --- a/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/FieldOptions.java +++ b/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/FieldOptions.java @@ -12,8 +12,18 @@ 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; @@ -32,7 +42,17 @@ "_", "" }) -@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, lazyCollectionInitEnabled = false, builderPackage = "io.fabric8.kubernetes.api.builder") +@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 FieldOptions implements Editable , KubernetesResource { diff --git a/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/FieldSelector.java b/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/FieldSelector.java index d4faf77979d..67a8510f158 100644 --- a/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/FieldSelector.java +++ b/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/FieldSelector.java @@ -12,8 +12,18 @@ 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; @@ -29,7 +39,17 @@ "_", "" }) -@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, lazyCollectionInitEnabled = false, builderPackage = "io.fabric8.kubernetes.api.builder") +@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 FieldSelector implements Editable , KubernetesResource { diff --git a/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/FieldSpec.java b/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/FieldSpec.java index 73c81a6e745..e664f921820 100644 --- a/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/FieldSpec.java +++ b/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/FieldSpec.java @@ -12,8 +12,18 @@ 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; @@ -33,7 +43,17 @@ "_", "" }) -@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, lazyCollectionInitEnabled = false, builderPackage = "io.fabric8.kubernetes.api.builder") +@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 FieldSpec implements Editable , KubernetesResource { @@ -42,13 +62,8 @@ public class FieldSpec implements Editable , KubernetesResourc private Boolean create; @JsonProperty("group") private String group; - /** - * - * (Required) - * - */ @JsonProperty("kind") - private String kind = "FieldSpec"; + private String kind; @JsonProperty("path") private String path; @JsonProperty("version") @@ -92,21 +107,11 @@ public void setGroup(String group) { this.group = group; } - /** - * - * (Required) - * - */ @JsonProperty("kind") public String getKind() { return kind; } - /** - * - * (Required) - * - */ @JsonProperty("kind") public void setKind(String kind) { this.kind = kind; diff --git a/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/GeneratorOptions.java b/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/GeneratorOptions.java index ee5fe63b1b1..730b1725a7b 100644 --- a/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/GeneratorOptions.java +++ b/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/GeneratorOptions.java @@ -12,8 +12,18 @@ 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; @@ -32,7 +42,17 @@ "_", "" }) -@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, lazyCollectionInitEnabled = false, builderPackage = "io.fabric8.kubernetes.api.builder") +@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 GeneratorOptions implements Editable , KubernetesResource { diff --git a/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/HelmChart.java b/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/HelmChart.java index 26a491590cd..3a65740b076 100644 --- a/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/HelmChart.java +++ b/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/HelmChart.java @@ -14,8 +14,20 @@ 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.GenericKubernetesResource; +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.fabric8.kubernetes.api.model.runtime.RawExtension; import io.sundr.builder.annotations.Buildable; +import io.sundr.builder.annotations.BuildableReference; import lombok.EqualsAndHashCode; import lombok.ToString; import lombok.experimental.Accessors; @@ -26,6 +38,7 @@ "additionalValuesFiles", "apiVersions", "includeCRDs", + "kubeVersion", "name", "nameTemplate", "namespace", @@ -44,7 +57,19 @@ "_", "" }) -@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, lazyCollectionInitEnabled = false, builderPackage = "io.fabric8.kubernetes.api.builder") +@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), + @BuildableReference(GenericKubernetesResource.class), + @BuildableReference(RawExtension.class) +}) @Generated("jsonschema2pojo") public class HelmChart implements Editable , KubernetesResource { @@ -57,6 +82,8 @@ public class HelmChart implements Editable , KubernetesResourc private List apiVersions = new ArrayList<>(); @JsonProperty("includeCRDs") private Boolean includeCRDs; + @JsonProperty("kubeVersion") + private String kubeVersion; @JsonProperty("name") private String name; @JsonProperty("nameTemplate") @@ -75,7 +102,7 @@ public class HelmChart implements Editable , KubernetesResourc private String valuesFile; @JsonProperty("valuesInline") @JsonInclude(JsonInclude.Include.NON_EMPTY) - private Map valuesInline = new LinkedHashMap<>(); + private Map valuesInline = new LinkedHashMap<>(); @JsonProperty("valuesMerge") private String valuesMerge; @JsonProperty("version") @@ -90,11 +117,12 @@ public class HelmChart implements Editable , KubernetesResourc public HelmChart() { } - public HelmChart(List additionalValuesFiles, List apiVersions, Boolean includeCRDs, String name, String nameTemplate, String namespace, String releaseName, String repo, Boolean skipHooks, Boolean skipTests, String valuesFile, Map valuesInline, String valuesMerge, String version) { + public HelmChart(List additionalValuesFiles, List apiVersions, Boolean includeCRDs, String kubeVersion, String name, String nameTemplate, String namespace, String releaseName, String repo, Boolean skipHooks, Boolean skipTests, String valuesFile, Map valuesInline, String valuesMerge, String version) { super(); this.additionalValuesFiles = additionalValuesFiles; this.apiVersions = apiVersions; this.includeCRDs = includeCRDs; + this.kubeVersion = kubeVersion; this.name = name; this.nameTemplate = nameTemplate; this.namespace = namespace; @@ -140,6 +168,16 @@ public void setIncludeCRDs(Boolean includeCRDs) { this.includeCRDs = includeCRDs; } + @JsonProperty("kubeVersion") + public String getKubeVersion() { + return kubeVersion; + } + + @JsonProperty("kubeVersion") + public void setKubeVersion(String kubeVersion) { + this.kubeVersion = kubeVersion; + } + @JsonProperty("name") public String getName() { return name; @@ -222,12 +260,12 @@ public void setValuesFile(String valuesFile) { @JsonProperty("valuesInline") @JsonInclude(JsonInclude.Include.NON_EMPTY) - public Map getValuesInline() { + public Map getValuesInline() { return valuesInline; } @JsonProperty("valuesInline") - public void setValuesInline(Map valuesInline) { + public void setValuesInline(Map valuesInline) { this.valuesInline = valuesInline; } diff --git a/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/HelmChartArgs.java b/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/HelmChartArgs.java index be180e57d18..95a972fcac1 100644 --- a/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/HelmChartArgs.java +++ b/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/HelmChartArgs.java @@ -14,8 +14,20 @@ 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.GenericKubernetesResource; +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.fabric8.kubernetes.api.model.runtime.RawExtension; import io.sundr.builder.annotations.Buildable; +import io.sundr.builder.annotations.BuildableReference; import lombok.EqualsAndHashCode; import lombok.ToString; import lombok.experimental.Accessors; @@ -43,7 +55,19 @@ "_", "" }) -@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, lazyCollectionInitEnabled = false, builderPackage = "io.fabric8.kubernetes.api.builder") +@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), + @BuildableReference(GenericKubernetesResource.class), + @BuildableReference(RawExtension.class) +}) @Generated("jsonschema2pojo") public class HelmChartArgs implements Editable , KubernetesResource { @@ -73,7 +97,7 @@ public class HelmChartArgs implements Editable , Kubernete private String values; @JsonProperty("valuesLocal") @JsonInclude(JsonInclude.Include.NON_EMPTY) - private Map valuesLocal = new LinkedHashMap<>(); + private Map valuesLocal = new LinkedHashMap<>(); @JsonProperty("valuesMerge") private String valuesMerge; @JsonIgnore @@ -86,7 +110,7 @@ public class HelmChartArgs implements Editable , Kubernete public HelmChartArgs() { } - public HelmChartArgs(String chartHome, String chartName, String chartRepoName, String chartRepoUrl, String chartVersion, List extraArgs, String helmBin, String helmHome, String releaseName, String releaseNamespace, String values, Map valuesLocal, String valuesMerge) { + public HelmChartArgs(String chartHome, String chartName, String chartRepoName, String chartRepoUrl, String chartVersion, List extraArgs, String helmBin, String helmHome, String releaseName, String releaseNamespace, String values, Map valuesLocal, String valuesMerge) { super(); this.chartHome = chartHome; this.chartName = chartName; @@ -216,12 +240,12 @@ public void setValues(String values) { @JsonProperty("valuesLocal") @JsonInclude(JsonInclude.Include.NON_EMPTY) - public Map getValuesLocal() { + public Map getValuesLocal() { return valuesLocal; } @JsonProperty("valuesLocal") - public void setValuesLocal(Map valuesLocal) { + public void setValuesLocal(Map valuesLocal) { this.valuesLocal = valuesLocal; } diff --git a/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/HelmGlobals.java b/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/HelmGlobals.java index d63274ad749..b8c18ff420b 100644 --- a/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/HelmGlobals.java +++ b/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/HelmGlobals.java @@ -12,8 +12,18 @@ 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; @@ -30,7 +40,17 @@ "_", "" }) -@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, lazyCollectionInitEnabled = false, builderPackage = "io.fabric8.kubernetes.api.builder") +@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 HelmGlobals implements Editable , KubernetesResource { diff --git a/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/Image.java b/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/Image.java index 3fdd3dc9c2f..3e5c4d6970a 100644 --- a/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/Image.java +++ b/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/Image.java @@ -12,8 +12,18 @@ 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; @@ -33,7 +43,17 @@ "_", "" }) -@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, lazyCollectionInitEnabled = false, builderPackage = "io.fabric8.kubernetes.api.builder") +@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 Image implements Editable , KubernetesResource { diff --git a/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/Kustomization.java b/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/Kustomization.java index 5c35484cdca..071a0c573f2 100644 --- a/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/Kustomization.java +++ b/kubernetes-model-generator/kubernetes-model-kustomize/src/generated/java/io/fabric8/kubernetes/api/model/kustomize/v1beta1/Kustomization.java @@ -14,8 +14,18 @@ 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; @@ -64,16 +74,21 @@ "_", "" }) -@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, lazyCollectionInitEnabled = false, builderPackage = "io.fabric8.kubernetes.api.builder") +@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 Kustomization implements Editable , KubernetesResource { - /** - * - * (Required) - * - */ @JsonProperty("apiVersion") private String apiVersion; @JsonProperty("bases") @@ -119,13 +134,8 @@ public class Kustomization implements Editable , Kubernete @JsonProperty("images") @JsonInclude(JsonInclude.Include.NON_EMPTY) private List images = new ArrayList<>(); - /** - * - * (Required) - * - */ @JsonProperty("kind") - private String kind = "Kustomization"; + private String kind; @JsonProperty("labels") @JsonInclude(JsonInclude.Include.NON_EMPTY) private List