Skip to content

Commit

Permalink
Fix fabric8io#2205: Event model classes from core/v1 have been lost
Browse files Browse the repository at this point in the history
  • Loading branch information
rohanKanojia committed May 8, 2020
1 parent 4639df2 commit 066cff2
Show file tree
Hide file tree
Showing 14 changed files with 482 additions and 27 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### 4.10-SNAPSHOT
#### Bugs
* Fix #2205: Event model classes from core v1 have been lost

#### Improvements

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -301,8 +301,9 @@ public interface KubernetesClient extends Client {
MixedOperation<Endpoints, EndpointsList, DoneableEndpoints, Resource<Endpoints, DoneableEndpoints>> 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<Event, EventList, DoneableEvent, Resource<Event, DoneableEvent>> events();
Expand Down Expand Up @@ -439,5 +440,12 @@ public interface KubernetesClient extends Client {
*/
MixedOperation<Lease, LeaseList, DoneableLease, Resource<Lease, DoneableLease>> 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();
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -37,4 +41,9 @@ public V1APIGroupClient(OkHttpClient httpClient, final Config config) {
public MixedOperation<PodTemplate, PodTemplateList, DoneablePodTemplate, Resource<PodTemplate, DoneablePodTemplate>> podTemplates() {
return new PodTemplateOperationsImpl(httpClient, getConfiguration());
}

@Override
public MixedOperation<Event, EventList, DoneableEvent, Resource<Event, DoneableEvent>> events() {
return new EventOperationsImpl(httpClient, getConfiguration());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<PodTemplate, PodTemplateList, DoneablePodTemplate, Resource<PodTemplate, DoneablePodTemplate>> podTemplates();
MixedOperation<Event, EventList, DoneableEvent, Resource<Event, DoneableEvent>> events();
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": "",
Expand Down Expand Up @@ -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"
Expand Down
Loading

0 comments on commit 066cff2

Please sign in to comment.