Code refactoring for bpa operator
[icn.git] / cmd / bpa-operator / vendor / sigs.k8s.io / controller-runtime / pkg / event / event.go
1 /*
2 Copyright 2018 The Kubernetes Authors.
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8     http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15 */
16
17 package event
18
19 import (
20         "k8s.io/apimachinery/pkg/apis/meta/v1"
21         "k8s.io/apimachinery/pkg/runtime"
22 )
23
24 // CreateEvent is an event where a Kubernetes object was created.  CreateEvent should be generated
25 // by a source.Source and transformed into a reconcile.Request by an handler.EventHandler.
26 type CreateEvent struct {
27         // Meta is the ObjectMeta of the Kubernetes Type that was created
28         Meta v1.Object
29
30         // Object is the object from the event
31         Object runtime.Object
32 }
33
34 // UpdateEvent is an event where a Kubernetes object was updated.  UpdateEvent should be generated
35 // by a source.Source and transformed into a reconcile.Request by an handler.EventHandler.
36 type UpdateEvent struct {
37         // MetaOld is the ObjectMeta of the Kubernetes Type that was updated (before the update)
38         MetaOld v1.Object
39
40         // ObjectOld is the object from the event
41         ObjectOld runtime.Object
42
43         // MetaNew is the ObjectMeta of the Kubernetes Type that was updated (after the update)
44         MetaNew v1.Object
45
46         // ObjectNew is the object from the event
47         ObjectNew runtime.Object
48 }
49
50 // DeleteEvent is an event where a Kubernetes object was deleted.  DeleteEvent should be generated
51 // by a source.Source and transformed into a reconcile.Request by an handler.EventHandler.
52 type DeleteEvent struct {
53         // Meta is the ObjectMeta of the Kubernetes Type that was deleted
54         Meta v1.Object
55
56         // Object is the object from the event
57         Object runtime.Object
58
59         // DeleteStateUnknown is true if the Delete event was missed but we identified the object
60         // as having been deleted.
61         DeleteStateUnknown bool
62 }
63
64 // GenericEvent is an event where the operation type is unknown (e.g. polling or event originating outside the cluster).
65 // GenericEvent should be generated by a source.Source and transformed into a reconcile.Request by an
66 // handler.EventHandler.
67 type GenericEvent struct {
68         // Meta is the ObjectMeta of a Kubernetes Type this event is for
69         Meta v1.Object
70
71         // Object is the object from the event
72         Object runtime.Object
73 }