|
| 1 | +// Code generated by cue get go. DO NOT EDIT. |
| 2 | + |
| 3 | +//cue:generate cue get go k8s.io/api/admission/v1 |
| 4 | + |
| 5 | +package v1 |
| 6 | + |
| 7 | +import ( |
| 8 | + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
| 9 | + "k8s.io/apimachinery/pkg/types" |
| 10 | + authenticationv1 "k8s.io/api/authentication/v1" |
| 11 | + "k8s.io/apimachinery/pkg/runtime" |
| 12 | +) |
| 13 | + |
| 14 | +// AdmissionReview describes an admission review request/response. |
| 15 | +#AdmissionReview: { |
| 16 | + metav1.#TypeMeta |
| 17 | + |
| 18 | + // Request describes the attributes for the admission request. |
| 19 | + // +optional |
| 20 | + request?: null | #AdmissionRequest @go(Request,*AdmissionRequest) @protobuf(1,bytes,opt) |
| 21 | + |
| 22 | + // Response describes the attributes for the admission response. |
| 23 | + // +optional |
| 24 | + response?: null | #AdmissionResponse @go(Response,*AdmissionResponse) @protobuf(2,bytes,opt) |
| 25 | +} |
| 26 | + |
| 27 | +// AdmissionRequest describes the admission.Attributes for the admission request. |
| 28 | +#AdmissionRequest: { |
| 29 | + // UID is an identifier for the individual request/response. It allows us to distinguish instances of requests which are |
| 30 | + // otherwise identical (parallel requests, requests when earlier requests did not modify etc) |
| 31 | + // The UID is meant to track the round trip (request/response) between the KAS and the WebHook, not the user request. |
| 32 | + // It is suitable for correlating log entries between the webhook and apiserver, for either auditing or debugging. |
| 33 | + uid: types.#UID @go(UID) @protobuf(1,bytes,opt) |
| 34 | + |
| 35 | + // Kind is the fully-qualified type of object being submitted (for example, v1.Pod or autoscaling.v1.Scale) |
| 36 | + kind: metav1.#GroupVersionKind @go(Kind) @protobuf(2,bytes,opt) |
| 37 | + |
| 38 | + // Resource is the fully-qualified resource being requested (for example, v1.pods) |
| 39 | + resource: metav1.#GroupVersionResource @go(Resource) @protobuf(3,bytes,opt) |
| 40 | + |
| 41 | + // SubResource is the subresource being requested, if any (for example, "status" or "scale") |
| 42 | + // +optional |
| 43 | + subResource?: string @go(SubResource) @protobuf(4,bytes,opt) |
| 44 | + |
| 45 | + // RequestKind is the fully-qualified type of the original API request (for example, v1.Pod or autoscaling.v1.Scale). |
| 46 | + // If this is specified and differs from the value in "kind", an equivalent match and conversion was performed. |
| 47 | + // |
| 48 | + // For example, if deployments can be modified via apps/v1 and apps/v1beta1, and a webhook registered a rule of |
| 49 | + // `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]` and `matchPolicy: Equivalent`, |
| 50 | + // an API request to apps/v1beta1 deployments would be converted and sent to the webhook |
| 51 | + // with `kind: {group:"apps", version:"v1", kind:"Deployment"}` (matching the rule the webhook registered for), |
| 52 | + // and `requestKind: {group:"apps", version:"v1beta1", kind:"Deployment"}` (indicating the kind of the original API request). |
| 53 | + // |
| 54 | + // See documentation for the "matchPolicy" field in the webhook configuration type for more details. |
| 55 | + // +optional |
| 56 | + requestKind?: null | metav1.#GroupVersionKind @go(RequestKind,*metav1.GroupVersionKind) @protobuf(13,bytes,opt) |
| 57 | + |
| 58 | + // RequestResource is the fully-qualified resource of the original API request (for example, v1.pods). |
| 59 | + // If this is specified and differs from the value in "resource", an equivalent match and conversion was performed. |
| 60 | + // |
| 61 | + // For example, if deployments can be modified via apps/v1 and apps/v1beta1, and a webhook registered a rule of |
| 62 | + // `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]` and `matchPolicy: Equivalent`, |
| 63 | + // an API request to apps/v1beta1 deployments would be converted and sent to the webhook |
| 64 | + // with `resource: {group:"apps", version:"v1", resource:"deployments"}` (matching the resource the webhook registered for), |
| 65 | + // and `requestResource: {group:"apps", version:"v1beta1", resource:"deployments"}` (indicating the resource of the original API request). |
| 66 | + // |
| 67 | + // See documentation for the "matchPolicy" field in the webhook configuration type. |
| 68 | + // +optional |
| 69 | + requestResource?: null | metav1.#GroupVersionResource @go(RequestResource,*metav1.GroupVersionResource) @protobuf(14,bytes,opt) |
| 70 | + |
| 71 | + // RequestSubResource is the name of the subresource of the original API request, if any (for example, "status" or "scale") |
| 72 | + // If this is specified and differs from the value in "subResource", an equivalent match and conversion was performed. |
| 73 | + // See documentation for the "matchPolicy" field in the webhook configuration type. |
| 74 | + // +optional |
| 75 | + requestSubResource?: string @go(RequestSubResource) @protobuf(15,bytes,opt) |
| 76 | + |
| 77 | + // Name is the name of the object as presented in the request. On a CREATE operation, the client may omit name and |
| 78 | + // rely on the server to generate the name. If that is the case, this field will contain an empty string. |
| 79 | + // +optional |
| 80 | + name?: string @go(Name) @protobuf(5,bytes,opt) |
| 81 | + |
| 82 | + // Namespace is the namespace associated with the request (if any). |
| 83 | + // +optional |
| 84 | + namespace?: string @go(Namespace) @protobuf(6,bytes,opt) |
| 85 | + |
| 86 | + // Operation is the operation being performed. This may be different than the operation |
| 87 | + // requested. e.g. a patch can result in either a CREATE or UPDATE Operation. |
| 88 | + operation: #Operation @go(Operation) @protobuf(7,bytes,opt) |
| 89 | + |
| 90 | + // UserInfo is information about the requesting user |
| 91 | + userInfo: authenticationv1.#UserInfo @go(UserInfo) @protobuf(8,bytes,opt) |
| 92 | + |
| 93 | + // Object is the object from the incoming request. |
| 94 | + // +optional |
| 95 | + object?: runtime.#RawExtension @go(Object) @protobuf(9,bytes,opt) |
| 96 | + |
| 97 | + // OldObject is the existing object. Only populated for DELETE and UPDATE requests. |
| 98 | + // +optional |
| 99 | + oldObject?: runtime.#RawExtension @go(OldObject) @protobuf(10,bytes,opt) |
| 100 | + |
| 101 | + // DryRun indicates that modifications will definitely not be persisted for this request. |
| 102 | + // Defaults to false. |
| 103 | + // +optional |
| 104 | + dryRun?: null | bool @go(DryRun,*bool) @protobuf(11,varint,opt) |
| 105 | + |
| 106 | + // Options is the operation option structure of the operation being performed. |
| 107 | + // e.g. `meta.k8s.io/v1.DeleteOptions` or `meta.k8s.io/v1.CreateOptions`. This may be |
| 108 | + // different than the options the caller provided. e.g. for a patch request the performed |
| 109 | + // Operation might be a CREATE, in which case the Options will a |
| 110 | + // `meta.k8s.io/v1.CreateOptions` even though the caller provided `meta.k8s.io/v1.PatchOptions`. |
| 111 | + // +optional |
| 112 | + options?: runtime.#RawExtension @go(Options) @protobuf(12,bytes,opt) |
| 113 | +} |
| 114 | + |
| 115 | +// AdmissionResponse describes an admission response. |
| 116 | +#AdmissionResponse: { |
| 117 | + // UID is an identifier for the individual request/response. |
| 118 | + // This must be copied over from the corresponding AdmissionRequest. |
| 119 | + uid: types.#UID @go(UID) @protobuf(1,bytes,opt) |
| 120 | + |
| 121 | + // Allowed indicates whether or not the admission request was permitted. |
| 122 | + allowed: bool @go(Allowed) @protobuf(2,varint,opt) |
| 123 | + |
| 124 | + // Result contains extra details into why an admission request was denied. |
| 125 | + // This field IS NOT consulted in any way if "Allowed" is "true". |
| 126 | + // +optional |
| 127 | + status?: null | metav1.#Status @go(Result,*metav1.Status) @protobuf(3,bytes,opt) |
| 128 | + |
| 129 | + // The patch body. Currently we only support "JSONPatch" which implements RFC 6902. |
| 130 | + // +optional |
| 131 | + patch?: bytes @go(Patch,[]byte) @protobuf(4,bytes,opt) |
| 132 | + |
| 133 | + // The type of Patch. Currently we only allow "JSONPatch". |
| 134 | + // +optional |
| 135 | + patchType?: null | #PatchType @go(PatchType,*PatchType) @protobuf(5,bytes,opt) |
| 136 | + |
| 137 | + // AuditAnnotations is an unstructured key value map set by remote admission controller (e.g. error=image-blacklisted). |
| 138 | + // MutatingAdmissionWebhook and ValidatingAdmissionWebhook admission controller will prefix the keys with |
| 139 | + // admission webhook name (e.g. imagepolicy.example.com/error=image-blacklisted). AuditAnnotations will be provided by |
| 140 | + // the admission webhook to add additional context to the audit log for this request. |
| 141 | + // +optional |
| 142 | + auditAnnotations?: {[string]: string} @go(AuditAnnotations,map[string]string) @protobuf(6,bytes,opt) |
| 143 | + |
| 144 | + // warnings is a list of warning messages to return to the requesting API client. |
| 145 | + // Warning messages describe a problem the client making the API request should correct or be aware of. |
| 146 | + // Limit warnings to 120 characters if possible. |
| 147 | + // Warnings over 256 characters and large numbers of warnings may be truncated. |
| 148 | + // +optional |
| 149 | + warnings?: [...string] @go(Warnings,[]string) @protobuf(7,bytes,rep) |
| 150 | +} |
| 151 | + |
| 152 | +// PatchType is the type of patch being used to represent the mutated object |
| 153 | +#PatchType: string // #enumPatchType |
| 154 | + |
| 155 | +#enumPatchType: |
| 156 | + #PatchTypeJSONPatch |
| 157 | + |
| 158 | +#PatchTypeJSONPatch: #PatchType & "JSONPatch" |
| 159 | + |
| 160 | +// Operation is the type of resource operation being checked for admission control |
| 161 | +#Operation: string // #enumOperation |
| 162 | + |
| 163 | +#enumOperation: |
| 164 | + #Create | |
| 165 | + #Update | |
| 166 | + #Delete | |
| 167 | + #Connect |
| 168 | + |
| 169 | +#Create: #Operation & "CREATE" |
| 170 | +#Update: #Operation & "UPDATE" |
| 171 | +#Delete: #Operation & "DELETE" |
| 172 | +#Connect: #Operation & "CONNECT" |
0 commit comments