generated.proto 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. /*
  2. Copyright The Kubernetes Authors.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. // This file was autogenerated by go-to-protobuf. Do not edit it manually!
  14. syntax = "proto2";
  15. package k8s.io.api.admission.v1;
  16. import "k8s.io/api/authentication/v1/generated.proto";
  17. import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
  18. import "k8s.io/apimachinery/pkg/runtime/generated.proto";
  19. import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
  20. // Package-wide variables from generator "generated".
  21. option go_package = "k8s.io/api/admission/v1";
  22. // AdmissionRequest describes the admission.Attributes for the admission request.
  23. message AdmissionRequest {
  24. // uid is an identifier for the individual request/response. It allows us to distinguish instances of requests which are
  25. // otherwise identical (parallel requests, requests when earlier requests did not modify etc)
  26. // The UID is meant to track the round trip (request/response) between the KAS and the WebHook, not the user request.
  27. // It is suitable for correlating log entries between the webhook and apiserver, for either auditing or debugging.
  28. optional string uid = 1;
  29. // kind is the fully-qualified type of object being submitted (for example, v1.Pod or autoscaling.v1.Scale)
  30. optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 2;
  31. // resource is the fully-qualified resource being requested (for example, v1.pods)
  32. optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 3;
  33. // subResource is the subresource being requested, if any (for example, "status" or "scale")
  34. // +optional
  35. optional string subResource = 4;
  36. // requestKind is the fully-qualified type of the original API request (for example, v1.Pod or autoscaling.v1.Scale).
  37. // If this is specified and differs from the value in "kind", an equivalent match and conversion was performed.
  38. //
  39. // For example, if deployments can be modified via apps/v1 and apps/v1beta1, and a webhook registered a rule of
  40. // `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]` and `matchPolicy: Equivalent`,
  41. // an API request to apps/v1beta1 deployments would be converted and sent to the webhook
  42. // with `kind: {group:"apps", version:"v1", kind:"Deployment"}` (matching the rule the webhook registered for),
  43. // and `requestKind: {group:"apps", version:"v1beta1", kind:"Deployment"}` (indicating the kind of the original API request).
  44. //
  45. // See documentation for the "matchPolicy" field in the webhook configuration type for more details.
  46. // +optional
  47. optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind requestKind = 13;
  48. // requestResource is the fully-qualified resource of the original API request (for example, v1.pods).
  49. // If this is specified and differs from the value in "resource", an equivalent match and conversion was performed.
  50. //
  51. // For example, if deployments can be modified via apps/v1 and apps/v1beta1, and a webhook registered a rule of
  52. // `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]` and `matchPolicy: Equivalent`,
  53. // an API request to apps/v1beta1 deployments would be converted and sent to the webhook
  54. // with `resource: {group:"apps", version:"v1", resource:"deployments"}` (matching the resource the webhook registered for),
  55. // and `requestResource: {group:"apps", version:"v1beta1", resource:"deployments"}` (indicating the resource of the original API request).
  56. //
  57. // See documentation for the "matchPolicy" field in the webhook configuration type.
  58. // +optional
  59. optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource requestResource = 14;
  60. // requestSubResource is the name of the subresource of the original API request, if any (for example, "status" or "scale")
  61. // If this is specified and differs from the value in "subResource", an equivalent match and conversion was performed.
  62. // See documentation for the "matchPolicy" field in the webhook configuration type.
  63. // +optional
  64. optional string requestSubResource = 15;
  65. // name is the name of the object as presented in the request. On a CREATE operation, the client may omit name and
  66. // rely on the server to generate the name. If that is the case, this field will contain an empty string.
  67. // +optional
  68. optional string name = 5;
  69. // namespace is the namespace associated with the request (if any).
  70. // +optional
  71. optional string namespace = 6;
  72. // operation is the operation being performed. This may be different than the operation
  73. // requested. e.g. a patch can result in either a CREATE or UPDATE Operation.
  74. optional string operation = 7;
  75. // userInfo is information about the requesting user
  76. optional .k8s.io.api.authentication.v1.UserInfo userInfo = 8;
  77. // object is the object from the incoming request.
  78. // +optional
  79. optional .k8s.io.apimachinery.pkg.runtime.RawExtension object = 9;
  80. // oldObject is the existing object. Only populated for DELETE and UPDATE requests.
  81. // +optional
  82. optional .k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 10;
  83. // dryRun indicates that modifications will definitely not be persisted for this request.
  84. // Defaults to false.
  85. // +optional
  86. optional bool dryRun = 11;
  87. // options is the operation option structure of the operation being performed.
  88. // e.g. `meta.k8s.io/v1.DeleteOptions` or `meta.k8s.io/v1.CreateOptions`. This may be
  89. // different than the options the caller provided. e.g. for a patch request the performed
  90. // Operation might be a CREATE, in which case the Options will a
  91. // `meta.k8s.io/v1.CreateOptions` even though the caller provided `meta.k8s.io/v1.PatchOptions`.
  92. // +optional
  93. optional .k8s.io.apimachinery.pkg.runtime.RawExtension options = 12;
  94. }
  95. // AdmissionResponse describes an admission response.
  96. message AdmissionResponse {
  97. // uid is an identifier for the individual request/response.
  98. // This must be copied over from the corresponding AdmissionRequest.
  99. optional string uid = 1;
  100. // allowed indicates whether or not the admission request was permitted.
  101. optional bool allowed = 2;
  102. // status is the result contains extra details into why an admission request was denied.
  103. // This field IS NOT consulted in any way if "Allowed" is "true".
  104. // +optional
  105. optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 3;
  106. // patch is the patch body. Currently we only support "JSONPatch" which implements RFC 6902.
  107. // +optional
  108. optional bytes patch = 4;
  109. // patchType is the type of Patch. Currently we only allow "JSONPatch".
  110. // +optional
  111. optional string patchType = 5;
  112. // auditAnnotations is an unstructured key value map set by remote admission controller (e.g. error=image-blacklisted).
  113. // MutatingAdmissionWebhook and ValidatingAdmissionWebhook admission controller will prefix the keys with
  114. // admission webhook name (e.g. imagepolicy.example.com/error=image-blacklisted). AuditAnnotations will be provided by
  115. // the admission webhook to add additional context to the audit log for this request.
  116. // +optional
  117. map<string, string> auditAnnotations = 6;
  118. // warnings is a list of warning messages to return to the requesting API client.
  119. // Warning messages describe a problem the client making the API request should correct or be aware of.
  120. // Limit warnings to 120 characters if possible.
  121. // Warnings over 256 characters and large numbers of warnings may be truncated.
  122. // +optional
  123. // +listType=atomic
  124. repeated string warnings = 7;
  125. }
  126. // AdmissionReview describes an admission review request/response.
  127. message AdmissionReview {
  128. // request describes the attributes for the admission request.
  129. // +optional
  130. optional AdmissionRequest request = 1;
  131. // response describes the attributes for the admission response.
  132. // +optional
  133. optional AdmissionResponse response = 2;
  134. }