diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e289cdd2a8..bf30308c346 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### 4.10-SNAPSHOT #### Bugs +* Fix #2205: Event model classes from core v1 have been lost #### Improvements diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/AutoAdaptableKubernetesClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/AutoAdaptableKubernetesClient.java index 1a78787522f..13bc958eae3 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/AutoAdaptableKubernetesClient.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/AutoAdaptableKubernetesClient.java @@ -22,7 +22,7 @@ import io.fabric8.kubernetes.api.model.DoneableComponentStatus; import io.fabric8.kubernetes.api.model.DoneableConfigMap; import io.fabric8.kubernetes.api.model.DoneableEndpoints; -import io.fabric8.kubernetes.api.model.events.DoneableEvent; +import io.fabric8.kubernetes.api.model.DoneableEvent; import io.fabric8.kubernetes.api.model.DoneableLimitRange; import io.fabric8.kubernetes.api.model.DoneableNamespace; import io.fabric8.kubernetes.api.model.DoneableNode; @@ -36,8 +36,8 @@ import io.fabric8.kubernetes.api.model.DoneableServiceAccount; import io.fabric8.kubernetes.api.model.Endpoints; import io.fabric8.kubernetes.api.model.EndpointsList; -import io.fabric8.kubernetes.api.model.events.Event; -import io.fabric8.kubernetes.api.model.events.EventList; +import io.fabric8.kubernetes.api.model.Event; +import io.fabric8.kubernetes.api.model.EventList; import io.fabric8.kubernetes.api.model.HasMetadata; import io.fabric8.kubernetes.api.model.KubernetesResourceList; import io.fabric8.kubernetes.api.model.LimitRange; diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/DefaultKubernetesClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/DefaultKubernetesClient.java index 1419fd023f1..8320c45ded0 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/DefaultKubernetesClient.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/DefaultKubernetesClient.java @@ -35,9 +35,9 @@ import io.fabric8.kubernetes.api.model.Endpoints; import io.fabric8.kubernetes.api.model.EndpointsList; import io.fabric8.kubernetes.api.model.DoneableEndpoints; -import io.fabric8.kubernetes.api.model.events.Event; -import io.fabric8.kubernetes.api.model.events.EventList; -import io.fabric8.kubernetes.api.model.events.DoneableEvent; +import io.fabric8.kubernetes.api.model.Event; +import io.fabric8.kubernetes.api.model.EventList; +import io.fabric8.kubernetes.api.model.DoneableEvent; import io.fabric8.kubernetes.api.model.LimitRange; import io.fabric8.kubernetes.api.model.LimitRangeList; import io.fabric8.kubernetes.api.model.DoneableLimitRange; @@ -101,7 +101,7 @@ import io.fabric8.kubernetes.client.dsl.internal.core.v1.ResourceQuotaOperationsImpl; import io.fabric8.kubernetes.client.dsl.internal.core.v1.SecretOperationsImpl; import io.fabric8.kubernetes.client.dsl.internal.core.v1.ServiceAccountOperationsImpl; -import io.fabric8.kubernetes.client.dsl.internal.events.v1beta1.EventOperationsImpl; +import io.fabric8.kubernetes.client.dsl.internal.core.v1.EventOperationsImpl; import io.fabric8.kubernetes.client.extended.leaderelection.LeaderElectorBuilder; import io.fabric8.kubernetes.client.utils.Serialization; import io.fabric8.kubernetes.client.informers.SharedInformerFactory; diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/KubernetesClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/KubernetesClient.java index b1151051f1d..004e08d83c9 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/KubernetesClient.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/KubernetesClient.java @@ -30,9 +30,9 @@ import io.fabric8.kubernetes.api.model.Endpoints; import io.fabric8.kubernetes.api.model.EndpointsList; import io.fabric8.kubernetes.api.model.DoneableEndpoints; -import io.fabric8.kubernetes.api.model.events.Event; -import io.fabric8.kubernetes.api.model.events.EventList; -import io.fabric8.kubernetes.api.model.events.DoneableEvent; +import io.fabric8.kubernetes.api.model.Event; +import io.fabric8.kubernetes.api.model.EventList; +import io.fabric8.kubernetes.api.model.DoneableEvent; import io.fabric8.kubernetes.api.model.LimitRange; import io.fabric8.kubernetes.api.model.LimitRangeList; import io.fabric8.kubernetes.api.model.DoneableLimitRange; @@ -301,8 +301,9 @@ public interface KubernetesClient extends Client { MixedOperation> endpoints(); /** - * API entrypoint for getting events in Kubernetes. Events (events/v1beta1) + * API entrypoint for getting events in Kubernetes. Events (core/v1) * + * @deprecated Use {@link #v1().events() } instead. * @return MixedOperation object for doing operations for Events */ MixedOperation> events(); @@ -439,5 +440,12 @@ public interface KubernetesClient extends Client { */ MixedOperation> leases(); + /** + * API entrypoint for Core Kubernetes Resources (core/v1). Right now other core + * resources have their own DSL entrypoints. But in future, all core/v1 resources + * would be added here. + * + * @return V1APIGroupDSL DSL object for core v1 resources + */ V1APIGroupDSL v1(); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1APIGroupClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1APIGroupClient.java index a5da3f615f5..ec838660e9c 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1APIGroupClient.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1APIGroupClient.java @@ -16,12 +16,16 @@ package io.fabric8.kubernetes.client; import io.fabric8.kubernetes.api.model.DoneablePodTemplate; +import io.fabric8.kubernetes.api.model.Event; +import io.fabric8.kubernetes.api.model.EventList; import io.fabric8.kubernetes.api.model.PodTemplate; import io.fabric8.kubernetes.api.model.PodTemplateList; +import io.fabric8.kubernetes.api.model.DoneableEvent; import io.fabric8.kubernetes.client.dsl.MixedOperation; import io.fabric8.kubernetes.client.dsl.Resource; import io.fabric8.kubernetes.client.dsl.V1APIGroupDSL; import io.fabric8.kubernetes.client.dsl.internal.core.v1.PodTemplateOperationsImpl; +import io.fabric8.kubernetes.client.dsl.internal.core.v1.EventOperationsImpl; import okhttp3.OkHttpClient; public class V1APIGroupClient extends BaseClient implements V1APIGroupDSL { @@ -37,4 +41,9 @@ public V1APIGroupClient(OkHttpClient httpClient, final Config config) { public MixedOperation> podTemplates() { return new PodTemplateOperationsImpl(httpClient, getConfiguration()); } + + @Override + public MixedOperation> events() { + return new EventOperationsImpl(httpClient, getConfiguration()); + } } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/V1APIGroupDSL.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/V1APIGroupDSL.java index df0df73eec4..7adf26c6086 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/V1APIGroupDSL.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/V1APIGroupDSL.java @@ -18,8 +18,12 @@ import io.fabric8.kubernetes.api.model.PodTemplate; import io.fabric8.kubernetes.api.model.PodTemplateList; import io.fabric8.kubernetes.api.model.DoneablePodTemplate; +import io.fabric8.kubernetes.api.model.DoneableEvent; +import io.fabric8.kubernetes.api.model.Event; +import io.fabric8.kubernetes.api.model.EventList; import io.fabric8.kubernetes.client.Client; public interface V1APIGroupDSL extends Client { MixedOperation> podTemplates(); + MixedOperation> events(); } diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/osgi/ManagedKubernetesClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/osgi/ManagedKubernetesClient.java index eafeba27460..1677b8f0624 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/osgi/ManagedKubernetesClient.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/osgi/ManagedKubernetesClient.java @@ -26,7 +26,7 @@ import io.fabric8.kubernetes.api.model.DoneableComponentStatus; import io.fabric8.kubernetes.api.model.DoneableConfigMap; import io.fabric8.kubernetes.api.model.DoneableEndpoints; -import io.fabric8.kubernetes.api.model.events.DoneableEvent; +import io.fabric8.kubernetes.api.model.DoneableEvent; import io.fabric8.kubernetes.api.model.DoneableLimitRange; import io.fabric8.kubernetes.api.model.DoneableNamespace; import io.fabric8.kubernetes.api.model.DoneableNode; @@ -40,8 +40,8 @@ import io.fabric8.kubernetes.api.model.DoneableServiceAccount; import io.fabric8.kubernetes.api.model.Endpoints; import io.fabric8.kubernetes.api.model.EndpointsList; -import io.fabric8.kubernetes.api.model.events.Event; -import io.fabric8.kubernetes.api.model.events.EventList; +import io.fabric8.kubernetes.api.model.Event; +import io.fabric8.kubernetes.api.model.EventList; import io.fabric8.kubernetes.api.model.HasMetadata; import io.fabric8.kubernetes.api.model.KubernetesResourceList; import io.fabric8.kubernetes.api.model.LimitRange; diff --git a/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/internal/UtilsTest.java b/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/internal/UtilsTest.java index e9494015542..cdcb64d0358 100644 --- a/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/internal/UtilsTest.java +++ b/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/internal/UtilsTest.java @@ -19,7 +19,7 @@ import io.fabric8.kubernetes.api.model.ComponentStatus; import io.fabric8.kubernetes.api.model.ConfigMap; import io.fabric8.kubernetes.api.model.Endpoints; -import io.fabric8.kubernetes.api.model.events.Event; +import io.fabric8.kubernetes.api.model.Event; import io.fabric8.kubernetes.api.model.autoscaling.v2beta2.HorizontalPodAutoscaler; import io.fabric8.kubernetes.api.model.LimitRange; import io.fabric8.kubernetes.api.model.Namespace; diff --git a/kubernetes-model/kubernetes-model-core/cmd/generate/generate.go b/kubernetes-model/kubernetes-model-core/cmd/generate/generate.go index 8cb8ccbe1a1..d6d21aceccf 100644 --- a/kubernetes-model/kubernetes-model-core/cmd/generate/generate.go +++ b/kubernetes-model/kubernetes-model-core/cmd/generate/generate.go @@ -67,6 +67,9 @@ type Schema struct { Node kapi.Node NodeList kapi.NodeList EnvVar kapi.EnvVar + Event kapi.Event + EventList kapi.EventList + EventSeries kapi.EventSeries EventSource kapi.EventSource Namespace kapi.Namespace NamespaceList kapi.NamespaceList diff --git a/kubernetes-model/kubernetes-model-core/src/main/resources/schema/kube-schema.json b/kubernetes-model/kubernetes-model-core/src/main/resources/schema/kube-schema.json index e86824db9b5..ff93468ffc1 100644 --- a/kubernetes-model/kubernetes-model-core/src/main/resources/schema/kube-schema.json +++ b/kubernetes-model/kubernetes-model-core/src/main/resources/schema/kube-schema.json @@ -3127,6 +3127,148 @@ "io.fabric8.kubernetes.api.model.KubernetesResource" ] }, + "kubernetes_core_Event": { + "type": "object", + "description": "", + "properties": { + "action": { + "type": "string", + "description": "" + }, + "apiVersion": { + "type": "string", + "description": "", + "default": "v1", + "required": true + }, + "count": { + "type": "integer", + "description": "" + }, + "eventTime": { + "$ref": "#/definitions/kubernetes_apimachinery_pkg_apis_MicroTime", + "javaType": "io.fabric8.kubernetes.api.model.MicroTime" + }, + "firstTimestamp": { + "$ref": "#/definitions/kubernetes_apimachinery_pkg_apis_Time", + "javaType": "String" + }, + "involvedObject": { + "$ref": "#/definitions/kubernetes_core_ObjectReference", + "javaType": "io.fabric8.kubernetes.api.model.ObjectReference" + }, + "kind": { + "type": "string", + "description": "", + "default": "Event", + "required": true + }, + "lastTimestamp": { + "$ref": "#/definitions/kubernetes_apimachinery_pkg_apis_Time", + "javaType": "String" + }, + "message": { + "type": "string", + "description": "" + }, + "metadata": { + "$ref": "#/definitions/kubernetes_apimachinery_pkg_apis_ObjectMeta", + "javaType": "io.fabric8.kubernetes.api.model.ObjectMeta" + }, + "reason": { + "type": "string", + "description": "" + }, + "related": { + "$ref": "#/definitions/kubernetes_core_ObjectReference", + "javaType": "io.fabric8.kubernetes.api.model.ObjectReference" + }, + "reportingComponent": { + "type": "string", + "description": "" + }, + "reportingInstance": { + "type": "string", + "description": "" + }, + "series": { + "$ref": "#/definitions/kubernetes_core_EventSeries", + "javaType": "io.fabric8.kubernetes.api.model.EventSeries" + }, + "source": { + "$ref": "#/definitions/kubernetes_core_EventSource", + "javaType": "io.fabric8.kubernetes.api.model.EventSource" + }, + "type": { + "type": "string", + "description": "" + } + }, + "additionalProperties": true, + "javaType": "io.fabric8.kubernetes.api.model.Event", + "javaInterfaces": [ + "io.fabric8.kubernetes.api.model.HasMetadata" + ] + }, + "kubernetes_core_EventList": { + "type": "object", + "description": "", + "properties": { + "apiVersion": { + "type": "string", + "description": "", + "default": "v1", + "required": true + }, + "items": { + "type": "array", + "description": "", + "items": { + "$ref": "#/definitions/kubernetes_core_Event", + "javaType": "io.fabric8.kubernetes.api.model.Event" + } + }, + "kind": { + "type": "string", + "description": "", + "default": "EventList", + "required": true + }, + "metadata": { + "$ref": "#/definitions/kubernetes_apimachinery_pkg_apis_ListMeta", + "javaType": "io.fabric8.kubernetes.api.model.ListMeta" + } + }, + "additionalProperties": true, + "javaType": "io.fabric8.kubernetes.api.model.EventList", + "javaInterfaces": [ + "io.fabric8.kubernetes.api.model.KubernetesResource", + "io.fabric8.kubernetes.api.model.KubernetesResourceList\u003cio.fabric8.kubernetes.api.model.Event\u003e" + ] + }, + "kubernetes_core_EventSeries": { + "type": "object", + "description": "", + "properties": { + "count": { + "type": "integer", + "description": "" + }, + "lastObservedTime": { + "$ref": "#/definitions/kubernetes_apimachinery_pkg_apis_MicroTime", + "javaType": "io.fabric8.kubernetes.api.model.MicroTime" + }, + "state": { + "type": "string", + "description": "" + } + }, + "additionalProperties": true, + "javaType": "io.fabric8.kubernetes.api.model.EventSeries", + "javaInterfaces": [ + "io.fabric8.kubernetes.api.model.KubernetesResource" + ] + }, "kubernetes_core_EventSource": { "type": "object", "description": "", @@ -8035,6 +8177,18 @@ "$ref": "#/definitions/kubernetes_core_EnvVar", "javaType": "io.fabric8.kubernetes.api.model.EnvVar" }, + "Event": { + "$ref": "#/definitions/kubernetes_core_Event", + "javaType": "io.fabric8.kubernetes.api.model.Event" + }, + "EventList": { + "$ref": "#/definitions/kubernetes_core_EventList", + "javaType": "io.fabric8.kubernetes.api.model.EventList" + }, + "EventSeries": { + "$ref": "#/definitions/kubernetes_core_EventSeries", + "javaType": "io.fabric8.kubernetes.api.model.EventSeries" + }, "EventSource": { "$ref": "#/definitions/kubernetes_core_EventSource", "javaType": "io.fabric8.kubernetes.api.model.EventSource" diff --git a/kubernetes-model/kubernetes-model-core/src/main/resources/schema/validation-schema.json b/kubernetes-model/kubernetes-model-core/src/main/resources/schema/validation-schema.json index 9fda6ce7b14..12dc5608d91 100644 --- a/kubernetes-model/kubernetes-model-core/src/main/resources/schema/validation-schema.json +++ b/kubernetes-model/kubernetes-model-core/src/main/resources/schema/validation-schema.json @@ -3127,6 +3127,148 @@ "io.fabric8.kubernetes.api.model.KubernetesResource" ] }, + "kubernetes_core_Event": { + "type": "object", + "description": "", + "properties": { + "action": { + "type": "string", + "description": "" + }, + "apiVersion": { + "type": "string", + "description": "", + "default": "v1", + "required": true + }, + "count": { + "type": "integer", + "description": "" + }, + "eventTime": { + "$ref": "#/definitions/kubernetes_apimachinery_pkg_apis_MicroTime", + "javaType": "io.fabric8.kubernetes.api.model.MicroTime" + }, + "firstTimestamp": { + "$ref": "#/definitions/kubernetes_apimachinery_pkg_apis_Time", + "javaType": "String" + }, + "involvedObject": { + "$ref": "#/definitions/kubernetes_core_ObjectReference", + "javaType": "io.fabric8.kubernetes.api.model.ObjectReference" + }, + "kind": { + "type": "string", + "description": "", + "default": "Event", + "required": true + }, + "lastTimestamp": { + "$ref": "#/definitions/kubernetes_apimachinery_pkg_apis_Time", + "javaType": "String" + }, + "message": { + "type": "string", + "description": "" + }, + "metadata": { + "$ref": "#/definitions/kubernetes_apimachinery_pkg_apis_ObjectMeta", + "javaType": "io.fabric8.kubernetes.api.model.ObjectMeta" + }, + "reason": { + "type": "string", + "description": "" + }, + "related": { + "$ref": "#/definitions/kubernetes_core_ObjectReference", + "javaType": "io.fabric8.kubernetes.api.model.ObjectReference" + }, + "reportingComponent": { + "type": "string", + "description": "" + }, + "reportingInstance": { + "type": "string", + "description": "" + }, + "series": { + "$ref": "#/definitions/kubernetes_core_EventSeries", + "javaType": "io.fabric8.kubernetes.api.model.EventSeries" + }, + "source": { + "$ref": "#/definitions/kubernetes_core_EventSource", + "javaType": "io.fabric8.kubernetes.api.model.EventSource" + }, + "type": { + "type": "string", + "description": "" + } + }, + "additionalProperties": true, + "javaType": "io.fabric8.kubernetes.api.model.Event", + "javaInterfaces": [ + "io.fabric8.kubernetes.api.model.HasMetadata" + ] + }, + "kubernetes_core_EventList": { + "type": "object", + "description": "", + "properties": { + "apiVersion": { + "type": "string", + "description": "", + "default": "v1", + "required": true + }, + "items": { + "type": "array", + "description": "", + "items": { + "$ref": "#/definitions/kubernetes_core_Event", + "javaType": "io.fabric8.kubernetes.api.model.Event" + } + }, + "kind": { + "type": "string", + "description": "", + "default": "EventList", + "required": true + }, + "metadata": { + "$ref": "#/definitions/kubernetes_apimachinery_pkg_apis_ListMeta", + "javaType": "io.fabric8.kubernetes.api.model.ListMeta" + } + }, + "additionalProperties": true, + "javaType": "io.fabric8.kubernetes.api.model.EventList", + "javaInterfaces": [ + "io.fabric8.kubernetes.api.model.KubernetesResource", + "io.fabric8.kubernetes.api.model.KubernetesResourceList\u003cio.fabric8.kubernetes.api.model.Event\u003e" + ] + }, + "kubernetes_core_EventSeries": { + "type": "object", + "description": "", + "properties": { + "count": { + "type": "integer", + "description": "" + }, + "lastObservedTime": { + "$ref": "#/definitions/kubernetes_apimachinery_pkg_apis_MicroTime", + "javaType": "io.fabric8.kubernetes.api.model.MicroTime" + }, + "state": { + "type": "string", + "description": "" + } + }, + "additionalProperties": true, + "javaType": "io.fabric8.kubernetes.api.model.EventSeries", + "javaInterfaces": [ + "io.fabric8.kubernetes.api.model.KubernetesResource" + ] + }, "kubernetes_core_EventSource": { "type": "object", "description": "", @@ -8035,6 +8177,18 @@ "$ref": "#/definitions/kubernetes_core_EnvVar", "javaType": "io.fabric8.kubernetes.api.model.EnvVar" }, + "Event": { + "$ref": "#/definitions/kubernetes_core_Event", + "javaType": "io.fabric8.kubernetes.api.model.Event" + }, + "EventList": { + "$ref": "#/definitions/kubernetes_core_EventList", + "javaType": "io.fabric8.kubernetes.api.model.EventList" + }, + "EventSeries": { + "$ref": "#/definitions/kubernetes_core_EventSeries", + "javaType": "io.fabric8.kubernetes.api.model.EventSeries" + }, "EventSource": { "$ref": "#/definitions/kubernetes_core_EventSource", "javaType": "io.fabric8.kubernetes.api.model.EventSource" @@ -9972,6 +10126,129 @@ }, "additionalProperties": true }, + "event": { + "properties": { + "action": { + "type": "string", + "description": "" + }, + "apiVersion": { + "type": "string", + "description": "", + "default": "v1", + "required": true + }, + "count": { + "type": "integer", + "description": "" + }, + "eventTime": { + "$ref": "#/definitions/kubernetes_apimachinery_pkg_apis_MicroTime", + "javaType": "io.fabric8.kubernetes.api.model.MicroTime" + }, + "firstTimestamp": { + "$ref": "#/definitions/kubernetes_apimachinery_pkg_apis_Time", + "javaType": "String" + }, + "involvedObject": { + "$ref": "#/definitions/kubernetes_core_ObjectReference", + "javaType": "io.fabric8.kubernetes.api.model.ObjectReference" + }, + "kind": { + "type": "string", + "description": "", + "default": "Event", + "required": true + }, + "lastTimestamp": { + "$ref": "#/definitions/kubernetes_apimachinery_pkg_apis_Time", + "javaType": "String" + }, + "message": { + "type": "string", + "description": "" + }, + "metadata": { + "$ref": "#/definitions/kubernetes_apimachinery_pkg_apis_ObjectMeta", + "javaType": "io.fabric8.kubernetes.api.model.ObjectMeta" + }, + "reason": { + "type": "string", + "description": "" + }, + "related": { + "$ref": "#/definitions/kubernetes_core_ObjectReference", + "javaType": "io.fabric8.kubernetes.api.model.ObjectReference" + }, + "reportingComponent": { + "type": "string", + "description": "" + }, + "reportingInstance": { + "type": "string", + "description": "" + }, + "series": { + "$ref": "#/definitions/kubernetes_core_EventSeries", + "javaType": "io.fabric8.kubernetes.api.model.EventSeries" + }, + "source": { + "$ref": "#/definitions/kubernetes_core_EventSource", + "javaType": "io.fabric8.kubernetes.api.model.EventSource" + }, + "type": { + "type": "string", + "description": "" + } + }, + "additionalProperties": true + }, + "eventlist": { + "properties": { + "apiVersion": { + "type": "string", + "description": "", + "default": "v1", + "required": true + }, + "items": { + "type": "array", + "description": "", + "items": { + "$ref": "#/definitions/kubernetes_core_Event", + "javaType": "io.fabric8.kubernetes.api.model.Event" + } + }, + "kind": { + "type": "string", + "description": "", + "default": "EventList", + "required": true + }, + "metadata": { + "$ref": "#/definitions/kubernetes_apimachinery_pkg_apis_ListMeta", + "javaType": "io.fabric8.kubernetes.api.model.ListMeta" + } + }, + "additionalProperties": true + }, + "eventseries": { + "properties": { + "count": { + "type": "integer", + "description": "" + }, + "lastObservedTime": { + "$ref": "#/definitions/kubernetes_apimachinery_pkg_apis_MicroTime", + "javaType": "io.fabric8.kubernetes.api.model.MicroTime" + }, + "state": { + "type": "string", + "description": "" + } + }, + "additionalProperties": true + }, "eventsource": { "properties": { "component": { diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ErrorMessageTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ErrorMessageTest.java index 0f5e2c85987..6863544a254 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ErrorMessageTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ErrorMessageTest.java @@ -15,7 +15,6 @@ */ package io.fabric8.kubernetes.client.mock; -import io.fabric8.kubernetes.api.model.events.EventListBuilder; import io.fabric8.kubernetes.api.model.StatusBuilder; import io.fabric8.kubernetes.client.KubernetesClient; import io.fabric8.kubernetes.client.server.mock.KubernetesServer; @@ -43,17 +42,17 @@ public void testCustomMessage() { expectedEx.expectMessage(not(containsString("Received status"))); server.getClient().getConfiguration().getErrorMessages().put(403, "MSG"); - server.expect().withPath("/apis/events.k8s.io/v1beta1/namespaces/test/events").andReturn(200, new EventListBuilder() + server.expect().withPath("/api/v1/namespaces/test/events").andReturn(200, new io.fabric8.kubernetes.api.model.EventListBuilder() .addNewItem() .withNewMetadata() .withName("event1") .endMetadata() .endItem().build()).once(); - server.expect().withPath("/apis/events.k8s.io/v1beta1/namespaces/test/events/event1").andReturn(403, Boolean.FALSE).once(); + server.expect().withPath("/api/v1/namespaces/test/events/event1").andReturn(403, Boolean.FALSE).once(); KubernetesClient client = server.getClient(); - client.events().inNamespace("test").delete(); + client.v1().events().inNamespace("test").delete(); } @Test @@ -62,7 +61,7 @@ public void testServerErrorWithStatus() { expectedEx.expectMessage(containsString("Received status")); expectedEx.expectMessage(containsString("Message: This operation")); - server.expect().withPath("/apis/events.k8s.io/v1beta1/namespaces/test/events").andReturn(500, new StatusBuilder() + server.expect().withPath("/api/v1/namespaces/test/events").andReturn(500, new StatusBuilder() .withMessage("This operation is not allowed for some reason") .withReason("Some reason") .withCode(500) @@ -71,6 +70,6 @@ public void testServerErrorWithStatus() { KubernetesClient client = server.getClient(); - client.events().inNamespace("test").createNew().withNewMetadata().withName("event1").endMetadata().done(); + client.v1().events().inNamespace("test").createNew().withNewMetadata().withName("event1").endMetadata().done(); } } diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/DefaultOpenShiftClient.java b/openshift-client/src/main/java/io/fabric8/openshift/client/DefaultOpenShiftClient.java index 9b2e1ac4f78..b92af78a5a2 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/DefaultOpenShiftClient.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/DefaultOpenShiftClient.java @@ -20,7 +20,7 @@ import io.fabric8.kubernetes.api.model.DoneableComponentStatus; import io.fabric8.kubernetes.api.model.DoneableConfigMap; import io.fabric8.kubernetes.api.model.DoneableEndpoints; -import io.fabric8.kubernetes.api.model.events.DoneableEvent; +import io.fabric8.kubernetes.api.model.DoneableEvent; import io.fabric8.kubernetes.api.model.DoneableLimitRange; import io.fabric8.kubernetes.api.model.DoneableNamespace; import io.fabric8.kubernetes.api.model.DoneableNode; @@ -39,8 +39,8 @@ import io.fabric8.kubernetes.api.model.coordination.v1.DoneableLease; import io.fabric8.kubernetes.api.model.coordination.v1.Lease; import io.fabric8.kubernetes.api.model.coordination.v1.LeaseList; -import io.fabric8.kubernetes.api.model.events.Event; -import io.fabric8.kubernetes.api.model.events.EventList; +import io.fabric8.kubernetes.api.model.Event; +import io.fabric8.kubernetes.api.model.EventList; import io.fabric8.kubernetes.client.*; import io.fabric8.kubernetes.client.Config; import io.fabric8.kubernetes.client.dsl.*; diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/osgi/ManagedOpenShiftClient.java b/openshift-client/src/main/java/io/fabric8/openshift/client/osgi/ManagedOpenShiftClient.java index 645986fe880..9123c80c759 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/osgi/ManagedOpenShiftClient.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/osgi/ManagedOpenShiftClient.java @@ -17,9 +17,9 @@ package io.fabric8.openshift.client.osgi; import io.fabric8.kubernetes.api.model.*; -import io.fabric8.kubernetes.api.model.events.Event; -import io.fabric8.kubernetes.api.model.events.DoneableEvent; -import io.fabric8.kubernetes.api.model.events.EventList; +import io.fabric8.kubernetes.api.model.Event; +import io.fabric8.kubernetes.api.model.DoneableEvent; +import io.fabric8.kubernetes.api.model.EventList; import io.fabric8.kubernetes.api.model.DoneableSecret; import io.fabric8.kubernetes.api.model.Secret; import io.fabric8.kubernetes.api.model.apiextensions.CustomResourceDefinition;