diff --git a/junit/kube-api-test/core/pom.xml b/junit/kube-api-test/core/pom.xml
index 6c196be4f8f..6bac5fe7f75 100644
--- a/junit/kube-api-test/core/pom.xml
+++ b/junit/kube-api-test/core/pom.xml
@@ -102,10 +102,6 @@
bcprov-jdk18on
compile
-
- io.javaoperatorsdk
- kubernetes-webhooks-framework-core
-
com.fasterxml.jackson.dataformat
jackson-dataformat-yaml
diff --git a/junit/kube-api-test/core/src/test/java/io/fabric8/kubeapitest/sample/KubernetesMutationHookHandlingTest.java b/junit/kube-api-test/core/src/test/java/io/fabric8/kubeapitest/sample/KubernetesMutationHookHandlingTest.java
index 29f5819ad20..e68456eac24 100644
--- a/junit/kube-api-test/core/src/test/java/io/fabric8/kubeapitest/sample/KubernetesMutationHookHandlingTest.java
+++ b/junit/kube-api-test/core/src/test/java/io/fabric8/kubeapitest/sample/KubernetesMutationHookHandlingTest.java
@@ -18,14 +18,17 @@
import io.fabric8.kubeapitest.cert.CertManager;
import io.fabric8.kubeapitest.junit.EnableKubeAPIServer;
import io.fabric8.kubeapitest.junit.KubeConfig;
+import io.fabric8.kubernetes.api.model.HasMetadata;
+import io.fabric8.kubernetes.api.model.admission.v1.AdmissionRequest;
import io.fabric8.kubernetes.api.model.admission.v1.AdmissionReview;
+import io.fabric8.kubernetes.api.model.admission.v1.AdmissionReviewBuilder;
import io.fabric8.kubernetes.api.model.admissionregistration.v1.MutatingWebhookConfiguration;
import io.fabric8.kubernetes.api.model.networking.v1.*;
import io.fabric8.kubernetes.client.Config;
import io.fabric8.kubernetes.client.KubernetesClient;
import io.fabric8.kubernetes.client.KubernetesClientBuilder;
import io.fabric8.kubernetes.client.utils.Serialization;
-import io.javaoperatorsdk.webhook.admission.AdmissionController;
+import io.fabric8.zjsonpatch.JsonDiff;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.bouncycastle.asn1.x509.GeneralName;
@@ -57,7 +60,8 @@
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.Base64;
-import java.util.HashMap;
+import java.util.Collections;
+import java.util.Objects;
import static org.assertj.core.api.Assertions.assertThat;
@@ -76,23 +80,11 @@ class KubernetesMutationHookHandlingTest {
private static final Logger log = LoggerFactory.getLogger(KubernetesMutationHookHandlingTest.class);
public static final String PASSWORD = "secret";
- public static final String TEST_LABEL_KEY = "test-label";
- public static final String TEST_LABEL_VALUE = "mutation-test";
static File certFile = new File("target", "mutation.crt");
// server that handles mutation hooks
static Server server = new Server();
- // using https://github.com/java-operator-sdk/kubernetes-webooks-framework framework to implement
- // the response
- static AdmissionController mutationController = new AdmissionController<>((resource, operation) -> {
- if (resource.getMetadata().getLabels() == null) {
- resource.getMetadata().setLabels(new HashMap<>());
- }
- resource.getMetadata().getLabels().putIfAbsent(TEST_LABEL_KEY, TEST_LABEL_VALUE);
- return resource;
- });
-
@Test
void handleMutatingWebhook() {
var client = new KubernetesClientBuilder().withConfig(Config.fromKubeconfig(kubeConfig)).build();
@@ -100,7 +92,7 @@ void handleMutatingWebhook() {
var ingress = client.resource(testIngress()).create();
- assertThat(ingress.getMetadata().getLabels()).containsEntry(TEST_LABEL_KEY, TEST_LABEL_VALUE);
+ assertThat(ingress.getMetadata().getLabels()).containsEntry("test", "mutation");
}
@BeforeAll
@@ -112,15 +104,33 @@ public void handle(String s, Request request, HttpServletRequest httpServletRequ
HttpServletResponse httpServletResponse) {
try {
request.setHandled(true);
- AdmissionReview admissionReview = Serialization.unmarshal(httpServletRequest.getInputStream());
-
- var response = mutationController.handle(admissionReview);
-
- var out = httpServletResponse.getWriter();
- httpServletResponse.setContentType("application/json");
- httpServletResponse.setCharacterEncoding(StandardCharsets.UTF_8.toString());
- httpServletResponse.setStatus(HttpServletResponse.SC_OK);
- out.println(Serialization.asJson(response));
+ final AdmissionReview requestedAdmissionReview = Serialization.unmarshal(httpServletRequest.getInputStream());
+ final AdmissionRequest admissionRequest = requestedAdmissionReview.getRequest();
+ var originalResource = Objects.equals("DELETE", admissionRequest.getOperation())
+ ? admissionRequest.getOldObject()
+ : admissionRequest.getObject();
+ if (originalResource instanceof HasMetadata) {
+ var originalResourceJson = Serialization.jsonMapper().valueToTree(originalResource);
+ (((HasMetadata) originalResource)).getMetadata().setLabels(Collections.singletonMap("test", "mutation"));
+ var editedResourceJson = Serialization.jsonMapper().valueToTree(originalResource);
+ final AdmissionReview responseAdmissionReview = new AdmissionReviewBuilder()
+ .withNewResponse()
+ .withAllowed()
+ .withPatchType("JSONPatch")
+ .withPatch(Base64.getEncoder().encodeToString(
+ JsonDiff.asJson(originalResourceJson, editedResourceJson).toString().getBytes(StandardCharsets.UTF_8)))
+ .withUid(admissionRequest.getUid())
+ .endResponse()
+ .build();
+
+ var out = httpServletResponse.getWriter();
+ httpServletResponse.setContentType("application/json");
+ httpServletResponse.setCharacterEncoding(StandardCharsets.UTF_8.toString());
+ httpServletResponse.setStatus(HttpServletResponse.SC_OK);
+ out.println(Serialization.asJson(responseAdmissionReview));
+ } else {
+ httpServletResponse.setStatus(422);
+ }
} catch (Exception e) {
log.error("Error in webhook", e);
throw new RuntimeException(e);
diff --git a/kubernetes-model-generator/kubernetes-model-admissionregistration/src/generated/java/io/fabric8/kubernetes/api/model/admission/v1/AdmissionRequest.java b/kubernetes-model-generator/kubernetes-model-admissionregistration/src/generated/java/io/fabric8/kubernetes/api/model/admission/v1/AdmissionRequest.java
new file mode 100644
index 00000000000..8bb46d85c75
--- /dev/null
+++ b/kubernetes-model-generator/kubernetes-model-admissionregistration/src/generated/java/io/fabric8/kubernetes/api/model/admission/v1/AdmissionRequest.java
@@ -0,0 +1,313 @@
+
+package io.fabric8.kubernetes.api.model.admission.v1;
+
+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.GroupVersionKind;
+import io.fabric8.kubernetes.api.model.GroupVersionResource;
+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.authentication.UserInfo;
+import io.sundr.builder.annotations.Buildable;
+import io.sundr.builder.annotations.BuildableReference;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+
+@JsonDeserialize(using = com.fasterxml.jackson.databind.JsonDeserializer.None.class)
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({
+ "kind",
+ "dryRun",
+ "name",
+ "namespace",
+ "object",
+ "oldObject",
+ "operation",
+ "options",
+ "requestKind",
+ "requestResource",
+ "requestSubResource",
+ "resource",
+ "subResource",
+ "uid",
+ "userInfo"
+})
+@ToString
+@EqualsAndHashCode
+@Accessors(prefix = {
+ "_",
+ ""
+})
+@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, lazyCollectionInitEnabled = false, builderPackage = "io.fabric8.kubernetes.api.builder", refs = {
+ @BuildableReference(ObjectMeta.class),
+ @BuildableReference(LabelSelector.class),
+ @BuildableReference(Container.class),
+ @BuildableReference(PodTemplateSpec.class),
+ @BuildableReference(ResourceRequirements.class),
+ @BuildableReference(IntOrString.class),
+ @BuildableReference(ObjectReference.class),
+ @BuildableReference(LocalObjectReference.class),
+ @BuildableReference(PersistentVolumeClaim.class)
+})
+@Generated("jsonschema2pojo")
+public class AdmissionRequest implements Editable , KubernetesResource
+{
+
+ @JsonProperty("dryRun")
+ private Boolean dryRun;
+ @JsonProperty("kind")
+ private GroupVersionKind kind;
+ @JsonProperty("name")
+ private String name;
+ @JsonProperty("namespace")
+ private String namespace;
+ @JsonProperty("object")
+ @JsonDeserialize(using = io.fabric8.kubernetes.internal.KubernetesDeserializer.class)
+ private Object object;
+ @JsonProperty("oldObject")
+ @JsonDeserialize(using = io.fabric8.kubernetes.internal.KubernetesDeserializer.class)
+ private Object oldObject;
+ @JsonProperty("operation")
+ private String operation;
+ @JsonProperty("options")
+ @JsonDeserialize(using = io.fabric8.kubernetes.internal.KubernetesDeserializer.class)
+ private Object options;
+ @JsonProperty("requestKind")
+ private GroupVersionKind requestKind;
+ @JsonProperty("requestResource")
+ private GroupVersionResource requestResource;
+ @JsonProperty("requestSubResource")
+ private String requestSubResource;
+ @JsonProperty("resource")
+ private GroupVersionResource resource;
+ @JsonProperty("subResource")
+ private String subResource;
+ @JsonProperty("uid")
+ private String uid;
+ @JsonProperty("userInfo")
+ private UserInfo userInfo;
+ @JsonIgnore
+ private Map additionalProperties = new LinkedHashMap();
+
+ /**
+ * No args constructor for use in serialization
+ *
+ */
+ public AdmissionRequest() {
+ }
+
+ public AdmissionRequest(Boolean dryRun, GroupVersionKind kind, String name, String namespace, Object object, Object oldObject, String operation, Object options, GroupVersionKind requestKind, GroupVersionResource requestResource, String requestSubResource, GroupVersionResource resource, String subResource, String uid, UserInfo userInfo) {
+ super();
+ this.dryRun = dryRun;
+ this.kind = kind;
+ this.name = name;
+ this.namespace = namespace;
+ this.object = object;
+ this.oldObject = oldObject;
+ this.operation = operation;
+ this.options = options;
+ this.requestKind = requestKind;
+ this.requestResource = requestResource;
+ this.requestSubResource = requestSubResource;
+ this.resource = resource;
+ this.subResource = subResource;
+ this.uid = uid;
+ this.userInfo = userInfo;
+ }
+
+ @JsonProperty("dryRun")
+ public Boolean getDryRun() {
+ return dryRun;
+ }
+
+ @JsonProperty("dryRun")
+ public void setDryRun(Boolean dryRun) {
+ this.dryRun = dryRun;
+ }
+
+ @JsonProperty("kind")
+ public GroupVersionKind getKind() {
+ return kind;
+ }
+
+ @JsonProperty("kind")
+ public void setKind(GroupVersionKind kind) {
+ this.kind = kind;
+ }
+
+ @JsonProperty("name")
+ public String getName() {
+ return name;
+ }
+
+ @JsonProperty("name")
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @JsonProperty("namespace")
+ public String getNamespace() {
+ return namespace;
+ }
+
+ @JsonProperty("namespace")
+ public void setNamespace(String namespace) {
+ this.namespace = namespace;
+ }
+
+ @JsonProperty("object")
+ public Object getObject() {
+ return object;
+ }
+
+ @JsonProperty("object")
+ @JsonDeserialize(using = io.fabric8.kubernetes.internal.KubernetesDeserializer.class)
+ public void setObject(Object object) {
+ this.object = object;
+ }
+
+ @JsonProperty("oldObject")
+ public Object getOldObject() {
+ return oldObject;
+ }
+
+ @JsonProperty("oldObject")
+ @JsonDeserialize(using = io.fabric8.kubernetes.internal.KubernetesDeserializer.class)
+ public void setOldObject(Object oldObject) {
+ this.oldObject = oldObject;
+ }
+
+ @JsonProperty("operation")
+ public String getOperation() {
+ return operation;
+ }
+
+ @JsonProperty("operation")
+ public void setOperation(String operation) {
+ this.operation = operation;
+ }
+
+ @JsonProperty("options")
+ public Object getOptions() {
+ return options;
+ }
+
+ @JsonProperty("options")
+ @JsonDeserialize(using = io.fabric8.kubernetes.internal.KubernetesDeserializer.class)
+ public void setOptions(Object options) {
+ this.options = options;
+ }
+
+ @JsonProperty("requestKind")
+ public GroupVersionKind getRequestKind() {
+ return requestKind;
+ }
+
+ @JsonProperty("requestKind")
+ public void setRequestKind(GroupVersionKind requestKind) {
+ this.requestKind = requestKind;
+ }
+
+ @JsonProperty("requestResource")
+ public GroupVersionResource getRequestResource() {
+ return requestResource;
+ }
+
+ @JsonProperty("requestResource")
+ public void setRequestResource(GroupVersionResource requestResource) {
+ this.requestResource = requestResource;
+ }
+
+ @JsonProperty("requestSubResource")
+ public String getRequestSubResource() {
+ return requestSubResource;
+ }
+
+ @JsonProperty("requestSubResource")
+ public void setRequestSubResource(String requestSubResource) {
+ this.requestSubResource = requestSubResource;
+ }
+
+ @JsonProperty("resource")
+ public GroupVersionResource getResource() {
+ return resource;
+ }
+
+ @JsonProperty("resource")
+ public void setResource(GroupVersionResource resource) {
+ this.resource = resource;
+ }
+
+ @JsonProperty("subResource")
+ public String getSubResource() {
+ return subResource;
+ }
+
+ @JsonProperty("subResource")
+ public void setSubResource(String subResource) {
+ this.subResource = subResource;
+ }
+
+ @JsonProperty("uid")
+ public String getUid() {
+ return uid;
+ }
+
+ @JsonProperty("uid")
+ public void setUid(String uid) {
+ this.uid = uid;
+ }
+
+ @JsonProperty("userInfo")
+ public UserInfo getUserInfo() {
+ return userInfo;
+ }
+
+ @JsonProperty("userInfo")
+ public void setUserInfo(UserInfo userInfo) {
+ this.userInfo = userInfo;
+ }
+
+ @JsonIgnore
+ public AdmissionRequestBuilder edit() {
+ return new AdmissionRequestBuilder(this);
+ }
+
+ @JsonIgnore
+ public AdmissionRequestBuilder 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-admissionregistration/src/generated/java/io/fabric8/kubernetes/api/model/admission/v1beta1/AdmissionRequest.java b/kubernetes-model-generator/kubernetes-model-admissionregistration/src/generated/java/io/fabric8/kubernetes/api/model/admission/v1beta1/AdmissionRequest.java
new file mode 100644
index 00000000000..c8a47a85fcc
--- /dev/null
+++ b/kubernetes-model-generator/kubernetes-model-admissionregistration/src/generated/java/io/fabric8/kubernetes/api/model/admission/v1beta1/AdmissionRequest.java
@@ -0,0 +1,313 @@
+
+package io.fabric8.kubernetes.api.model.admission.v1beta1;
+
+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.GroupVersionKind;
+import io.fabric8.kubernetes.api.model.GroupVersionResource;
+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.authentication.UserInfo;
+import io.sundr.builder.annotations.Buildable;
+import io.sundr.builder.annotations.BuildableReference;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+
+@JsonDeserialize(using = com.fasterxml.jackson.databind.JsonDeserializer.None.class)
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({
+ "kind",
+ "dryRun",
+ "name",
+ "namespace",
+ "object",
+ "oldObject",
+ "operation",
+ "options",
+ "requestKind",
+ "requestResource",
+ "requestSubResource",
+ "resource",
+ "subResource",
+ "uid",
+ "userInfo"
+})
+@ToString
+@EqualsAndHashCode
+@Accessors(prefix = {
+ "_",
+ ""
+})
+@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, lazyCollectionInitEnabled = false, builderPackage = "io.fabric8.kubernetes.api.builder", refs = {
+ @BuildableReference(ObjectMeta.class),
+ @BuildableReference(LabelSelector.class),
+ @BuildableReference(Container.class),
+ @BuildableReference(PodTemplateSpec.class),
+ @BuildableReference(ResourceRequirements.class),
+ @BuildableReference(IntOrString.class),
+ @BuildableReference(ObjectReference.class),
+ @BuildableReference(LocalObjectReference.class),
+ @BuildableReference(PersistentVolumeClaim.class)
+})
+@Generated("jsonschema2pojo")
+public class AdmissionRequest implements Editable , KubernetesResource
+{
+
+ @JsonProperty("dryRun")
+ private Boolean dryRun;
+ @JsonProperty("kind")
+ private GroupVersionKind kind;
+ @JsonProperty("name")
+ private String name;
+ @JsonProperty("namespace")
+ private String namespace;
+ @JsonProperty("object")
+ @JsonDeserialize(using = io.fabric8.kubernetes.internal.KubernetesDeserializer.class)
+ private Object object;
+ @JsonProperty("oldObject")
+ @JsonDeserialize(using = io.fabric8.kubernetes.internal.KubernetesDeserializer.class)
+ private Object oldObject;
+ @JsonProperty("operation")
+ private String operation;
+ @JsonProperty("options")
+ @JsonDeserialize(using = io.fabric8.kubernetes.internal.KubernetesDeserializer.class)
+ private Object options;
+ @JsonProperty("requestKind")
+ private GroupVersionKind requestKind;
+ @JsonProperty("requestResource")
+ private GroupVersionResource requestResource;
+ @JsonProperty("requestSubResource")
+ private String requestSubResource;
+ @JsonProperty("resource")
+ private GroupVersionResource resource;
+ @JsonProperty("subResource")
+ private String subResource;
+ @JsonProperty("uid")
+ private String uid;
+ @JsonProperty("userInfo")
+ private UserInfo userInfo;
+ @JsonIgnore
+ private Map additionalProperties = new LinkedHashMap();
+
+ /**
+ * No args constructor for use in serialization
+ *
+ */
+ public AdmissionRequest() {
+ }
+
+ public AdmissionRequest(Boolean dryRun, GroupVersionKind kind, String name, String namespace, Object object, Object oldObject, String operation, Object options, GroupVersionKind requestKind, GroupVersionResource requestResource, String requestSubResource, GroupVersionResource resource, String subResource, String uid, UserInfo userInfo) {
+ super();
+ this.dryRun = dryRun;
+ this.kind = kind;
+ this.name = name;
+ this.namespace = namespace;
+ this.object = object;
+ this.oldObject = oldObject;
+ this.operation = operation;
+ this.options = options;
+ this.requestKind = requestKind;
+ this.requestResource = requestResource;
+ this.requestSubResource = requestSubResource;
+ this.resource = resource;
+ this.subResource = subResource;
+ this.uid = uid;
+ this.userInfo = userInfo;
+ }
+
+ @JsonProperty("dryRun")
+ public Boolean getDryRun() {
+ return dryRun;
+ }
+
+ @JsonProperty("dryRun")
+ public void setDryRun(Boolean dryRun) {
+ this.dryRun = dryRun;
+ }
+
+ @JsonProperty("kind")
+ public GroupVersionKind getKind() {
+ return kind;
+ }
+
+ @JsonProperty("kind")
+ public void setKind(GroupVersionKind kind) {
+ this.kind = kind;
+ }
+
+ @JsonProperty("name")
+ public String getName() {
+ return name;
+ }
+
+ @JsonProperty("name")
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @JsonProperty("namespace")
+ public String getNamespace() {
+ return namespace;
+ }
+
+ @JsonProperty("namespace")
+ public void setNamespace(String namespace) {
+ this.namespace = namespace;
+ }
+
+ @JsonProperty("object")
+ public Object getObject() {
+ return object;
+ }
+
+ @JsonProperty("object")
+ @JsonDeserialize(using = io.fabric8.kubernetes.internal.KubernetesDeserializer.class)
+ public void setObject(Object object) {
+ this.object = object;
+ }
+
+ @JsonProperty("oldObject")
+ public Object getOldObject() {
+ return oldObject;
+ }
+
+ @JsonProperty("oldObject")
+ @JsonDeserialize(using = io.fabric8.kubernetes.internal.KubernetesDeserializer.class)
+ public void setOldObject(Object oldObject) {
+ this.oldObject = oldObject;
+ }
+
+ @JsonProperty("operation")
+ public String getOperation() {
+ return operation;
+ }
+
+ @JsonProperty("operation")
+ public void setOperation(String operation) {
+ this.operation = operation;
+ }
+
+ @JsonProperty("options")
+ public Object getOptions() {
+ return options;
+ }
+
+ @JsonProperty("options")
+ @JsonDeserialize(using = io.fabric8.kubernetes.internal.KubernetesDeserializer.class)
+ public void setOptions(Object options) {
+ this.options = options;
+ }
+
+ @JsonProperty("requestKind")
+ public GroupVersionKind getRequestKind() {
+ return requestKind;
+ }
+
+ @JsonProperty("requestKind")
+ public void setRequestKind(GroupVersionKind requestKind) {
+ this.requestKind = requestKind;
+ }
+
+ @JsonProperty("requestResource")
+ public GroupVersionResource getRequestResource() {
+ return requestResource;
+ }
+
+ @JsonProperty("requestResource")
+ public void setRequestResource(GroupVersionResource requestResource) {
+ this.requestResource = requestResource;
+ }
+
+ @JsonProperty("requestSubResource")
+ public String getRequestSubResource() {
+ return requestSubResource;
+ }
+
+ @JsonProperty("requestSubResource")
+ public void setRequestSubResource(String requestSubResource) {
+ this.requestSubResource = requestSubResource;
+ }
+
+ @JsonProperty("resource")
+ public GroupVersionResource getResource() {
+ return resource;
+ }
+
+ @JsonProperty("resource")
+ public void setResource(GroupVersionResource resource) {
+ this.resource = resource;
+ }
+
+ @JsonProperty("subResource")
+ public String getSubResource() {
+ return subResource;
+ }
+
+ @JsonProperty("subResource")
+ public void setSubResource(String subResource) {
+ this.subResource = subResource;
+ }
+
+ @JsonProperty("uid")
+ public String getUid() {
+ return uid;
+ }
+
+ @JsonProperty("uid")
+ public void setUid(String uid) {
+ this.uid = uid;
+ }
+
+ @JsonProperty("userInfo")
+ public UserInfo getUserInfo() {
+ return userInfo;
+ }
+
+ @JsonProperty("userInfo")
+ public void setUserInfo(UserInfo userInfo) {
+ this.userInfo = userInfo;
+ }
+
+ @JsonIgnore
+ public AdmissionRequestBuilder edit() {
+ return new AdmissionRequestBuilder(this);
+ }
+
+ @JsonIgnore
+ public AdmissionRequestBuilder 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-admissionregistration/src/main/java/io/fabric8/kubernetes/api/model/admission/v1/AdmissionRequest.java b/kubernetes-model-generator/kubernetes-model-admissionregistration/src/main/java/io/fabric8/kubernetes/api/model/admission/v1/AdmissionRequest.java
deleted file mode 100644
index f4c8a5962fc..00000000000
--- a/kubernetes-model-generator/kubernetes-model-admissionregistration/src/main/java/io/fabric8/kubernetes/api/model/admission/v1/AdmissionRequest.java
+++ /dev/null
@@ -1,497 +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 io.fabric8.kubernetes.api.model.admission.v1;
-
-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.databind.annotation.JsonDeserialize;
-import io.fabric8.kubernetes.api.model.GroupVersionKind;
-import io.fabric8.kubernetes.api.model.GroupVersionResource;
-import io.fabric8.kubernetes.api.model.KubernetesResource;
-import io.fabric8.kubernetes.api.model.authentication.UserInfo;
-import lombok.EqualsAndHashCode;
-import lombok.ToString;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * AdmissionRequest describes the admission.Attributes for the admission request.
- *
- * This POJO is derived from https://github.com/kubernetes/api/blob/master/admission/v1beta1/types.go
- */
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonDeserialize
-@ToString
-@EqualsAndHashCode
-public class AdmissionRequest implements KubernetesResource {
-
- /*
- * DryRun indicates that modifications will definitely not be persisted for this request.
- * Defaults to false.
- */
- @JsonProperty("dryRun")
- private Boolean dryRun;
-
- /*
- * Kind is fully-qualified resource being requested (for example, v1.Pods)
- */
- @JsonProperty("kind")
- private GroupVersionKind kind;
-
- /*
- * Name is the name of the object as presented in the request. On a CREATE operation, the client may omit name and
- * rely on the server to generate the name. If that is the case, this field will contain an empty string.
- */
- @JsonProperty("name")
- private String name;
-
- /*
- * Namespace is the namespace associated with the request (if any).
- */
- @JsonProperty("namespace")
- private String namespace;
-
- /*
- * Object is the object from the incoming request.
- */
- @JsonProperty("object")
- private KubernetesResource object;
-
- /*
- * OldObject is the existing object. Only populated for DELETE and UPDATE requests.
- */
- @JsonProperty("oldObject")
- private KubernetesResource oldObject;
-
- /*
- * Operation is the operation being performed. This may be different than the operation
- * requested. e.g. a patch can result in either a CREATE or UPDATE Operation.
- */
- @JsonProperty("operation")
- private String operation;
-
- @JsonProperty("options")
- private KubernetesResource options;
-
- /*
- * RequestResource is the fully-qualified resource of the original API request (for example, v1.pods).
- * If this is specified and differs from the value in "resource", an equivalent match and conversion was performed.
- *
- * For example, if deployments can be modified via apps/v1 and apps/v1beta1, and a webhook registered a rule of
- * `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]` and `matchPolicy: Equivalent`,
- * an API request to apps/v1beta1 deployments would be converted and sent to the webhook
- * with `resource: {group:"apps", version:"v1", resource:"deployments"}` (matching the resource the webhook registered for),
- * and `requestResource: {group:"apps", version:"v1beta1", resource:"deployments"}` (indicating the resource of the original
- * API request).
- */
- @JsonProperty("requestKind")
- private GroupVersionKind requestKind;
-
- /*
- * RequestResource is the fully-qualified resource of the original API request (for example, v1.pods).
- * If this is specified and differs from the value in "resource", an equivalent match and conversion was performed.
- *
- * For example, if deployments can be modified via apps/v1 and apps/v1beta1, and a webhook registered a rule of
- * `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]` and `matchPolicy: Equivalent`,
- * an API request to apps/v1beta1 deployments would be converted and sent to the webhook
- * with `resource: {group:"apps", version:"v1", resource:"deployments"}` (matching the resource the webhook registered for),
- * and `requestResource: {group:"apps", version:"v1beta1", resource:"deployments"}` (indicating the resource of the original
- * API request).
- *
- * See documentation for the "matchPolicy" field in the webhook configuration type.
- */
- @JsonProperty("requestResource")
- private GroupVersionResource requestResource;
-
- /*
- * RequestSubResource is the name of the subresource of the original API request, if any (for example, "status" or "scale")
- * If this is specified and differs from the value in "subResource", an equivalent match and conversion was performed.
- * See documentation for the "matchPolicy" field in the webhook configuration type.
- */
- @JsonProperty("requestSubResource")
- private String requestSubResource;
-
- /*
- * Resource is the fully-qualified resource being requested (for example, v1.pods)
- */
- @JsonProperty("resource")
- private GroupVersionResource resource;
-
- /*
- * SubResource is the subresource being requested (for example, "status" or "scale")
- */
- @JsonProperty("subResource")
- private String subResource;
-
- /*
- * UID is identifier for individual request/response. It allows us to distinguish instances of
- * requests which otherwise identical (parallel requests, requests when earlier requests did not
- * modify etc). The UID is meant to track the round trip (request/response) between KAS and
- * the WebHook, not the user request.
- * It is suitable for correlating log entries between the webhook and apiserver, for either
- * auditing or debugging.
- */
- @JsonProperty("uid")
- private String uid;
-
- /*
- * UserInfo is information about the requesting user
- */
- @JsonProperty("userInfo")
- private UserInfo userInfo;
-
- @JsonIgnore
- private Map additionalProperties = new HashMap<>();
-
- public AdmissionRequest() {
- }
-
- public AdmissionRequest(Boolean dryRun, GroupVersionKind kind, String name, String namespace, KubernetesResource object,
- KubernetesResource oldObject, String operation, KubernetesResource options, GroupVersionKind requestKind,
- GroupVersionResource requestResource, String requestSubResource, GroupVersionResource resource, String subResource,
- String uid, UserInfo userInfo) {
- this.dryRun = dryRun;
- this.kind = kind;
- this.name = name;
- this.namespace = namespace;
- this.object = object;
- this.oldObject = oldObject;
- this.operation = operation;
- this.options = options;
- this.requestKind = requestKind;
- this.requestResource = requestResource;
- this.requestSubResource = requestSubResource;
- this.resource = resource;
- this.subResource = subResource;
- this.uid = uid;
- this.userInfo = userInfo;
- }
-
- /**
- * Get Dry Run
- *
- * @return The dryRun
- */
- @JsonProperty("dryRun")
- public Boolean getDryRun() {
- return dryRun;
- }
-
- /**
- * Set Dry run
- *
- * @param dryRun The dryRun
- */
- @JsonProperty("dryRun")
- public void setDryRun(Boolean dryRun) {
- this.dryRun = dryRun;
- }
-
- /**
- * Get Kind
- *
- * @return The kind
- */
- @JsonProperty("kind")
- public GroupVersionKind getKind() {
- return kind;
- }
-
- /**
- * Set Kind
- *
- * @param kind The kind
- */
- @JsonProperty("kind")
- public void setKind(GroupVersionKind kind) {
- this.kind = kind;
- }
-
- /**
- * Get Name
- *
- * @return The name
- */
- @JsonProperty("name")
- public String getName() {
- return name;
- }
-
- /**
- * Set Name
- *
- * @param name The name
- */
- @JsonProperty("name")
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * Get Namespace
- *
- * @return The namespace
- */
- @JsonProperty("namespace")
- public String getNamespace() {
- return namespace;
- }
-
- /**
- * Set Namespace
- *
- * @param namespace The namespace
- */
- @JsonProperty("namespace")
- public void setNamespace(String namespace) {
- this.namespace = namespace;
- }
-
- /**
- * Get Object
- *
- * @return The object
- */
- @JsonProperty("object")
- public KubernetesResource getObject() {
- return object;
- }
-
- /**
- * Set Object
- *
- * @param object The object
- */
- @JsonProperty("object")
- public void setObject(KubernetesResource object) {
- this.object = object;
- }
-
- /**
- * Get old object.
- *
- * @return The oldObject
- */
- @JsonProperty("oldObject")
- public KubernetesResource getOldObject() {
- return oldObject;
- }
-
- /**
- * Set old object.
- *
- * @param oldObject The oldObject
- */
- @JsonProperty("oldObject")
- public void setOldObject(KubernetesResource oldObject) {
- this.oldObject = oldObject;
- }
-
- /**
- * Get operation.
- *
- * @return The operation
- */
- @JsonProperty("operation")
- public String getOperation() {
- return operation;
- }
-
- /**
- * Set operation.
- *
- * @param operation The operation
- */
- @JsonProperty("operation")
- public void setOperation(String operation) {
- this.operation = operation;
- }
-
- /**
- * Get options.
- *
- * @return The options
- */
- @JsonProperty("options")
- public KubernetesResource getOptions() {
- return options;
- }
-
- /**
- * Set options.
- *
- * @param options The options
- */
- @JsonProperty("options")
- public void setOptions(KubernetesResource options) {
- this.options = options;
- }
-
- /**
- * Get Request Kind.
- *
- * @return The requestKind
- */
- @JsonProperty("requestKind")
- public GroupVersionKind getRequestKind() {
- return requestKind;
- }
-
- /**
- * Set RequestKind
- *
- * @param requestKind The requestKind
- */
- @JsonProperty("requestKind")
- public void setRequestKind(GroupVersionKind requestKind) {
- this.requestKind = requestKind;
- }
-
- /**
- * Get RequestResource
- *
- * @return The requestResource
- */
- @JsonProperty("requestResource")
- public GroupVersionResource getRequestResource() {
- return requestResource;
- }
-
- /**
- * Set RequestResource
- *
- * @param requestResource The requestResource
- */
- @JsonProperty("requestResource")
- public void setRequestResource(GroupVersionResource requestResource) {
- this.requestResource = requestResource;
- }
-
- /**
- * Get RequestSubResource
- *
- * @return The requestSubResource
- */
- @JsonProperty("requestSubResource")
- public String getRequestSubResource() {
- return requestSubResource;
- }
-
- /**
- * Set RequestSubResource
- *
- * @param requestSubResource The requestSubResource
- */
- @JsonProperty("requestSubResource")
- public void setRequestSubResource(String requestSubResource) {
- this.requestSubResource = requestSubResource;
- }
-
- /**
- * Get Resource
- *
- * @return The resource
- */
- @JsonProperty("resource")
- public GroupVersionResource getResource() {
- return resource;
- }
-
- /**
- * Set Resource.
- *
- * @param resource The resource
- */
- @JsonProperty("resource")
- public void setResource(GroupVersionResource resource) {
- this.resource = resource;
- }
-
- /**
- * Get SubResource
- *
- * @return The subResource
- */
- @JsonProperty("subResource")
- public String getSubResource() {
- return subResource;
- }
-
- /**
- * Set SubResource
- *
- * @param subResource The subResource
- */
- @JsonProperty("subResource")
- public void setSubResource(String subResource) {
- this.subResource = subResource;
- }
-
- /**
- * Get Uid
- *
- * @return The uid
- */
- @JsonProperty("uid")
- public String getUid() {
- return uid;
- }
-
- /**
- * Set Uid
- *
- * @param uid The uid
- */
- @JsonProperty("uid")
- public void setUid(String uid) {
- this.uid = uid;
- }
-
- /**
- * Get UserInfo
- *
- * @return The userInfo
- */
- @JsonProperty("userInfo")
- public UserInfo getUserInfo() {
- return userInfo;
- }
-
- /**
- * Set UserInfo
- *
- * @param userInfo The userInfo
- */
- @JsonProperty("userInfo")
- public void setUserInfo(UserInfo userInfo) {
- this.userInfo = userInfo;
- }
-
- @JsonAnyGetter
- public Map getAdditionalProperties() {
- return this.additionalProperties;
- }
-
- @JsonAnySetter
- public void setAdditionalProperty(String name, Object value) {
- this.additionalProperties.put(name, value);
- }
-
-}
diff --git a/kubernetes-model-generator/kubernetes-model-admissionregistration/src/main/java/io/fabric8/kubernetes/api/model/admission/v1beta1/AdmissionRequest.java b/kubernetes-model-generator/kubernetes-model-admissionregistration/src/main/java/io/fabric8/kubernetes/api/model/admission/v1beta1/AdmissionRequest.java
deleted file mode 100644
index 6ce8b4d99aa..00000000000
--- a/kubernetes-model-generator/kubernetes-model-admissionregistration/src/main/java/io/fabric8/kubernetes/api/model/admission/v1beta1/AdmissionRequest.java
+++ /dev/null
@@ -1,497 +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 io.fabric8.kubernetes.api.model.admission.v1beta1;
-
-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.databind.annotation.JsonDeserialize;
-import io.fabric8.kubernetes.api.model.GroupVersionKind;
-import io.fabric8.kubernetes.api.model.GroupVersionResource;
-import io.fabric8.kubernetes.api.model.KubernetesResource;
-import io.fabric8.kubernetes.api.model.authentication.UserInfo;
-import lombok.EqualsAndHashCode;
-import lombok.ToString;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * AdmissionRequest describes the admission.Attributes for the admission request.
- *
- * This POJO is derived from https://github.com/kubernetes/api/blob/master/admission/v1beta1/types.go
- */
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonDeserialize
-@ToString
-@EqualsAndHashCode
-public class AdmissionRequest implements KubernetesResource {
-
- /*
- * DryRun indicates that modifications will definitely not be persisted for this request.
- * Defaults to false.
- */
- @JsonProperty("dryRun")
- private Boolean dryRun;
-
- /*
- * Kind is fully-qualified resource being requested (for example, v1.Pods)
- */
- @JsonProperty("kind")
- private GroupVersionKind kind;
-
- /*
- * Name is the name of the object as presented in the request. On a CREATE operation, the client may omit name and
- * rely on the server to generate the name. If that is the case, this field will contain an empty string.
- */
- @JsonProperty("name")
- private String name;
-
- /*
- * Namespace is the namespace associated with the request (if any).
- */
- @JsonProperty("namespace")
- private String namespace;
-
- /*
- * Object is the object from the incoming request.
- */
- @JsonProperty("object")
- private KubernetesResource object;
-
- /*
- * OldObject is the existing object. Only populated for DELETE and UPDATE requests.
- */
- @JsonProperty("oldObject")
- private KubernetesResource oldObject;
-
- /*
- * Operation is the operation being performed. This may be different than the operation
- * requested. e.g. a patch can result in either a CREATE or UPDATE Operation.
- */
- @JsonProperty("operation")
- private String operation;
-
- @JsonProperty("options")
- private KubernetesResource options;
-
- /*
- * RequestResource is the fully-qualified resource of the original API request (for example, v1.pods).
- * If this is specified and differs from the value in "resource", an equivalent match and conversion was performed.
- *
- * For example, if deployments can be modified via apps/v1 and apps/v1beta1, and a webhook registered a rule of
- * `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]` and `matchPolicy: Equivalent`,
- * an API request to apps/v1beta1 deployments would be converted and sent to the webhook
- * with `resource: {group:"apps", version:"v1", resource:"deployments"}` (matching the resource the webhook registered for),
- * and `requestResource: {group:"apps", version:"v1beta1", resource:"deployments"}` (indicating the resource of the original
- * API request).
- */
- @JsonProperty("requestKind")
- private GroupVersionKind requestKind;
-
- /*
- * RequestResource is the fully-qualified resource of the original API request (for example, v1.pods).
- * If this is specified and differs from the value in "resource", an equivalent match and conversion was performed.
- *
- * For example, if deployments can be modified via apps/v1 and apps/v1beta1, and a webhook registered a rule of
- * `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]` and `matchPolicy: Equivalent`,
- * an API request to apps/v1beta1 deployments would be converted and sent to the webhook
- * with `resource: {group:"apps", version:"v1", resource:"deployments"}` (matching the resource the webhook registered for),
- * and `requestResource: {group:"apps", version:"v1beta1", resource:"deployments"}` (indicating the resource of the original
- * API request).
- *
- * See documentation for the "matchPolicy" field in the webhook configuration type.
- */
- @JsonProperty("requestResource")
- private GroupVersionResource requestResource;
-
- /*
- * RequestSubResource is the name of the subresource of the original API request, if any (for example, "status" or "scale")
- * If this is specified and differs from the value in "subResource", an equivalent match and conversion was performed.
- * See documentation for the "matchPolicy" field in the webhook configuration type.
- */
- @JsonProperty("requestSubResource")
- private String requestSubResource;
-
- /*
- * Resource is the fully-qualified resource being requested (for example, v1.pods)
- */
- @JsonProperty("resource")
- private GroupVersionResource resource;
-
- /*
- * SubResource is the subresource being requested (for example, "status" or "scale")
- */
- @JsonProperty("subResource")
- private String subResource;
-
- /*
- * UID is identifier for individual request/response. It allows us to distinguish instances of
- * requests which otherwise identical (parallel requests, requests when earlier requests did not
- * modify etc). The UID is meant to track the round trip (request/response) between KAS and
- * the WebHook, not the user request.
- * It is suitable for correlating log entries between the webhook and apiserver, for either
- * auditing or debugging.
- */
- @JsonProperty("uid")
- private String uid;
-
- /*
- * UserInfo is information about the requesting user
- */
- @JsonProperty("userInfo")
- private UserInfo userInfo;
-
- @JsonIgnore
- private Map additionalProperties = new HashMap<>();
-
- public AdmissionRequest() {
- }
-
- public AdmissionRequest(Boolean dryRun, GroupVersionKind kind, String name, String namespace, KubernetesResource object,
- KubernetesResource oldObject, String operation, KubernetesResource options, GroupVersionKind requestKind,
- GroupVersionResource requestResource, String requestSubResource, GroupVersionResource resource, String subResource,
- String uid, UserInfo userInfo) {
- this.dryRun = dryRun;
- this.kind = kind;
- this.name = name;
- this.namespace = namespace;
- this.object = object;
- this.oldObject = oldObject;
- this.operation = operation;
- this.options = options;
- this.requestKind = requestKind;
- this.requestResource = requestResource;
- this.requestSubResource = requestSubResource;
- this.resource = resource;
- this.subResource = subResource;
- this.uid = uid;
- this.userInfo = userInfo;
- }
-
- /**
- * Get Dry Run
- *
- * @return The dryRun
- */
- @JsonProperty("dryRun")
- public Boolean getDryRun() {
- return dryRun;
- }
-
- /**
- * Set Dry run
- *
- * @param dryRun The dryRun
- */
- @JsonProperty("dryRun")
- public void setDryRun(Boolean dryRun) {
- this.dryRun = dryRun;
- }
-
- /**
- * Get Kind
- *
- * @return The kind
- */
- @JsonProperty("kind")
- public GroupVersionKind getKind() {
- return kind;
- }
-
- /**
- * Set Kind
- *
- * @param kind The kind
- */
- @JsonProperty("kind")
- public void setKind(GroupVersionKind kind) {
- this.kind = kind;
- }
-
- /**
- * Get Name
- *
- * @return The name
- */
- @JsonProperty("name")
- public String getName() {
- return name;
- }
-
- /**
- * Set Name
- *
- * @param name The name
- */
- @JsonProperty("name")
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * Get Namespace
- *
- * @return The namespace
- */
- @JsonProperty("namespace")
- public String getNamespace() {
- return namespace;
- }
-
- /**
- * Set Namespace
- *
- * @param namespace The namespace
- */
- @JsonProperty("namespace")
- public void setNamespace(String namespace) {
- this.namespace = namespace;
- }
-
- /**
- * Get Object
- *
- * @return The object
- */
- @JsonProperty("object")
- public KubernetesResource getObject() {
- return object;
- }
-
- /**
- * Set Object
- *
- * @param object The object
- */
- @JsonProperty("object")
- public void setObject(KubernetesResource object) {
- this.object = object;
- }
-
- /**
- * Get old object.
- *
- * @return The oldObject
- */
- @JsonProperty("oldObject")
- public KubernetesResource getOldObject() {
- return oldObject;
- }
-
- /**
- * Set old object.
- *
- * @param oldObject The oldObject
- */
- @JsonProperty("oldObject")
- public void setOldObject(KubernetesResource oldObject) {
- this.oldObject = oldObject;
- }
-
- /**
- * Get operation.
- *
- * @return The operation
- */
- @JsonProperty("operation")
- public String getOperation() {
- return operation;
- }
-
- /**
- * Set operation.
- *
- * @param operation The operation
- */
- @JsonProperty("operation")
- public void setOperation(String operation) {
- this.operation = operation;
- }
-
- /**
- * Get options.
- *
- * @return The options
- */
- @JsonProperty("options")
- public KubernetesResource getOptions() {
- return options;
- }
-
- /**
- * Set options.
- *
- * @param options The options
- */
- @JsonProperty("options")
- public void setOptions(KubernetesResource options) {
- this.options = options;
- }
-
- /**
- * Get Request Kind.
- *
- * @return The requestKind
- */
- @JsonProperty("requestKind")
- public GroupVersionKind getRequestKind() {
- return requestKind;
- }
-
- /**
- * Set RequestKind
- *
- * @param requestKind The requestKind
- */
- @JsonProperty("requestKind")
- public void setRequestKind(GroupVersionKind requestKind) {
- this.requestKind = requestKind;
- }
-
- /**
- * Get RequestResource
- *
- * @return The requestResource
- */
- @JsonProperty("requestResource")
- public GroupVersionResource getRequestResource() {
- return requestResource;
- }
-
- /**
- * Set RequestResource
- *
- * @param requestResource The requestResource
- */
- @JsonProperty("requestResource")
- public void setRequestResource(GroupVersionResource requestResource) {
- this.requestResource = requestResource;
- }
-
- /**
- * Get RequestSubResource
- *
- * @return The requestSubResource
- */
- @JsonProperty("requestSubResource")
- public String getRequestSubResource() {
- return requestSubResource;
- }
-
- /**
- * Set RequestSubResource
- *
- * @param requestSubResource The requestSubResource
- */
- @JsonProperty("requestSubResource")
- public void setRequestSubResource(String requestSubResource) {
- this.requestSubResource = requestSubResource;
- }
-
- /**
- * Get Resource
- *
- * @return The resource
- */
- @JsonProperty("resource")
- public GroupVersionResource getResource() {
- return resource;
- }
-
- /**
- * Set Resource.
- *
- * @param resource The resource
- */
- @JsonProperty("resource")
- public void setResource(GroupVersionResource resource) {
- this.resource = resource;
- }
-
- /**
- * Get SubResource
- *
- * @return The subResource
- */
- @JsonProperty("subResource")
- public String getSubResource() {
- return subResource;
- }
-
- /**
- * Set SubResource
- *
- * @param subResource The subResource
- */
- @JsonProperty("subResource")
- public void setSubResource(String subResource) {
- this.subResource = subResource;
- }
-
- /**
- * Get Uid
- *
- * @return The uid
- */
- @JsonProperty("uid")
- public String getUid() {
- return uid;
- }
-
- /**
- * Set Uid
- *
- * @param uid The uid
- */
- @JsonProperty("uid")
- public void setUid(String uid) {
- this.uid = uid;
- }
-
- /**
- * Get UserInfo
- *
- * @return The userInfo
- */
- @JsonProperty("userInfo")
- public UserInfo getUserInfo() {
- return userInfo;
- }
-
- /**
- * Set UserInfo
- *
- * @param userInfo The userInfo
- */
- @JsonProperty("userInfo")
- public void setUserInfo(UserInfo userInfo) {
- this.userInfo = userInfo;
- }
-
- @JsonAnyGetter
- public Map getAdditionalProperties() {
- return this.additionalProperties;
- }
-
- @JsonAnySetter
- public void setAdditionalProperty(String name, Object value) {
- this.additionalProperties.put(name, value);
- }
-
-}
diff --git a/kubernetes-model-generator/kubernetes-model-apiextensions/src/generated/java/io/fabric8/kubernetes/api/model/apiextensions/v1/ConversionRequest.java b/kubernetes-model-generator/kubernetes-model-apiextensions/src/generated/java/io/fabric8/kubernetes/api/model/apiextensions/v1/ConversionRequest.java
index 7bb9a369244..c1e676a5f70 100644
--- a/kubernetes-model-generator/kubernetes-model-apiextensions/src/generated/java/io/fabric8/kubernetes/api/model/apiextensions/v1/ConversionRequest.java
+++ b/kubernetes-model-generator/kubernetes-model-apiextensions/src/generated/java/io/fabric8/kubernetes/api/model/apiextensions/v1/ConversionRequest.java
@@ -15,7 +15,6 @@
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;
@@ -25,7 +24,6 @@
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;
@@ -54,9 +52,7 @@
@BuildableReference(IntOrString.class),
@BuildableReference(ObjectReference.class),
@BuildableReference(LocalObjectReference.class),
- @BuildableReference(PersistentVolumeClaim.class),
- @BuildableReference(GenericKubernetesResource.class),
- @BuildableReference(RawExtension.class)
+ @BuildableReference(PersistentVolumeClaim.class)
})
@Generated("jsonschema2pojo")
public class ConversionRequest implements Editable , KubernetesResource
@@ -65,8 +61,9 @@ public class ConversionRequest implements Editable , K
@JsonProperty("desiredAPIVersion")
private String desiredAPIVersion;
@JsonProperty("objects")
+ @JsonDeserialize(using = io.fabric8.kubernetes.internal.KubernetesDeserializerForList.class)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
- private List objects = new ArrayList<>();
+ private List
-
-
- io.javaoperatorsdk
- kubernetes-webhooks-framework-core
- ${kubernetes.webhooks.framework.version}
- test
-