cue.dev/x/crd/kyverno.io@v0.9.0

v1beta1/schema.cue raw

  1package v1beta1
  2
  3// UpdateRequest is a request to process mutate and generate rules in background.
  4#UpdateRequest: {
  5	_embeddedResource
  6
  7	// APIVersion defines the versioned schema of this representation of an object.
  8	// Servers should convert recognized schemas to the latest internal value, and
  9	// may reject unrecognized values.
 10	// More info:
 11	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
 12	apiVersion?: string
 13
 14	// Kind is a string value representing the REST resource this object represents.
 15	// Servers may infer this from the endpoint the client submits requests to.
 16	// Cannot be updated.
 17	// In CamelCase.
 18	// More info:
 19	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
 20	kind?:     string
 21	metadata?: {}
 22
 23	// ResourceSpec is the information to identify the trigger resource.
 24	spec?: {
 25		// Context ...
 26		context!: {
 27			// AdmissionRequestInfoObject stores the admission request and operation details
 28			admissionRequestInfo?: {
 29				// AdmissionRequest describes the admission.Attributes for the admission request.
 30				admissionRequest?: {
 31					// dryRun indicates that modifications will definitely not be persisted for this request.
 32					// Defaults to false.
 33					dryRun?: bool
 34
 35					// kind is the fully-qualified type of object being submitted (for example,
 36					// v1.Pod or autoscaling.v1.Scale)
 37					kind!: {
 38						group!:   string
 39						kind!:    string
 40						version!: string
 41					}
 42
 43					// name is the name of the object as presented in the request. On a CREATE
 44					// operation, the client may omit name and
 45					// rely on the server to generate the name. If that is the case, this field will
 46					// contain an empty string.
 47					name?: string
 48
 49					// namespace is the namespace associated with the request (if any).
 50					namespace?: string
 51
 52					// object is the object from the incoming request.
 53					object?: {...}
 54
 55					// oldObject is the existing object. Only populated for DELETE and UPDATE requests.
 56					oldObject?: {...}
 57
 58					// operation is the operation being performed. This may be different than the operation
 59					// requested. e.g. a patch can result in either a CREATE or UPDATE Operation.
 60					operation!: string
 61
 62					// options is the operation option structure of the operation being performed.
 63					// e.g. `meta.k8s.io/v1.DeleteOptions` or `meta.k8s.io/v1.CreateOptions`. This may be
 64					// different than the options the caller provided. e.g. for a patch request the performed
 65					// Operation might be a CREATE, in which case the Options will a
 66					// `meta.k8s.io/v1.CreateOptions` even though the caller provided `meta.k8s.io/v1.PatchOptions`.
 67					options?: {...}
 68
 69					// requestKind is the fully-qualified type of the original API request (for
 70					// example, v1.Pod or autoscaling.v1.Scale).
 71					// If this is specified and differs from the value in "kind", an equivalent
 72					// match and conversion was performed.
 73					//
 74					// For example, if deployments can be modified via apps/v1 and apps/v1beta1, and
 75					// a webhook registered a rule of
 76					// `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]` and
 77					// `matchPolicy: Equivalent`,
 78					// an API request to apps/v1beta1 deployments would be converted and sent to the webhook
 79					// with `kind: {group:"apps", version:"v1", kind:"Deployment"}` (matching the
 80					// rule the webhook registered for),
 81					// and `requestKind: {group:"apps", version:"v1beta1", kind:"Deployment"}`
 82					// (indicating the kind of the original API request).
 83					//
 84					// See documentation for the "matchPolicy" field in the webhook configuration type for more details.
 85					requestKind?: {
 86						group!:   string
 87						kind!:    string
 88						version!: string
 89					}
 90
 91					// requestResource is the fully-qualified resource of the original API request
 92					// (for example, v1.pods).
 93					// If this is specified and differs from the value in "resource", an equivalent
 94					// match and conversion was performed.
 95					//
 96					// For example, if deployments can be modified via apps/v1 and apps/v1beta1, and
 97					// a webhook registered a rule of
 98					// `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]` and
 99					// `matchPolicy: Equivalent`,
100					// an API request to apps/v1beta1 deployments would be converted and sent to the webhook
101					// with `resource: {group:"apps", version:"v1", resource:"deployments"}`
102					// (matching the resource the webhook registered for),
103					// and `requestResource: {group:"apps", version:"v1beta1",
104					// resource:"deployments"}` (indicating the resource of the original API
105					// request).
106					//
107					// See documentation for the "matchPolicy" field in the webhook configuration type.
108					requestResource?: {
109						group!:    string
110						resource!: string
111						version!:  string
112					}
113
114					// requestSubResource is the name of the subresource of the original API
115					// request, if any (for example, "status" or "scale")
116					// If this is specified and differs from the value in "subResource", an
117					// equivalent match and conversion was performed.
118					// See documentation for the "matchPolicy" field in the webhook configuration type.
119					requestSubResource?: string
120
121					// resource is the fully-qualified resource being requested (for example, v1.pods)
122					resource!: {
123						group!:    string
124						resource!: string
125						version!:  string
126					}
127
128					// subResource is the subresource being requested, if any (for example, "status" or "scale")
129					subResource?: string
130
131					// uid is an identifier for the individual request/response. It allows us to
132					// distinguish instances of requests which are
133					// otherwise identical (parallel requests, requests when earlier requests did not modify etc)
134					// The UID is meant to track the round trip (request/response) between the KAS
135					// and the WebHook, not the user request.
136					// It is suitable for correlating log entries between the webhook and apiserver,
137					// for either auditing or debugging.
138					uid!: string
139
140					// userInfo is information about the requesting user
141					userInfo!: {
142						// Any additional information provided by the authenticator.
143						extra?: [string]: [...string]
144
145						// The names of groups this user is a part of.
146						groups?: [...string]
147
148						// A unique value that identifies this user across time. If this user is
149						// deleted and another user by the same name is added, they will have
150						// different UIDs.
151						uid?: string
152
153						// The name that uniquely identifies this user among all active users.
154						username?: string
155					}
156				}
157
158				// Operation is the type of resource operation being checked for admission control
159				operation?: string
160			}
161
162			// RequestInfo contains permission info carried in an admission request.
163			userInfo?: {
164				// ClusterRoles is a list of possible clusterRoles send the request.
165				clusterRoles?: null | [...string]
166
167				// Roles is a list of possible role send the request.
168				roles?: null | [...string]
169
170				// UserInfo is the userInfo carried in the admission request.
171				userInfo?: {
172					// Any additional information provided by the authenticator.
173					extra?: [string]: [...string]
174
175					// The names of groups this user is a part of.
176					groups?: [...string]
177
178					// A unique value that identifies this user across time. If this user is
179					// deleted and another user by the same name is added, they will have
180					// different UIDs.
181					uid?: string
182
183					// The name that uniquely identifies this user among all active users.
184					username?: string
185				}
186			}
187		}
188
189		// DeleteDownstream represents whether the downstream needs to be deleted.
190		deleteDownstream!: bool
191
192		// Specifies the name of the policy.
193		policy!: string
194
195		// Type represents request type for background processing
196		requestType?: "mutate" | "generate"
197
198		// ResourceSpec is the information to identify the trigger resource.
199		resource!: {
200			// APIVersion specifies resource apiVersion.
201			apiVersion?: string
202
203			// Kind specifies resource kind.
204			kind?: string
205
206			// Name specifies the resource name.
207			name?: string
208
209			// Namespace specifies resource namespace.
210			namespace?: string
211
212			// UID specifies the resource uid.
213			uid?: string
214		}
215
216		// Rule is the associate rule name of the current UR.
217		rule!: string
218
219		// Synchronize represents the sync behavior of the corresponding rule
220		// Optional. Defaults to "false" if not specified.
221		synchronize?: bool
222	}
223
224	// Status contains statistics related to update request.
225	status?: {
226		// This will track the resources that are updated by the generate Policy.
227		// Will be used during clean up resources.
228		generatedResources?: [...{
229			// APIVersion specifies resource apiVersion.
230			apiVersion?: string
231
232			// Kind specifies resource kind.
233			kind?: string
234
235			// Name specifies the resource name.
236			name?: string
237
238			// Namespace specifies resource namespace.
239			namespace?: string
240
241			// UID specifies the resource uid.
242			uid?: string
243		}]
244
245		// Deprecated
246		handler?: string
247
248		// Specifies request status message.
249		message?:    string
250		retryCount?: int
251
252		// State represents state of the update request.
253		state!: string
254	}
255
256	_embeddedResource: {
257		apiVersion!: string
258		kind!:       string
259		metadata?:   {...}
260	}
261	apiVersion: "kyverno.io/v1beta1"
262	kind:       "UpdateRequest"
263	metadata!: {
264		name!:      string
265		namespace!: string
266		labels?: [string]:      string
267		annotations?: [string]: string
268		...
269	}
270}