Skip to content

Commit 781f03c

Browse files
author
Yann Hamon
committed
Adding new schemas
1 parent 9d9b163 commit 781f03c

File tree

136 files changed

+14359
-95
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+14359
-95
lines changed

master-local/_definitions.json

Lines changed: 490 additions & 0 deletions
Large diffs are not rendered by default.

master-local/all.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,57 @@
8181
{
8282
"$ref": "_definitions.json#/definitions/io.k8s.api.admissionregistration.v1alpha1.Variable"
8383
},
84+
{
85+
"$ref": "_definitions.json#/definitions/io.k8s.api.admissionregistration.v1beta1.AuditAnnotation"
86+
},
87+
{
88+
"$ref": "_definitions.json#/definitions/io.k8s.api.admissionregistration.v1beta1.ExpressionWarning"
89+
},
90+
{
91+
"$ref": "_definitions.json#/definitions/io.k8s.api.admissionregistration.v1beta1.MatchCondition"
92+
},
93+
{
94+
"$ref": "_definitions.json#/definitions/io.k8s.api.admissionregistration.v1beta1.MatchResources"
95+
},
96+
{
97+
"$ref": "_definitions.json#/definitions/io.k8s.api.admissionregistration.v1beta1.NamedRuleWithOperations"
98+
},
99+
{
100+
"$ref": "_definitions.json#/definitions/io.k8s.api.admissionregistration.v1beta1.ParamKind"
101+
},
102+
{
103+
"$ref": "_definitions.json#/definitions/io.k8s.api.admissionregistration.v1beta1.ParamRef"
104+
},
105+
{
106+
"$ref": "_definitions.json#/definitions/io.k8s.api.admissionregistration.v1beta1.TypeChecking"
107+
},
108+
{
109+
"$ref": "_definitions.json#/definitions/io.k8s.api.admissionregistration.v1beta1.ValidatingAdmissionPolicy"
110+
},
111+
{
112+
"$ref": "_definitions.json#/definitions/io.k8s.api.admissionregistration.v1beta1.ValidatingAdmissionPolicyBinding"
113+
},
114+
{
115+
"$ref": "_definitions.json#/definitions/io.k8s.api.admissionregistration.v1beta1.ValidatingAdmissionPolicyBindingList"
116+
},
117+
{
118+
"$ref": "_definitions.json#/definitions/io.k8s.api.admissionregistration.v1beta1.ValidatingAdmissionPolicyBindingSpec"
119+
},
120+
{
121+
"$ref": "_definitions.json#/definitions/io.k8s.api.admissionregistration.v1beta1.ValidatingAdmissionPolicyList"
122+
},
123+
{
124+
"$ref": "_definitions.json#/definitions/io.k8s.api.admissionregistration.v1beta1.ValidatingAdmissionPolicySpec"
125+
},
126+
{
127+
"$ref": "_definitions.json#/definitions/io.k8s.api.admissionregistration.v1beta1.ValidatingAdmissionPolicyStatus"
128+
},
129+
{
130+
"$ref": "_definitions.json#/definitions/io.k8s.api.admissionregistration.v1beta1.Validation"
131+
},
132+
{
133+
"$ref": "_definitions.json#/definitions/io.k8s.api.admissionregistration.v1beta1.Variable"
134+
},
84135
{
85136
"$ref": "_definitions.json#/definitions/io.k8s.api.apiserverinternal.v1alpha1.ServerStorageVersion"
86137
},
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"description": "AuditAnnotation describes how to produce an audit annotation for an API request.",
3+
"properties": {
4+
"key": {
5+
"description": "key specifies the audit annotation key. The audit annotation keys of a ValidatingAdmissionPolicy must be unique. The key must be a qualified name ([A-Za-z0-9][-A-Za-z0-9_.]*) no more than 63 bytes in length.\n\nThe key is combined with the resource name of the ValidatingAdmissionPolicy to construct an audit annotation key: \"{ValidatingAdmissionPolicy name}/{key}\".\n\nIf an admission webhook uses the same resource name as this ValidatingAdmissionPolicy and the same audit annotation key, the annotation key will be identical. In this case, the first annotation written with the key will be included in the audit event and all subsequent annotations with the same key will be discarded.\n\nRequired.",
6+
"type": [
7+
"string",
8+
"null"
9+
]
10+
},
11+
"valueExpression": {
12+
"description": "valueExpression represents the expression which is evaluated by CEL to produce an audit annotation value. The expression must evaluate to either a string or null value. If the expression evaluates to a string, the audit annotation is included with the string value. If the expression evaluates to null or empty string the audit annotation will be omitted. The valueExpression may be no longer than 5kb in length. If the result of the valueExpression is more than 10kb in length, it will be truncated to 10kb.\n\nIf multiple ValidatingAdmissionPolicyBinding resources match an API request, then the valueExpression will be evaluated for each binding. All unique values produced by the valueExpressions will be joined together in a comma-separated list.\n\nRequired.",
13+
"type": [
14+
"string",
15+
"null"
16+
]
17+
}
18+
},
19+
"required": [
20+
"key",
21+
"valueExpression"
22+
],
23+
"type": "object",
24+
"$schema": "http://json-schema.org/schema#"
25+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"description": "ExpressionWarning is a warning information that targets a specific expression.",
3+
"properties": {
4+
"fieldRef": {
5+
"description": "The path to the field that refers the expression. For example, the reference to the expression of the first item of validations is \"spec.validations[0].expression\"",
6+
"type": [
7+
"string",
8+
"null"
9+
]
10+
},
11+
"warning": {
12+
"description": "The content of type checking information in a human-readable form. Each line of the warning contains the type that the expression is checked against, followed by the type check error from the compiler.",
13+
"type": [
14+
"string",
15+
"null"
16+
]
17+
}
18+
},
19+
"required": [
20+
"fieldRef",
21+
"warning"
22+
],
23+
"type": "object",
24+
"$schema": "http://json-schema.org/schema#"
25+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"description": "MatchCondition represents a condition which must be fulfilled for a request to be sent to a webhook.",
3+
"properties": {
4+
"expression": {
5+
"description": "Expression represents the expression which will be evaluated by CEL. Must evaluate to bool. CEL expressions have access to the contents of the AdmissionRequest and Authorizer, organized into CEL variables:\n\n'object' - The object from the incoming request. The value is null for DELETE requests. 'oldObject' - The existing object. The value is null for CREATE requests. 'request' - Attributes of the admission request(/pkg/apis/admission/types.go#AdmissionRequest). 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.\n See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz\n'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the\n request resource.\nDocumentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/\n\nRequired.",
6+
"type": [
7+
"string",
8+
"null"
9+
]
10+
},
11+
"name": {
12+
"description": "Name is an identifier for this match condition, used for strategic merging of MatchConditions, as well as providing an identifier for logging purposes. A good name should be descriptive of the associated expression. Name must be a qualified name consisting of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]') with an optional DNS subdomain prefix and '/' (e.g. 'example.com/MyName')\n\nRequired.",
13+
"type": [
14+
"string",
15+
"null"
16+
]
17+
}
18+
},
19+
"required": [
20+
"name",
21+
"expression"
22+
],
23+
"type": "object",
24+
"$schema": "http://json-schema.org/schema#"
25+
}

