forked from cw-ozaki/kubernetes-json-schema
-
Notifications
You must be signed in to change notification settings - Fork 0
/
watchevent.json
204 lines (204 loc) · 5.4 KB
/
watchevent.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
{
"description": "Event represents a single event to a watched resource.",
"required": [
"type",
"object"
],
"properties": {
"object": {
"description": "RawExtension is used to hold extensions in external versions.\n\nTo use this, make a field which has RawExtension as its type in your external, versioned struct, and Object in your internal struct. You also need to register your various plugin types.\n\n// Internal package: type MyAPIObject struct {\n\truntime.TypeMeta `json:\",inline\"`\n\tMyPlugin runtime.Object `json:\"myPlugin\"`\n} type PluginA struct {\n\tAOption string `json:\"aOption\"`\n}\n\n// External package: type MyAPIObject struct {\n\truntime.TypeMeta `json:\",inline\"`\n\tMyPlugin runtime.RawExtension `json:\"myPlugin\"`\n} type PluginA struct {\n\tAOption string `json:\"aOption\"`\n}\n\n// On the wire, the JSON will look something like this: {\n\t\"kind\":\"MyAPIObject\",\n\t\"apiVersion\":\"v1\",\n\t\"myPlugin\": {\n\t\t\"kind\":\"PluginA\",\n\t\t\"aOption\":\"foo\",\n\t},\n}\n\nSo what happens? Decode first uses json or yaml to unmarshal the serialized data into your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked. The next step is to copy (using pkg/conversion) into the internal struct. The runtime package's DefaultScheme has conversion functions installed which will unpack the JSON stored in RawExtension, turning it into the correct object type, and storing it in the Object. (TODO: In the case where the object is of an unknown type, a runtime.Unknown object will be created and stored.)",
"required": [
"Raw"
],
"properties": {
"Raw": {
"description": "Raw is the underlying serialization of this object.",
"type": "string",
"format": "byte"
}
},
"additionalProperties": false
},
"type": {
"type": [
"string",
"null"
]
}
},
"x-kubernetes-group-version-kind": [
{
"group": "",
"kind": "WatchEvent",
"version": "v1"
},
{
"group": "admission.k8s.io",
"kind": "WatchEvent",
"version": "v1beta1"
},
{
"group": "admissionregistration.k8s.io",
"kind": "WatchEvent",
"version": "v1alpha1"
},
{
"group": "admissionregistration.k8s.io",
"kind": "WatchEvent",
"version": "v1beta1"
},
{
"group": "apiextensions.k8s.io",
"kind": "WatchEvent",
"version": "v1beta1"
},
{
"group": "apiregistration.k8s.io",
"kind": "WatchEvent",
"version": "v1"
},
{
"group": "apiregistration.k8s.io",
"kind": "WatchEvent",
"version": "v1beta1"
},
{
"group": "apps",
"kind": "WatchEvent",
"version": "v1"
},
{
"group": "apps",
"kind": "WatchEvent",
"version": "v1beta1"
},
{
"group": "apps",
"kind": "WatchEvent",
"version": "v1beta2"
},
{
"group": "authentication.k8s.io",
"kind": "WatchEvent",
"version": "v1"
},
{
"group": "authentication.k8s.io",
"kind": "WatchEvent",
"version": "v1beta1"
},
{
"group": "authorization.k8s.io",
"kind": "WatchEvent",
"version": "v1"
},
{
"group": "authorization.k8s.io",
"kind": "WatchEvent",
"version": "v1beta1"
},
{
"group": "autoscaling",
"kind": "WatchEvent",
"version": "v1"
},
{
"group": "autoscaling",
"kind": "WatchEvent",
"version": "v2beta1"
},
{
"group": "batch",
"kind": "WatchEvent",
"version": "v1"
},
{
"group": "batch",
"kind": "WatchEvent",
"version": "v1beta1"
},
{
"group": "batch",
"kind": "WatchEvent",
"version": "v2alpha1"
},
{
"group": "certificates.k8s.io",
"kind": "WatchEvent",
"version": "v1beta1"
},
{
"group": "events.k8s.io",
"kind": "WatchEvent",
"version": "v1beta1"
},
{
"group": "extensions",
"kind": "WatchEvent",
"version": "v1beta1"
},
{
"group": "imagepolicy.k8s.io",
"kind": "WatchEvent",
"version": "v1alpha1"
},
{
"group": "networking.k8s.io",
"kind": "WatchEvent",
"version": "v1"
},
{
"group": "policy",
"kind": "WatchEvent",
"version": "v1beta1"
},
{
"group": "rbac.authorization.k8s.io",
"kind": "WatchEvent",
"version": "v1"
},
{
"group": "rbac.authorization.k8s.io",
"kind": "WatchEvent",
"version": "v1alpha1"
},
{
"group": "rbac.authorization.k8s.io",
"kind": "WatchEvent",
"version": "v1beta1"
},
{
"group": "scheduling.k8s.io",
"kind": "WatchEvent",
"version": "v1alpha1"
},
{
"group": "scheduling.k8s.io",
"kind": "WatchEvent",
"version": "v1beta1"
},
{
"group": "settings.k8s.io",
"kind": "WatchEvent",
"version": "v1alpha1"
},
{
"group": "storage.k8s.io",
"kind": "WatchEvent",
"version": "v1"
},
{
"group": "storage.k8s.io",
"kind": "WatchEvent",
"version": "v1alpha1"
},
{
"group": "storage.k8s.io",
"kind": "WatchEvent",
"version": "v1beta1"
}
],
"additionalProperties": false,
"$schema": "http://json-schema.org/schema#",
"type": "object"
}