diff --git a/Makefile b/Makefile index 763cd1e8c92..0b103c74907 100644 --- a/Makefile +++ b/Makefile @@ -52,6 +52,7 @@ generate-openapi-classes: cd kubernetes-model-generator/kubernetes-model-metrics && mvn -Pgenerate clean install cd kubernetes-model-generator/kubernetes-model-node && mvn -Pgenerate clean install cd kubernetes-model-generator/kubernetes-model-policy && mvn -Pgenerate clean install + cd kubernetes-model-generator/kubernetes-model-scheduling && 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 87088b468fe..4417b35902c 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-scheduling" "kubernetes-model-storageclass" "kubernetes-model-resource" "kubernetes-model-kustomize" diff --git a/kubernetes-model-generator/kubernetes-model-scheduling/Makefile b/kubernetes-model-generator/kubernetes-model-scheduling/Makefile deleted file mode 100644 index c09a7003874..00000000000 --- a/kubernetes-model-generator/kubernetes-model-scheduling/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-scheduling/cmd/generate/generate.go b/kubernetes-model-generator/kubernetes-model-scheduling/cmd/generate/generate.go deleted file mode 100644 index e36595a64a6..00000000000 --- a/kubernetes-model-generator/kubernetes-model-scheduling/cmd/generate/generate.go +++ /dev/null @@ -1,107 +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" - // Dependencies of rbac - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/api/resource" - apimachineryversion "k8s.io/apimachinery/pkg/version" - kapi "k8s.io/api/core/v1" - - v1beta1scheduling "k8s.io/api/scheduling/v1beta1" - v1scheduling "k8s.io/api/scheduling/v1" - - "log" - "reflect" - "strings" - "time" - - "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 - ListOptions metav1.ListOptions - DeleteOptions metav1.DeleteOptions - CreateOptions metav1.CreateOptions - UpdateOptions metav1.UpdateOptions - GetOptions metav1.GetOptions - PatchOptions metav1.PatchOptions - Time metav1.Time - RootPaths metav1.RootPaths - Quantity resource.Quantity - ObjectReference kapi.ObjectReference - - V1Beta1PriorityClass v1beta1scheduling.PriorityClass - V1Beta1PriorityClassList v1beta1scheduling.PriorityClassList - V1PriorityClass v1scheduling.PriorityClass - V1PriorityClassList v1scheduling.PriorityClassList -} - -func main() { - packages := []schemagen.PackageDescriptor{ - {"k8s.io/apimachinery/pkg/util/intstr", "", "io.fabric8.kubernetes.api.model", "kubernetes_apimachinery_pkg_util_intstr_", false}, - {"k8s.io/apimachinery/pkg/runtime", "", "io.fabric8.kubernetes.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/apimachinery/pkg/apis/meta/v1", "", "io.fabric8.kubernetes.api.model", "kubernetes_apimachinery_", false}, - {"k8s.io/api/core/v1", "", "io.fabric8.kubernetes.api.model", "kubernetes_core_", false}, - {"k8s.io/api/scheduling/v1beta1", "scheduling.k8s.io", "io.fabric8.kubernetes.api.model.scheduling.v1beta1", "kubernetes_scheduling_v1beta1_", true}, - {"k8s.io/api/scheduling/v1", "scheduling.k8s.io", "io.fabric8.kubernetes.api.model.scheduling.v1", "kubernetes_scheduling_v1_", true}, - } - - typeMap := map[reflect.Type]reflect.Type{ - reflect.TypeOf(time.Time{}): reflect.TypeOf(""), - reflect.TypeOf(struct{}{}): reflect.TypeOf(""), - } - schema, err := schemagen.GenerateSchema(reflect.TypeOf(Schema{}), packages, typeMap, map[reflect.Type]string{},"scheduling") - if err != nil { - fmt.Fprintf(os.Stderr, "An error occurred: %v", err) - return - } - - args := os.Args[1:] - if len(args) < 1 || args[0] != "validation" { - schema.Resources = nil - } - - b, err := json.Marshal(&schema) - if err != nil { - log.Fatal(err) - } - result := string(b) - result = strings.Replace(result, "\"additionalProperty\":", "\"additionalProperties\":", -1) - - var out bytes.Buffer - err = json.Indent(&out, []byte(result), "", " ") - if err != nil { - log.Fatal(err) - } - - fmt.Println(out.String()) -} diff --git a/kubernetes-model-generator/kubernetes-model-scheduling/pom.xml b/kubernetes-model-generator/kubernetes-model-scheduling/pom.xml index 95e7b5e2811..a9bf76c504a 100644 --- a/kubernetes-model-generator/kubernetes-model-scheduling/pom.xml +++ b/kubernetes-model-generator/kubernetes-model-scheduling/pom.xml @@ -43,37 +43,30 @@ io.fabric8 kubernetes-model-core - - io.fabric8 - kubernetes-model-common - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - attach-artifacts - - false - - - - - - - generate - org.jsonschema2pojo - jsonschema2pojo-maven-plugin + io.fabric8 + openapi-model-generator-maven-plugin + + + + ${project.basedir}/../openapi/schemas/kubernetes-1.21.14.json + ${openapi.schema.kubernetes-latest} + + + io.fabric8.kubernetes.api.model.scheduling + + + ^io\.k8s\.api\.scheduling\..*$ + + + diff --git a/kubernetes-model-generator/kubernetes-model-scheduling/src/generated/java/io/fabric8/kubernetes/api/model/KubeSchema.java b/kubernetes-model-generator/kubernetes-model-scheduling/src/generated/java/io/fabric8/kubernetes/api/model/KubeSchema.java deleted file mode 100644 index eb212190c64..00000000000 --- a/kubernetes-model-generator/kubernetes-model-scheduling/src/generated/java/io/fabric8/kubernetes/api/model/KubeSchema.java +++ /dev/null @@ -1,308 +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; - -@Generated("jsonschema2pojo") -public class KubeSchema { - - private APIGroup aPIGroup; - private APIGroupList aPIGroupList; - private KubernetesList baseKubernetesList; - private CreateOptions createOptions; - private DeleteOptions deleteOptions; - private GetOptions getOptions; - private Info info; - private ListOptions listOptions; - private ObjectMeta objectMeta; - private ObjectReference objectReference; - private Patch patch; - private PatchOptions patchOptions; - private Quantity quantity; - private RootPaths rootPaths; - private Status status; - private String time; - private TypeMeta typeMeta; - private UpdateOptions updateOptions; - private io.fabric8.kubernetes.api.model.scheduling.v1beta1.PriorityClass v1Beta1PriorityClass; - private io.fabric8.kubernetes.api.model.scheduling.v1beta1.PriorityClassList v1Beta1PriorityClassList; - private io.fabric8.kubernetes.api.model.scheduling.v1.PriorityClass v1PriorityClass; - private io.fabric8.kubernetes.api.model.scheduling.v1.PriorityClassList v1PriorityClassList; - @JsonIgnore - private Map additionalProperties = new LinkedHashMap(); - - /** - * No args constructor for use in serialization - * - */ - public KubeSchema() { - } - - public KubeSchema(APIGroup aPIGroup, APIGroupList aPIGroupList, KubernetesList baseKubernetesList, CreateOptions createOptions, DeleteOptions deleteOptions, GetOptions getOptions, Info info, ListOptions listOptions, ObjectMeta objectMeta, ObjectReference objectReference, Patch patch, PatchOptions patchOptions, Quantity quantity, RootPaths rootPaths, Status status, String time, TypeMeta typeMeta, UpdateOptions updateOptions, io.fabric8.kubernetes.api.model.scheduling.v1beta1.PriorityClass v1Beta1PriorityClass, io.fabric8.kubernetes.api.model.scheduling.v1beta1.PriorityClassList v1Beta1PriorityClassList, io.fabric8.kubernetes.api.model.scheduling.v1.PriorityClass v1PriorityClass, io.fabric8.kubernetes.api.model.scheduling.v1.PriorityClassList v1PriorityClassList) { - super(); - this.aPIGroup = aPIGroup; - this.aPIGroupList = aPIGroupList; - this.baseKubernetesList = baseKubernetesList; - this.createOptions = createOptions; - this.deleteOptions = deleteOptions; - this.getOptions = getOptions; - this.info = info; - this.listOptions = listOptions; - this.objectMeta = objectMeta; - this.objectReference = objectReference; - this.patch = patch; - this.patchOptions = patchOptions; - this.quantity = quantity; - this.rootPaths = rootPaths; - this.status = status; - this.time = time; - this.typeMeta = typeMeta; - this.updateOptions = updateOptions; - this.v1Beta1PriorityClass = v1Beta1PriorityClass; - this.v1Beta1PriorityClassList = v1Beta1PriorityClassList; - this.v1PriorityClass = v1PriorityClass; - this.v1PriorityClassList = v1PriorityClassList; - } - - @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("CreateOptions") - public CreateOptions getCreateOptions() { - return createOptions; - } - - @JsonProperty("CreateOptions") - public void setCreateOptions(CreateOptions createOptions) { - this.createOptions = createOptions; - } - - @JsonProperty("DeleteOptions") - public DeleteOptions getDeleteOptions() { - return deleteOptions; - } - - @JsonProperty("DeleteOptions") - public void setDeleteOptions(DeleteOptions deleteOptions) { - this.deleteOptions = deleteOptions; - } - - @JsonProperty("GetOptions") - public GetOptions getGetOptions() { - return getOptions; - } - - @JsonProperty("GetOptions") - public void setGetOptions(GetOptions getOptions) { - this.getOptions = getOptions; - } - - @JsonProperty("Info") - public Info getInfo() { - return info; - } - - @JsonProperty("Info") - public void setInfo(Info info) { - this.info = info; - } - - @JsonProperty("ListOptions") - public ListOptions getListOptions() { - return listOptions; - } - - @JsonProperty("ListOptions") - public void setListOptions(ListOptions listOptions) { - this.listOptions = listOptions; - } - - @JsonProperty("ObjectMeta") - public ObjectMeta getObjectMeta() { - return objectMeta; - } - - @JsonProperty("ObjectMeta") - public void setObjectMeta(ObjectMeta objectMeta) { - this.objectMeta = objectMeta; - } - - @JsonProperty("ObjectReference") - public ObjectReference getObjectReference() { - return objectReference; - } - - @JsonProperty("ObjectReference") - public void setObjectReference(ObjectReference objectReference) { - this.objectReference = objectReference; - } - - @JsonProperty("Patch") - public Patch getPatch() { - return patch; - } - - @JsonProperty("Patch") - public void setPatch(Patch patch) { - this.patch = patch; - } - - @JsonProperty("PatchOptions") - public PatchOptions getPatchOptions() { - return patchOptions; - } - - @JsonProperty("PatchOptions") - public void setPatchOptions(PatchOptions patchOptions) { - this.patchOptions = patchOptions; - } - - @JsonProperty("Quantity") - public Quantity getQuantity() { - return quantity; - } - - @JsonProperty("Quantity") - public void setQuantity(Quantity quantity) { - this.quantity = quantity; - } - - @JsonProperty("RootPaths") - public RootPaths getRootPaths() { - return rootPaths; - } - - @JsonProperty("RootPaths") - public void setRootPaths(RootPaths rootPaths) { - this.rootPaths = rootPaths; - } - - @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("UpdateOptions") - public UpdateOptions getUpdateOptions() { - return updateOptions; - } - - @JsonProperty("UpdateOptions") - public void setUpdateOptions(UpdateOptions updateOptions) { - this.updateOptions = updateOptions; - } - - @JsonProperty("V1Beta1PriorityClass") - public io.fabric8.kubernetes.api.model.scheduling.v1beta1.PriorityClass getV1Beta1PriorityClass() { - return v1Beta1PriorityClass; - } - - @JsonProperty("V1Beta1PriorityClass") - public void setV1Beta1PriorityClass(io.fabric8.kubernetes.api.model.scheduling.v1beta1.PriorityClass v1Beta1PriorityClass) { - this.v1Beta1PriorityClass = v1Beta1PriorityClass; - } - - @JsonProperty("V1Beta1PriorityClassList") - public io.fabric8.kubernetes.api.model.scheduling.v1beta1.PriorityClassList getV1Beta1PriorityClassList() { - return v1Beta1PriorityClassList; - } - - @JsonProperty("V1Beta1PriorityClassList") - public void setV1Beta1PriorityClassList(io.fabric8.kubernetes.api.model.scheduling.v1beta1.PriorityClassList v1Beta1PriorityClassList) { - this.v1Beta1PriorityClassList = v1Beta1PriorityClassList; - } - - @JsonProperty("V1PriorityClass") - public io.fabric8.kubernetes.api.model.scheduling.v1.PriorityClass getV1PriorityClass() { - return v1PriorityClass; - } - - @JsonProperty("V1PriorityClass") - public void setV1PriorityClass(io.fabric8.kubernetes.api.model.scheduling.v1.PriorityClass v1PriorityClass) { - this.v1PriorityClass = v1PriorityClass; - } - - @JsonProperty("V1PriorityClassList") - public io.fabric8.kubernetes.api.model.scheduling.v1.PriorityClassList getV1PriorityClassList() { - return v1PriorityClassList; - } - - @JsonProperty("V1PriorityClassList") - public void setV1PriorityClassList(io.fabric8.kubernetes.api.model.scheduling.v1.PriorityClassList v1PriorityClassList) { - this.v1PriorityClassList = v1PriorityClassList; - } - - @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-scheduling/src/generated/java/io/fabric8/kubernetes/api/model/ValidationSchema.java b/kubernetes-model-generator/kubernetes-model-scheduling/src/generated/java/io/fabric8/kubernetes/api/model/ValidationSchema.java deleted file mode 100644 index 81b401dd222..00000000000 --- a/kubernetes-model-generator/kubernetes-model-scheduling/src/generated/java/io/fabric8/kubernetes/api/model/ValidationSchema.java +++ /dev/null @@ -1,308 +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; - -@Generated("jsonschema2pojo") -public class ValidationSchema { - - private APIGroup aPIGroup; - private APIGroupList aPIGroupList; - private KubernetesList baseKubernetesList; - private CreateOptions createOptions; - private DeleteOptions deleteOptions; - private GetOptions getOptions; - private Info info; - private ListOptions listOptions; - private ObjectMeta objectMeta; - private ObjectReference objectReference; - private Patch patch; - private PatchOptions patchOptions; - private Quantity quantity; - private RootPaths rootPaths; - private Status status; - private String time; - private TypeMeta typeMeta; - private UpdateOptions updateOptions; - private io.fabric8.kubernetes.api.model.scheduling.v1beta1.PriorityClass v1Beta1PriorityClass; - private io.fabric8.kubernetes.api.model.scheduling.v1beta1.PriorityClassList v1Beta1PriorityClassList; - private io.fabric8.kubernetes.api.model.scheduling.v1.PriorityClass v1PriorityClass; - private io.fabric8.kubernetes.api.model.scheduling.v1.PriorityClassList v1PriorityClassList; - @JsonIgnore - private Map additionalProperties = new LinkedHashMap(); - - /** - * No args constructor for use in serialization - * - */ - public ValidationSchema() { - } - - public ValidationSchema(APIGroup aPIGroup, APIGroupList aPIGroupList, KubernetesList baseKubernetesList, CreateOptions createOptions, DeleteOptions deleteOptions, GetOptions getOptions, Info info, ListOptions listOptions, ObjectMeta objectMeta, ObjectReference objectReference, Patch patch, PatchOptions patchOptions, Quantity quantity, RootPaths rootPaths, Status status, String time, TypeMeta typeMeta, UpdateOptions updateOptions, io.fabric8.kubernetes.api.model.scheduling.v1beta1.PriorityClass v1Beta1PriorityClass, io.fabric8.kubernetes.api.model.scheduling.v1beta1.PriorityClassList v1Beta1PriorityClassList, io.fabric8.kubernetes.api.model.scheduling.v1.PriorityClass v1PriorityClass, io.fabric8.kubernetes.api.model.scheduling.v1.PriorityClassList v1PriorityClassList) { - super(); - this.aPIGroup = aPIGroup; - this.aPIGroupList = aPIGroupList; - this.baseKubernetesList = baseKubernetesList; - this.createOptions = createOptions; - this.deleteOptions = deleteOptions; - this.getOptions = getOptions; - this.info = info; - this.listOptions = listOptions; - this.objectMeta = objectMeta; - this.objectReference = objectReference; - this.patch = patch; - this.patchOptions = patchOptions; - this.quantity = quantity; - this.rootPaths = rootPaths; - this.status = status; - this.time = time; - this.typeMeta = typeMeta; - this.updateOptions = updateOptions; - this.v1Beta1PriorityClass = v1Beta1PriorityClass; - this.v1Beta1PriorityClassList = v1Beta1PriorityClassList; - this.v1PriorityClass = v1PriorityClass; - this.v1PriorityClassList = v1PriorityClassList; - } - - @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("CreateOptions") - public CreateOptions getCreateOptions() { - return createOptions; - } - - @JsonProperty("CreateOptions") - public void setCreateOptions(CreateOptions createOptions) { - this.createOptions = createOptions; - } - - @JsonProperty("DeleteOptions") - public DeleteOptions getDeleteOptions() { - return deleteOptions; - } - - @JsonProperty("DeleteOptions") - public void setDeleteOptions(DeleteOptions deleteOptions) { - this.deleteOptions = deleteOptions; - } - - @JsonProperty("GetOptions") - public GetOptions getGetOptions() { - return getOptions; - } - - @JsonProperty("GetOptions") - public void setGetOptions(GetOptions getOptions) { - this.getOptions = getOptions; - } - - @JsonProperty("Info") - public Info getInfo() { - return info; - } - - @JsonProperty("Info") - public void setInfo(Info info) { - this.info = info; - } - - @JsonProperty("ListOptions") - public ListOptions getListOptions() { - return listOptions; - } - - @JsonProperty("ListOptions") - public void setListOptions(ListOptions listOptions) { - this.listOptions = listOptions; - } - - @JsonProperty("ObjectMeta") - public ObjectMeta getObjectMeta() { - return objectMeta; - } - - @JsonProperty("ObjectMeta") - public void setObjectMeta(ObjectMeta objectMeta) { - this.objectMeta = objectMeta; - } - - @JsonProperty("ObjectReference") - public ObjectReference getObjectReference() { - return objectReference; - } - - @JsonProperty("ObjectReference") - public void setObjectReference(ObjectReference objectReference) { - this.objectReference = objectReference; - } - - @JsonProperty("Patch") - public Patch getPatch() { - return patch; - } - - @JsonProperty("Patch") - public void setPatch(Patch patch) { - this.patch = patch; - } - - @JsonProperty("PatchOptions") - public PatchOptions getPatchOptions() { - return patchOptions; - } - - @JsonProperty("PatchOptions") - public void setPatchOptions(PatchOptions patchOptions) { - this.patchOptions = patchOptions; - } - - @JsonProperty("Quantity") - public Quantity getQuantity() { - return quantity; - } - - @JsonProperty("Quantity") - public void setQuantity(Quantity quantity) { - this.quantity = quantity; - } - - @JsonProperty("RootPaths") - public RootPaths getRootPaths() { - return rootPaths; - } - - @JsonProperty("RootPaths") - public void setRootPaths(RootPaths rootPaths) { - this.rootPaths = rootPaths; - } - - @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("UpdateOptions") - public UpdateOptions getUpdateOptions() { - return updateOptions; - } - - @JsonProperty("UpdateOptions") - public void setUpdateOptions(UpdateOptions updateOptions) { - this.updateOptions = updateOptions; - } - - @JsonProperty("V1Beta1PriorityClass") - public io.fabric8.kubernetes.api.model.scheduling.v1beta1.PriorityClass getV1Beta1PriorityClass() { - return v1Beta1PriorityClass; - } - - @JsonProperty("V1Beta1PriorityClass") - public void setV1Beta1PriorityClass(io.fabric8.kubernetes.api.model.scheduling.v1beta1.PriorityClass v1Beta1PriorityClass) { - this.v1Beta1PriorityClass = v1Beta1PriorityClass; - } - - @JsonProperty("V1Beta1PriorityClassList") - public io.fabric8.kubernetes.api.model.scheduling.v1beta1.PriorityClassList getV1Beta1PriorityClassList() { - return v1Beta1PriorityClassList; - } - - @JsonProperty("V1Beta1PriorityClassList") - public void setV1Beta1PriorityClassList(io.fabric8.kubernetes.api.model.scheduling.v1beta1.PriorityClassList v1Beta1PriorityClassList) { - this.v1Beta1PriorityClassList = v1Beta1PriorityClassList; - } - - @JsonProperty("V1PriorityClass") - public io.fabric8.kubernetes.api.model.scheduling.v1.PriorityClass getV1PriorityClass() { - return v1PriorityClass; - } - - @JsonProperty("V1PriorityClass") - public void setV1PriorityClass(io.fabric8.kubernetes.api.model.scheduling.v1.PriorityClass v1PriorityClass) { - this.v1PriorityClass = v1PriorityClass; - } - - @JsonProperty("V1PriorityClassList") - public io.fabric8.kubernetes.api.model.scheduling.v1.PriorityClassList getV1PriorityClassList() { - return v1PriorityClassList; - } - - @JsonProperty("V1PriorityClassList") - public void setV1PriorityClassList(io.fabric8.kubernetes.api.model.scheduling.v1.PriorityClassList v1PriorityClassList) { - this.v1PriorityClassList = v1PriorityClassList; - } - - @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-scheduling/src/generated/java/io/fabric8/kubernetes/api/model/scheduling/v1/PriorityClass.java b/kubernetes-model-generator/kubernetes-model-scheduling/src/generated/java/io/fabric8/kubernetes/api/model/scheduling/v1/PriorityClass.java index f618804ed71..8217792fa6b 100644 --- a/kubernetes-model-generator/kubernetes-model-scheduling/src/generated/java/io/fabric8/kubernetes/api/model/scheduling/v1/PriorityClass.java +++ b/kubernetes-model-generator/kubernetes-model-scheduling/src/generated/java/io/fabric8/kubernetes/api/model/scheduling/v1/PriorityClass.java @@ -17,6 +17,7 @@ import io.fabric8.kubernetes.api.model.IntOrString; import io.fabric8.kubernetes.api.model.LabelSelector; import io.fabric8.kubernetes.api.model.LocalObjectReference; +import io.fabric8.kubernetes.api.model.ObjectMeta; import io.fabric8.kubernetes.api.model.ObjectReference; import io.fabric8.kubernetes.api.model.PersistentVolumeClaim; import io.fabric8.kubernetes.api.model.PodTemplateSpec; @@ -49,7 +50,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), @@ -87,7 +88,7 @@ public class PriorityClass implements Editable , HasMetada @JsonProperty("kind") private String kind = "PriorityClass"; @JsonProperty("metadata") - private io.fabric8.kubernetes.api.model.ObjectMeta metadata; + private ObjectMeta metadata; @JsonProperty("preemptionPolicy") private String preemptionPolicy; @JsonProperty("value") @@ -102,7 +103,7 @@ public class PriorityClass implements Editable , HasMetada public PriorityClass() { } - public PriorityClass(String apiVersion, String description, Boolean globalDefault, String kind, io.fabric8.kubernetes.api.model.ObjectMeta metadata, String preemptionPolicy, Integer value) { + public PriorityClass(String apiVersion, String description, Boolean globalDefault, String kind, ObjectMeta metadata, String preemptionPolicy, Integer value) { super(); this.apiVersion = apiVersion; this.description = description; @@ -174,12 +175,12 @@ public void setKind(String kind) { } @JsonProperty("metadata") - public io.fabric8.kubernetes.api.model.ObjectMeta getMetadata() { + public ObjectMeta getMetadata() { return metadata; } @JsonProperty("metadata") - public void setMetadata(io.fabric8.kubernetes.api.model.ObjectMeta metadata) { + public void setMetadata(ObjectMeta metadata) { this.metadata = metadata; } diff --git a/kubernetes-model-generator/kubernetes-model-scheduling/src/generated/java/io/fabric8/kubernetes/api/model/scheduling/v1alpha1/PriorityClass.java b/kubernetes-model-generator/kubernetes-model-scheduling/src/generated/java/io/fabric8/kubernetes/api/model/scheduling/v1alpha1/PriorityClass.java new file mode 100644 index 00000000000..6ed3b42e682 --- /dev/null +++ b/kubernetes-model-generator/kubernetes-model-scheduling/src/generated/java/io/fabric8/kubernetes/api/model/scheduling/v1alpha1/PriorityClass.java @@ -0,0 +1,231 @@ + +package io.fabric8.kubernetes.api.model.scheduling.v1alpha1; + +import java.util.LinkedHashMap; +import java.util.Map; +import javax.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import io.fabric8.kubernetes.api.builder.Editable; +import io.fabric8.kubernetes.api.model.Container; +import io.fabric8.kubernetes.api.model.HasMetadata; +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; +import io.fabric8.kubernetes.api.model.ResourceRequirements; +import io.fabric8.kubernetes.model.annotation.Group; +import io.fabric8.kubernetes.model.annotation.Version; +import io.sundr.builder.annotations.Buildable; +import io.sundr.builder.annotations.BuildableReference; +import io.sundr.transform.annotations.TemplateTransformation; +import io.sundr.transform.annotations.TemplateTransformations; +import lombok.EqualsAndHashCode; +import lombok.ToString; +import lombok.experimental.Accessors; + +@JsonDeserialize(using = com.fasterxml.jackson.databind.JsonDeserializer.None.class) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "apiVersion", + "kind", + "metadata", + "description", + "globalDefault", + "preemptionPolicy", + "value" +}) +@ToString +@EqualsAndHashCode +@Accessors(prefix = { + "_", + "" +}) +@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, lazyCollectionInitEnabled = false, builderPackage = "io.fabric8.kubernetes.api.builder", refs = { + @BuildableReference(ObjectMeta.class), + @BuildableReference(LabelSelector.class), + @BuildableReference(Container.class), + @BuildableReference(PodTemplateSpec.class), + @BuildableReference(ResourceRequirements.class), + @BuildableReference(IntOrString.class), + @BuildableReference(ObjectReference.class), + @BuildableReference(LocalObjectReference.class), + @BuildableReference(PersistentVolumeClaim.class) +}) +@TemplateTransformations({ + @TemplateTransformation(value = "/manifest.vm", outputPath = "META-INF/services/io.fabric8.kubernetes.api.model.KubernetesResource", gather = true) +}) +@Version("v1alpha1") +@Group("scheduling.k8s.io") +@Generated("jsonschema2pojo") +public class PriorityClass implements Editable , HasMetadata +{ + + /** + * + * (Required) + * + */ + @JsonProperty("apiVersion") + private String apiVersion = "scheduling.k8s.io/v1alpha1"; + @JsonProperty("description") + private String description; + @JsonProperty("globalDefault") + private Boolean globalDefault; + /** + * + * (Required) + * + */ + @JsonProperty("kind") + private String kind = "PriorityClass"; + @JsonProperty("metadata") + private ObjectMeta metadata; + @JsonProperty("preemptionPolicy") + private String preemptionPolicy; + @JsonProperty("value") + private Integer value; + @JsonIgnore + private Map additionalProperties = new LinkedHashMap(); + + /** + * No args constructor for use in serialization + * + */ + public PriorityClass() { + } + + public PriorityClass(String apiVersion, String description, Boolean globalDefault, String kind, ObjectMeta metadata, String preemptionPolicy, Integer value) { + super(); + this.apiVersion = apiVersion; + this.description = description; + this.globalDefault = globalDefault; + this.kind = kind; + this.metadata = metadata; + this.preemptionPolicy = preemptionPolicy; + this.value = value; + } + + /** + * + * (Required) + * + */ + @JsonProperty("apiVersion") + public String getApiVersion() { + return apiVersion; + } + + /** + * + * (Required) + * + */ + @JsonProperty("apiVersion") + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + @JsonProperty("description") + public String getDescription() { + return description; + } + + @JsonProperty("description") + public void setDescription(String description) { + this.description = description; + } + + @JsonProperty("globalDefault") + public Boolean getGlobalDefault() { + return globalDefault; + } + + @JsonProperty("globalDefault") + public void setGlobalDefault(Boolean globalDefault) { + this.globalDefault = globalDefault; + } + + /** + * + * (Required) + * + */ + @JsonProperty("kind") + public String getKind() { + return kind; + } + + /** + * + * (Required) + * + */ + @JsonProperty("kind") + public void setKind(String kind) { + this.kind = kind; + } + + @JsonProperty("metadata") + public ObjectMeta getMetadata() { + return metadata; + } + + @JsonProperty("metadata") + public void setMetadata(ObjectMeta metadata) { + this.metadata = metadata; + } + + @JsonProperty("preemptionPolicy") + public String getPreemptionPolicy() { + return preemptionPolicy; + } + + @JsonProperty("preemptionPolicy") + public void setPreemptionPolicy(String preemptionPolicy) { + this.preemptionPolicy = preemptionPolicy; + } + + @JsonProperty("value") + public Integer getValue() { + return value; + } + + @JsonProperty("value") + public void setValue(Integer value) { + this.value = value; + } + + @JsonIgnore + public PriorityClassBuilder edit() { + return new PriorityClassBuilder(this); + } + + @JsonIgnore + public PriorityClassBuilder toBuilder() { + return edit(); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + + public void setAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + +} diff --git a/kubernetes-model-generator/kubernetes-model-scheduling/src/generated/java/io/fabric8/kubernetes/api/model/scheduling/v1alpha1/PriorityClassList.java b/kubernetes-model-generator/kubernetes-model-scheduling/src/generated/java/io/fabric8/kubernetes/api/model/scheduling/v1alpha1/PriorityClassList.java new file mode 100644 index 00000000000..0764a868cb2 --- /dev/null +++ b/kubernetes-model-generator/kubernetes-model-scheduling/src/generated/java/io/fabric8/kubernetes/api/model/scheduling/v1alpha1/PriorityClassList.java @@ -0,0 +1,195 @@ + +package io.fabric8.kubernetes.api.model.scheduling.v1alpha1; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import javax.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import io.fabric8.kubernetes.api.builder.Editable; +import io.fabric8.kubernetes.api.model.Container; +import io.fabric8.kubernetes.api.model.IntOrString; +import io.fabric8.kubernetes.api.model.KubernetesResource; +import io.fabric8.kubernetes.api.model.KubernetesResourceList; +import io.fabric8.kubernetes.api.model.LabelSelector; +import io.fabric8.kubernetes.api.model.ListMeta; +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.model.annotation.Group; +import io.fabric8.kubernetes.model.annotation.Version; +import io.sundr.builder.annotations.Buildable; +import io.sundr.builder.annotations.BuildableReference; +import io.sundr.transform.annotations.TemplateTransformation; +import io.sundr.transform.annotations.TemplateTransformations; +import lombok.EqualsAndHashCode; +import lombok.ToString; +import lombok.experimental.Accessors; + +@JsonDeserialize(using = com.fasterxml.jackson.databind.JsonDeserializer.None.class) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "apiVersion", + "kind", + "metadata", + "items" +}) +@ToString +@EqualsAndHashCode +@Accessors(prefix = { + "_", + "" +}) +@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, lazyCollectionInitEnabled = false, builderPackage = "io.fabric8.kubernetes.api.builder", refs = { + @BuildableReference(ObjectMeta.class), + @BuildableReference(LabelSelector.class), + @BuildableReference(Container.class), + @BuildableReference(PodTemplateSpec.class), + @BuildableReference(ResourceRequirements.class), + @BuildableReference(IntOrString.class), + @BuildableReference(ObjectReference.class), + @BuildableReference(LocalObjectReference.class), + @BuildableReference(PersistentVolumeClaim.class) +}) +@TemplateTransformations({ + @TemplateTransformation(value = "/manifest.vm", outputPath = "META-INF/services/io.fabric8.kubernetes.api.model.KubernetesResource", gather = true) +}) +@Version("v1alpha1") +@Group("scheduling.k8s.io") +@Generated("jsonschema2pojo") +public class PriorityClassList implements Editable , KubernetesResource, KubernetesResourceList +{ + + /** + * + * (Required) + * + */ + @JsonProperty("apiVersion") + private String apiVersion = "scheduling.k8s.io/v1alpha1"; + @JsonProperty("items") + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private List items = new ArrayList<>(); + /** + * + * (Required) + * + */ + @JsonProperty("kind") + private String kind = "PriorityClassList"; + @JsonProperty("metadata") + private ListMeta metadata; + @JsonIgnore + private Map additionalProperties = new LinkedHashMap(); + + /** + * No args constructor for use in serialization + * + */ + public PriorityClassList() { + } + + public PriorityClassList(String apiVersion, List items, String kind, ListMeta metadata) { + super(); + this.apiVersion = apiVersion; + this.items = items; + this.kind = kind; + this.metadata = metadata; + } + + /** + * + * (Required) + * + */ + @JsonProperty("apiVersion") + public String getApiVersion() { + return apiVersion; + } + + /** + * + * (Required) + * + */ + @JsonProperty("apiVersion") + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + @JsonProperty("items") + @JsonInclude(JsonInclude.Include.NON_EMPTY) + public List getItems() { + return items; + } + + @JsonProperty("items") + public void setItems(List items) { + this.items = items; + } + + /** + * + * (Required) + * + */ + @JsonProperty("kind") + public String getKind() { + return kind; + } + + /** + * + * (Required) + * + */ + @JsonProperty("kind") + public void setKind(String kind) { + this.kind = kind; + } + + @JsonProperty("metadata") + public ListMeta getMetadata() { + return metadata; + } + + @JsonProperty("metadata") + public void setMetadata(ListMeta metadata) { + this.metadata = metadata; + } + + @JsonIgnore + public PriorityClassListBuilder edit() { + return new PriorityClassListBuilder(this); + } + + @JsonIgnore + public PriorityClassListBuilder toBuilder() { + return edit(); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + + public void setAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + +} diff --git a/kubernetes-model-generator/kubernetes-model-scheduling/src/generated/java/io/fabric8/kubernetes/api/model/scheduling/v1beta1/PriorityClass.java b/kubernetes-model-generator/kubernetes-model-scheduling/src/generated/java/io/fabric8/kubernetes/api/model/scheduling/v1beta1/PriorityClass.java index 0e6bf99bece..818d595b66f 100644 --- a/kubernetes-model-generator/kubernetes-model-scheduling/src/generated/java/io/fabric8/kubernetes/api/model/scheduling/v1beta1/PriorityClass.java +++ b/kubernetes-model-generator/kubernetes-model-scheduling/src/generated/java/io/fabric8/kubernetes/api/model/scheduling/v1beta1/PriorityClass.java @@ -17,6 +17,7 @@ import io.fabric8.kubernetes.api.model.IntOrString; import io.fabric8.kubernetes.api.model.LabelSelector; import io.fabric8.kubernetes.api.model.LocalObjectReference; +import io.fabric8.kubernetes.api.model.ObjectMeta; import io.fabric8.kubernetes.api.model.ObjectReference; import io.fabric8.kubernetes.api.model.PersistentVolumeClaim; import io.fabric8.kubernetes.api.model.PodTemplateSpec; @@ -49,7 +50,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), @@ -87,7 +88,7 @@ public class PriorityClass implements Editable , HasMetada @JsonProperty("kind") private String kind = "PriorityClass"; @JsonProperty("metadata") - private io.fabric8.kubernetes.api.model.ObjectMeta metadata; + private ObjectMeta metadata; @JsonProperty("preemptionPolicy") private String preemptionPolicy; @JsonProperty("value") @@ -102,7 +103,7 @@ public class PriorityClass implements Editable , HasMetada public PriorityClass() { } - public PriorityClass(String apiVersion, String description, Boolean globalDefault, String kind, io.fabric8.kubernetes.api.model.ObjectMeta metadata, String preemptionPolicy, Integer value) { + public PriorityClass(String apiVersion, String description, Boolean globalDefault, String kind, ObjectMeta metadata, String preemptionPolicy, Integer value) { super(); this.apiVersion = apiVersion; this.description = description; @@ -174,12 +175,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; }