fabric8 Kubernetes client events() API中,Watcher.Action表示什么?
In the fabric8 Kubernetes client events() API, what does Watcher.Action indicate?
我已经成功使用 Fabric8 Kubernetes 客户端 events()
API 订阅了我的 minikube 安装发出的一系列事件。太酷了!
(未记录)Watcher
class 有一个(未记录)eventReceived()
method whose first parameter is a Watcher.Action
(an enum
with values of ADDED
, MODIFIED
, DELETED
and ERROR
). Its second parameter is (I've found out ) 一个 Event
,代表一个 Kubernetes Event
资源(我猜).
我在事件流中注意到的是有用的信息,但 "action" 似乎与事件不符。例如,这是我对 eventReceived()
的实现的一些任意输出(我打印了 +++ action:
以显示通知我的东西的操作):
+++ action: DELETED
Event(apiVersion=v1, count=1, firstTimestamp=2017-04-25T23:41:54Z, involvedObject=ObjectReference(apiVersion=v1, fieldPath=spec.containers{controller-manager}, kind=Pod, name=catalog-catalog-controller-manager-1242994143-ddl0l, namespace=catalog, resourceVersion=462865, uid=11fc24bf-2a05-11e7-a27a-080027117396, additionalProperties={}), kind=Event, lastTimestamp=2017-04-25T23:41:54Z, message=Started container with id 7b51c389f153832e7719a99738706c2ff38aa28b298b80741f439b712f166262, metadata=ObjectMeta(annotations=null, clusterName=null, creationTimestamp=2017-04-25T23:41:54Z, deletionGracePeriodSeconds=null, deletionTimestamp=null, finalizers=[], generateName=null, generation=null, labels=null, name=catalog-catalog-controller-manager-1242994143-ddl0l.14b8c87cc177fb77, namespace=catalog, ownerReferences=[], resourceVersion=472706, selfLink=/api/v1/namespaces/catalog/events/catalog-catalog-controller-manager-1242994143-ddl0l.14b8c87cc177fb77, uid=c3851fae-2a10-11e7-a27a-080027117396, additionalProperties={}), reason=Started, source=EventSource(component=kubelet, host=minikube, additionalProperties={}), type=Normal, additionalProperties={})
因此您会注意到操作是 DELETED
,并且事件似乎描述了 Pod
的开始(注意 message=Started container with id…
数据)。
这是什么意思?我是否误解了 Action
参数试图告诉我的内容?这是否可能意味着 实际 Event
资源 和 uid=c3851fae-2a10-11e7-a27a-080027117396
已经 DELETED
(在大多数情况下这是非常无用的信息,但我可以看到,我想,如果事件是 也是 资源,那么我猜,事件表明它们已被删除)?
其实,确实就是这个意思。 Event
是一种资源,在某些情况下由 WatchEvent
表示。某些 kubectl
有关事件的操作报告是两者的混合体,但是 Event
可以删除(例如,当它名义上描述的事物消失时),并且 [=10] 的删除=] 问题由 WatchEvent
.
表示
我已经成功使用 Fabric8 Kubernetes 客户端 events()
API 订阅了我的 minikube 安装发出的一系列事件。太酷了!
(未记录)Watcher
class 有一个(未记录)eventReceived()
method whose first parameter is a Watcher.Action
(an enum
with values of ADDED
, MODIFIED
, DELETED
and ERROR
). Its second parameter is (I've found out Event
,代表一个 Kubernetes Event
资源(我猜).
我在事件流中注意到的是有用的信息,但 "action" 似乎与事件不符。例如,这是我对 eventReceived()
的实现的一些任意输出(我打印了 +++ action:
以显示通知我的东西的操作):
+++ action: DELETED
Event(apiVersion=v1, count=1, firstTimestamp=2017-04-25T23:41:54Z, involvedObject=ObjectReference(apiVersion=v1, fieldPath=spec.containers{controller-manager}, kind=Pod, name=catalog-catalog-controller-manager-1242994143-ddl0l, namespace=catalog, resourceVersion=462865, uid=11fc24bf-2a05-11e7-a27a-080027117396, additionalProperties={}), kind=Event, lastTimestamp=2017-04-25T23:41:54Z, message=Started container with id 7b51c389f153832e7719a99738706c2ff38aa28b298b80741f439b712f166262, metadata=ObjectMeta(annotations=null, clusterName=null, creationTimestamp=2017-04-25T23:41:54Z, deletionGracePeriodSeconds=null, deletionTimestamp=null, finalizers=[], generateName=null, generation=null, labels=null, name=catalog-catalog-controller-manager-1242994143-ddl0l.14b8c87cc177fb77, namespace=catalog, ownerReferences=[], resourceVersion=472706, selfLink=/api/v1/namespaces/catalog/events/catalog-catalog-controller-manager-1242994143-ddl0l.14b8c87cc177fb77, uid=c3851fae-2a10-11e7-a27a-080027117396, additionalProperties={}), reason=Started, source=EventSource(component=kubelet, host=minikube, additionalProperties={}), type=Normal, additionalProperties={})
因此您会注意到操作是 DELETED
,并且事件似乎描述了 Pod
的开始(注意 message=Started container with id…
数据)。
这是什么意思?我是否误解了 Action
参数试图告诉我的内容?这是否可能意味着 实际 Event
资源 和 uid=c3851fae-2a10-11e7-a27a-080027117396
已经 DELETED
(在大多数情况下这是非常无用的信息,但我可以看到,我想,如果事件是 也是 资源,那么我猜,事件表明它们已被删除)?
其实,确实就是这个意思。 Event
是一种资源,在某些情况下由 WatchEvent
表示。某些 kubectl
有关事件的操作报告是两者的混合体,但是 Event
可以删除(例如,当它名义上描述的事物消失时),并且 [=10] 的删除=] 问题由 WatchEvent
.