/
definitions.go
57 lines (47 loc) · 1.49 KB
/
definitions.go
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
package admission
import "encoding/json"
type groupVersionKind struct {
Group string `json:"group"`
Version string `json:"version"`
Kind string `json:"kind"`
}
type groupVersionResource struct {
Group string `json:"group"`
Version string `json:"version"`
Resource string `json:"resource"`
}
type typeMeta struct {
Kind string `json:"kind,omitempty"`
APIVersion string `json:"apiVersion,omitempty"`
}
type objectMeta struct {
Name string `json:"name,omitempty"`
GenerateName string `json:"generateName,omitempty"`
}
type partialObjectMetadata struct {
typeMeta `json:",inline"`
objectMeta `json:"metadata,omitempty"`
}
type admissionReview struct {
typeMeta `json:",inline"`
Request *admissionRequest `json:"request,omitempty"`
Response *admissionResponse `json:"response,omitempty"`
}
type admissionRequest struct {
UID string `json:"uid"`
Kind groupVersionKind `json:"kind"`
Resource groupVersionResource `json:"resource"`
SubResource string `json:"subResource,omitempty"`
Name string `json:"name,omitempty"`
Namespace string `json:"namespace,omitempty"`
Operation string `json:"operation"`
Object json.RawMessage `json:"object,omitempty"`
}
type admissionResponse struct {
UID string `json:"uid"`
Allowed bool `json:"allowed"`
Result *status `json:"status,omitempty"`
}
type status struct {
Message string `json:"message,omitempty"`
}