Comments (6)
Okay, from experimentation, it looks like the old core Events are translated into events/v1 Events with eventTime: null
. Creating new Events (or editing existing ones) with eventTime: null
or without eventTime
is rejected by the API server. New events/v1 Events that were generated by the API server as such must have eventTime: non-null
.
There is also the case of reportingController
etc fields - they are required in new events/v1 Events, but unlike eventTime
they are omitted entirely instead of being set to null
for old core Events. Also unlike the eventTime
field they are marked as optional in the OpenAPI spec.
So I think I'll treat this as an OpenAPI spec bug that should mark Event::eventTime
as an optional field just like it did for reportingController
etc, rather than allow MicroTime
to be deserializable from null
.
from k8s-openapi.
It can, but it produces a zero time.Time
, which per https://pkg.go.dev/time#Time represents "January 1, year 1, 00:00:00.000000000 UTC".
k8s-openapi types the Event::event_time
field as Option<MicroTime>
because the spec says the field is optional.
Is 0001-01-01T00:00:00.000000000Z
a more useful value than None
? In golang where nonsensical "zero" values for structs are the norm since optionals require pointer types, sure. But I'm not sure I want to carry that forward into Rust when we have a proper Option
.
from k8s-openapi.
core/v1 Event spec says eventTime is optional, but events.k8s.io/v1 Event spec says it's required.
so api.get()
or api.list()
on events.k8s.io/v1 Event woud fail when there's any event that is converted from old type.
from k8s-openapi.
Oh, I forgot to mention that events.k8s.io/v1 Event usually contains core/v1 Events that are automatically converted.
from k8s-openapi.
I attached kubectl get event
, not kubecl get events.events.k8s.io
this is the latter.
{
"apiVersion": "events.k8s.io/v1",
"deprecatedCount": 1,
"deprecatedFirstTimestamp": "2023-02-16T18:25:07Z",
"deprecatedLastTimestamp": "2023-02-16T18:25:07Z",
"deprecatedSource": {
"component": "default-scheduler"
},
"eventTime": null,
"kind": "Event",
"metadata": {
"creationTimestamp": "2023-02-16T18:25:07Z",
"name": "some-pod.174461445d6d3cff",
"namespace": "test-530513",
"resourceVersion": "320932",
"uid": "f3ac47c9-cc86-4193-a2ed-2e4428b7ad77"
},
"note": "Successfully assigned test-530513/some-pod to test-pgd-control-plane",
"reason": "Scheduled",
"regarding": {
"apiVersion": "v1",
"kind": "Pod",
"name": "some-pod",
"namespace": "test-530513",
"resourceVersion": "320930",
"uid": "ace87ee8-15fb-46ae-9dae-c77422c2010f"
},
"type": "Normal"
}
from k8s-openapi.
Does the API server accept a JSON blob that doesn't contain an eventTime
field at all as an events.k8s.io/v1 Event ? Or does it require the field to be present?
from k8s-openapi.
Related Issues (20)
- VolumeSnapshot and friends? HOT 2
- Consider extending the crate with merge functionality HOT 7
- Documentation snippet about kubernetes detection is not working as expected HOT 4
- Improve Name and Namespace optionality HOT 7
- `apimachinery::pkg::api::resource::Quantity` compatibility with Go HOT 2
- i32 for port number HOT 5
- Add `latest` and `earliest` version features that track highest and lowest supported version HOT 1
- Can't find `meta/v1/Duration` HOT 2
- `k8s_openapi::ListResponse` should be serializable HOT 2
- release with v1.27 HOT 3
- v1.28.0
- Looking for example on how to use k8s_openapi::api::core::v1::Event::create function HOT 1
- ServiceSpec not creating headless service when cluster_ip set to None HOT 4
- Size of generated code HOT 7
- Tracking issue for bringing back API operations-related code if there is demand HOT 6
- about k8s-openapi features upgrade question HOT 4
- Comparison of elements is too strict HOT 2
- int-or-string parameters are typed out with mismatched "type" property HOT 2
- Namespaces are not Serializing HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from k8s-openapi.