master-local/matchcondition.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"description": "MatchCondition represents a condition which must be fulfilled for a request to be sent to a webhook.",
23
"properties": {
34
"expression": {
45
"description": "Expression represents the expression which will be evaluated by CEL. Must evaluate to bool. CEL expressions have access to the contents of the AdmissionRequest and Authorizer, organized into CEL variables:\n\n'object' - The object from the incoming request. The value is null for DELETE requests. 'oldObject' - The existing object. The value is null for CREATE requests. 'request' - Attributes of the admission request(/pkg/apis/admission/types.go#AdmissionRequest). 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.\n See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz\n'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the\n request resource.\nDocumentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/\n\nRequired.",
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"description": "MatchResources decides whether to run the admission control policy on an object based on whether it meets the match criteria. The exclude rules take precedence over include rules (if a resource matches both, it is excluded)",
3+
"properties": {
4+
"excludeResourceRules": {
5+
"description": "ExcludeResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy should not care about. The exclude rules take precedence over include rules (if a resource matches both, it is excluded)",
6+
"items": {
7+
"$ref": "_definitions.json#/definitions/io.k8s.api.admissionregistration.v1beta1.NamedRuleWithOperations"
8+
},
9+
"type": [
10+
"array",
11+
"null"
12+
],
13+
"x-kubernetes-list-type": "atomic"
14+
},
15+
"matchPolicy": {
16+
"description": "matchPolicy defines how the \"MatchResources\" list is used to match incoming requests. Allowed values are \"Exact\" or \"Equivalent\".\n\n- Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but \"rules\" only included `apiGroups:[\"apps\"], apiVersions:[\"v1\"], resources: [\"deployments\"]`, a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the ValidatingAdmissionPolicy.\n\n- Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and \"rules\" only included `apiGroups:[\"apps\"], apiVersions:[\"v1\"], resources: [\"deployments\"]`, a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the ValidatingAdmissionPolicy.\n\nDefaults to \"Equivalent\"",
17+
"type": [
18+
"string",
19+
"null"
20+
]
21+
},
22+
"namespaceSelector": {
23+
"$ref": "_definitions.json#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector",
24+
"description": "NamespaceSelector decides whether to run the admission control policy on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the policy.\n\nFor example, to run the webhook on any objects whose namespace is not associated with \"runlevel\" of \"0\" or \"1\"; you will set the selector as follows: \"namespaceSelector\": {\n \"matchExpressions\": [\n {\n \"key\": \"runlevel\",\n \"operator\": \"NotIn\",\n \"values\": [\n \"0\",\n \"1\"\n ]\n }\n ]\n}\n\nIf instead you want to only run the policy on any objects whose namespace is associated with the \"environment\" of \"prod\" or \"staging\"; you will set the selector as follows: \"namespaceSelector\": {\n \"matchExpressions\": [\n {\n \"key\": \"environment\",\n \"operator\": \"In\",\n \"values\": [\n \"prod\",\n \"staging\"\n ]\n }\n ]\n}\n\nSee https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors.\n\nDefault to the empty LabelSelector, which matches everything."
25+
},
26+
"objectSelector": {
27+
"$ref": "_definitions.json#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector",
28+
"description": "ObjectSelector decides whether to run the validation based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the cel validation, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything."
29+
},
30+
"resourceRules": {
31+
"description": "ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches. The policy cares about an operation if it matches _any_ Rule.",
32+
"items": {
33+
"$ref": "_definitions.json#/definitions/io.k8s.api.admissionregistration.v1beta1.NamedRuleWithOperations"
34+
},
35+
"type": [
36+
"array",
37+
"null"
38+
],
39+
"x-kubernetes-list-type": "atomic"
40+
}
41+
},
42+
"type": "object",
43+
"x-kubernetes-map-type": "atomic",
44+
"$schema": "http://json-schema.org/schema#"
45+
}

master-local/matchresources.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"excludeResourceRules": {
55
"description": "ExcludeResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy should not care about. The exclude rules take precedence over include rules (if a resource matches both, it is excluded)",
66
"items": {
7-
"$ref": "_definitions.json#/definitions/io.k8s.api.admissionregistration.v1alpha1.NamedRuleWithOperations"
7+
"$ref": "_definitions.json#/definitions/io.k8s.api.admissionregistration.v1beta1.NamedRuleWithOperations"
88
},
99
"type": [
1010
"array",
@@ -30,7 +30,7 @@
3030
"resourceRules": {
3131
"description": "ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches. The policy cares about an operation if it matches _any_ Rule.",
3232
"items": {
33-
"$ref": "_definitions.json#/definitions/io.k8s.api.admissionregistration.v1alpha1.NamedRuleWithOperations"
33+
"$ref": "_definitions.json#/definitions/io.k8s.api.admissionregistration.v1beta1.NamedRuleWithOperations"
3434
},
3535
"type": [
3636
"array",
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{
2+
"description": "NamedRuleWithOperations is a tuple of Operations and Resources with ResourceNames.",
3+
"properties": {
4+
"apiGroups": {
5+
"description": "APIGroups is the API groups the resources belong to. '*' is all groups. If '*' is present, the length of the slice must be one. Required.",
6+
"items": {
7+
"type": [
8+
"string",
9+
"null"
10+
]
11+
},
12+
"type": [
13+
"array",
14+
"null"
15+
],
16+
"x-kubernetes-list-type": "atomic"
17+
},
18+
"apiVersions": {
19+
"description": "APIVersions is the API versions the resources belong to. '*' is all versions. If '*' is present, the length of the slice must be one. Required.",
20+
"items": {
21+
"type": [
22+
"string",
23+
"null"
24+
]
25+
},
26+
"type": [
27+
"array",
28+
"null"
29+
],
30+
"x-kubernetes-list-type": "atomic"
31+
},
32+
"operations": {
33+
"description": "Operations is the operations the admission hook cares about - CREATE, UPDATE, DELETE, CONNECT or * for all of those operations and any future admission operations that are added. If '*' is present, the length of the slice must be one. Required.",
34+
"items": {
35+
"type": [
36+
"string",
37+
"null"
38+
]
39+
},
40+
"type": [
41+
"array",
42+
"null"
43+
],
44+
"x-kubernetes-list-type": "atomic"
45+
},
46+
"resourceNames": {
47+
"description": "ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed.",
48+
"items": {
49+
"type": [
50+
"string",
51+
"null"
52+
]
53+
},
54+
"type": [
55+
"array",
56+
"null"
57+
],
58+
"x-kubernetes-list-type": "atomic"
59+
},
60+
"resources": {
61+
"description": "Resources is a list of resources this rule applies to.\n\nFor example: 'pods' means pods. 'pods/log' means the log subresource of pods. '*' means all resources, but not subresources. 'pods/*' means all subresources of pods. '*/scale' means all scale subresources. '*/*' means all resources and their subresources.\n\nIf wildcard is present, the validation rule will ensure resources do not overlap with each other.\n\nDepending on the enclosing object, subresources might not be allowed. Required.",
62+
"items": {
63+
"type": [
64+
"string",
65+
"null"
66+
]
67+
},
68+
"type": [
69+
"array",
70+
"null"
71+
],
72+
"x-kubernetes-list-type": "atomic"
73+
},
74+
"scope": {
75+
"description": "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".",
76+
"type": [
77+
"string",
78+
"null"
79+
]
80+
}
81+
},
82+
"type": "object",
83+
"x-kubernetes-map-type": "atomic",
84+
"$schema": "http://json-schema.org/schema#"
85+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"description": "ParamKind is a tuple of Group Kind and Version.",
3+
"properties": {
4+
"apiVersion": {
5+
"description": "APIVersion is the API group version the resources belong to. In format of \"group/version\". Required.",
6+
"type": [
7+
"string",
8+
"null"
9+
]
10+
},
11+
"kind": {
12+
"description": "Kind is the API kind the resources belong to. Required.",
13+
"type": [
14+
"string",
15+
"null"
16+
]
17+
}
18+
},
19+
"type": "object",
20+
"x-kubernetes-map-type": "atomic",
21+
"$schema": "http://json-schema.org/schema#"
22+
}

0 commit comments

Comments
 (0)