blob: aa2a4dd4ddc25dae587ec016cb6637337e822a19 [file] [log] [blame]
Matthias Andreas Benkard832a54e2019-01-29 09:27:38 +01001/*
2Copyright The Kubernetes Authors.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16
17
18// This file was autogenerated by go-to-protobuf. Do not edit it manually!
19
20syntax = 'proto2';
21
22package k8s.io.api.admission.v1beta1;
23
24import "k8s.io/api/authentication/v1/generated.proto";
25import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
26import "k8s.io/apimachinery/pkg/runtime/generated.proto";
27import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
28import "k8s.io/apimachinery/pkg/util/intstr/generated.proto";
29
30// Package-wide variables from generator "generated".
31option go_package = "v1beta1";
32
33// AdmissionRequest describes the admission.Attributes for the admission request.
34message AdmissionRequest {
35 // UID is an identifier for the individual request/response. It allows us to distinguish instances of requests which are
36 // otherwise identical (parallel requests, requests when earlier requests did not modify etc)
37 // The UID is meant to track the round trip (request/response) between the KAS and the WebHook, not the user request.
38 // It is suitable for correlating log entries between the webhook and apiserver, for either auditing or debugging.
39 optional string uid = 1;
40
41 // Kind is the type of object being manipulated. For example: Pod
42 optional k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 2;
43
44 // Resource is the name of the resource being requested. This is not the kind. For example: pods
45 optional k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 3;
46
47 // SubResource is the name of the subresource being requested. This is a different resource, scoped to the parent
48 // resource, but it may have a different kind. For instance, /pods has the resource "pods" and the kind "Pod", while
49 // /pods/foo/status has the resource "pods", the sub resource "status", and the kind "Pod" (because status operates on
50 // pods). The binding resource for a pod though may be /pods/foo/binding, which has resource "pods", subresource
51 // "binding", and kind "Binding".
52 // +optional
53 optional string subResource = 4;
54
55 // Name is the name of the object as presented in the request. On a CREATE operation, the client may omit name and
56 // rely on the server to generate the name. If that is the case, this method will return the empty string.
57 // +optional
58 optional string name = 5;
59
60 // Namespace is the namespace associated with the request (if any).
61 // +optional
62 optional string namespace = 6;
63
64 // Operation is the operation being performed
65 optional string operation = 7;
66
67 // UserInfo is information about the requesting user
68 optional k8s.io.api.authentication.v1.UserInfo userInfo = 8;
69
70 // Object is the object from the incoming request prior to default values being applied
71 // +optional
72 optional k8s.io.apimachinery.pkg.runtime.RawExtension object = 9;
73
74 // OldObject is the existing object. Only populated for UPDATE requests.
75 // +optional
76 optional k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 10;
77}
78
79// AdmissionResponse describes an admission response.
80message AdmissionResponse {
81 // UID is an identifier for the individual request/response.
82 // This should be copied over from the corresponding AdmissionRequest.
83 optional string uid = 1;
84
85 // Allowed indicates whether or not the admission request was permitted.
86 optional bool allowed = 2;
87
88 // Result contains extra details into why an admission request was denied.
89 // This field IS NOT consulted in any way if "Allowed" is "true".
90 // +optional
91 optional k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 3;
92
93 // The patch body. Currently we only support "JSONPatch" which implements RFC 6902.
94 // +optional
95 optional bytes patch = 4;
96
97 // The type of Patch. Currently we only allow "JSONPatch".
98 // +optional
99 optional string patchType = 5;
100}
101
102// AdmissionReview describes an admission review request/response.
103message AdmissionReview {
104 // Request describes the attributes for the admission request.
105 // +optional
106 optional AdmissionRequest request = 1;
107
108 // Response describes the attributes for the admission response.
109 // +optional
110 optional AdmissionResponse response = 2;
111}
112