1/*
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.apiextensions_apiserver.pkg.apis.apiextensions.v1beta1;
23
24import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
25import "k8s.io/apimachinery/pkg/runtime/generated.proto";
26import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
27
28// Package-wide variables from generator "generated".
29option go_package = "v1beta1";
30
31// ConversionRequest describes the conversion request parameters.
32message ConversionRequest {
33  // uid is an identifier for the individual request/response. It allows distinguishing instances of requests which are
34  // otherwise identical (parallel requests, etc).
35  // The UID is meant to track the round trip (request/response) between the Kubernetes API server and the webhook, not the user request.
36  // It is suitable for correlating log entries between the webhook and apiserver, for either auditing or debugging.
37  optional string uid = 1;
38
39  // desiredAPIVersion is the version to convert given objects to. e.g. "myapi.example.com/v1"
40  optional string desiredAPIVersion = 2;
41
42  // objects is the list of custom resource objects to be converted.
43  repeated k8s.io.apimachinery.pkg.runtime.RawExtension objects = 3;
44}
45
46// ConversionResponse describes a conversion response.
47message ConversionResponse {
48  // uid is an identifier for the individual request/response.
49  // This should be copied over from the corresponding `request.uid`.
50  optional string uid = 1;
51
52  // convertedObjects is the list of converted version of `request.objects` if the `result` is successful, otherwise empty.
53  // The webhook is expected to set `apiVersion` of these objects to the `request.desiredAPIVersion`. The list
54  // must also have the same size as the input list with the same objects in the same order (equal kind, metadata.uid, metadata.name and metadata.namespace).
55  // The webhook is allowed to mutate labels and annotations. Any other change to the metadata is silently ignored.
56  repeated k8s.io.apimachinery.pkg.runtime.RawExtension convertedObjects = 2;
57
58  // result contains the result of conversion with extra details if the conversion failed. `result.status` determines if
59  // the conversion failed or succeeded. The `result.status` field is required and represents the success or failure of the
60  // conversion. A successful conversion must set `result.status` to `Success`. A failed conversion must set
61  // `result.status` to `Failure` and provide more details in `result.message` and return http status 200. The `result.message`
62  // will be used to construct an error message for the end user.
63  optional k8s.io.apimachinery.pkg.apis.meta.v1.Status result = 3;
64}
65
66// ConversionReview describes a conversion request/response.
67message ConversionReview {
68  // request describes the attributes for the conversion request.
69  // +optional
70  optional ConversionRequest request = 1;
71
72  // response describes the attributes for the conversion response.
73  // +optional
74  optional ConversionResponse response = 2;
75}
76
77// CustomResourceColumnDefinition specifies a column for server side printing.
78message CustomResourceColumnDefinition {
79  // name is a human readable name for the column.
80  optional string name = 1;
81
82  // type is an OpenAPI type definition for this column.
83  // See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for details.
84  optional string type = 2;
85
86  // format is an optional OpenAPI type definition for this column. The 'name' format is applied
87  // to the primary identifier column to assist in clients identifying column is the resource name.
88  // See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for details.
89  // +optional
90  optional string format = 3;
91
92  // description is a human readable description of this column.
93  // +optional
94  optional string description = 4;
95
96  // priority is an integer defining the relative importance of this column compared to others. Lower
97  // numbers are considered higher priority. Columns that may be omitted in limited space scenarios
98  // should be given a priority greater than 0.
99  // +optional
100  optional int32 priority = 5;
101
102  // JSONPath is a simple JSON path (i.e. with array notation) which is evaluated against
103  // each custom resource to produce the value for this column.
104  optional string JSONPath = 6;
105}
106
107// CustomResourceConversion describes how to convert different versions of a CR.
108message CustomResourceConversion {
109  // strategy specifies how custom resources are converted between versions. Allowed values are:
110  // - `None`: The converter only change the apiVersion and would not touch any other field in the custom resource.
111  // - `Webhook`: API Server will call to an external webhook to do the conversion. Additional information
112  //   is needed for this option. This requires spec.preserveUnknownFields to be false, and spec.conversion.webhookClientConfig to be set.
113  optional string strategy = 1;
114
115  // webhookClientConfig is the instructions for how to call the webhook if strategy is `Webhook`.
116  // Required when `strategy` is set to `Webhook`.
117  // +optional
118  optional WebhookClientConfig webhookClientConfig = 2;
119
120  // conversionReviewVersions is an ordered list of preferred `ConversionReview`
121  // versions the Webhook expects. The API server will use the first version in
122  // the list which it supports. If none of the versions specified in this list
123  // are supported by API server, conversion will fail for the custom resource.
124  // If a persisted Webhook configuration specifies allowed versions and does not
125  // include any versions known to the API Server, calls to the webhook will fail.
126  // Defaults to `["v1beta1"]`.
127  // +optional
128  repeated string conversionReviewVersions = 3;
129}
130
131// CustomResourceDefinition represents a resource that should be exposed on the API server.  Its name MUST be in the format
132// <.spec.name>.<.spec.group>.
133// Deprecated in v1.16, planned for removal in v1.22. Use apiextensions.k8s.io/v1 CustomResourceDefinition instead.
134message CustomResourceDefinition {
135  optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
136
137  // spec describes how the user wants the resources to appear
138  optional CustomResourceDefinitionSpec spec = 2;
139
140  // status indicates the actual state of the CustomResourceDefinition
141  // +optional
142  optional CustomResourceDefinitionStatus status = 3;
143}
144
145// CustomResourceDefinitionCondition contains details for the current condition of this pod.
146message CustomResourceDefinitionCondition {
147  // type is the type of the condition. Types include Established, NamesAccepted and Terminating.
148  optional string type = 1;
149
150  // status is the status of the condition.
151  // Can be True, False, Unknown.
152  optional string status = 2;
153
154  // lastTransitionTime last time the condition transitioned from one status to another.
155  // +optional
156  optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
157
158  // reason is a unique, one-word, CamelCase reason for the condition's last transition.
159  // +optional
160  optional string reason = 4;
161
162  // message is a human-readable message indicating details about last transition.
163  // +optional
164  optional string message = 5;
165}
166
167// CustomResourceDefinitionList is a list of CustomResourceDefinition objects.
168message CustomResourceDefinitionList {
169  optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
170
171  // items list individual CustomResourceDefinition objects
172  repeated CustomResourceDefinition items = 2;
173}
174
175// CustomResourceDefinitionNames indicates the names to serve this CustomResourceDefinition
176message CustomResourceDefinitionNames {
177  // plural is the plural name of the resource to serve.
178  // The custom resources are served under `/apis/<group>/<version>/.../<plural>`.
179  // Must match the name of the CustomResourceDefinition (in the form `<names.plural>.<group>`).
180  // Must be all lowercase.
181  optional string plural = 1;
182
183  // singular is the singular name of the resource. It must be all lowercase. Defaults to lowercased `kind`.
184  // +optional
185  optional string singular = 2;
186
187  // shortNames are short names for the resource, exposed in API discovery documents,
188  // and used by clients to support invocations like `kubectl get <shortname>`.
189  // It must be all lowercase.
190  // +optional
191  repeated string shortNames = 3;
192
193  // kind is the serialized kind of the resource. It is normally CamelCase and singular.
194  // Custom resource instances will use this value as the `kind` attribute in API calls.
195  optional string kind = 4;
196
197  // listKind is the serialized kind of the list for this resource. Defaults to "`kind`List".
198  // +optional
199  optional string listKind = 5;
200
201  // categories is a list of grouped resources this custom resource belongs to (e.g. 'all').
202  // This is published in API discovery documents, and used by clients to support invocations like
203  // `kubectl get all`.
204  // +optional
205  repeated string categories = 6;
206}
207
208// CustomResourceDefinitionSpec describes how a user wants their resource to appear
209message CustomResourceDefinitionSpec {
210  // group is the API group of the defined custom resource.
211  // The custom resources are served under `/apis/<group>/...`.
212  // Must match the name of the CustomResourceDefinition (in the form `<names.plural>.<group>`).
213  optional string group = 1;
214
215  // version is the API version of the defined custom resource.
216  // The custom resources are served under `/apis/<group>/<version>/...`.
217  // Must match the name of the first item in the `versions` list if `version` and `versions` are both specified.
218  // Optional if `versions` is specified.
219  // Deprecated: use `versions` instead.
220  // +optional
221  optional string version = 2;
222
223  // names specify the resource and kind names for the custom resource.
224  optional CustomResourceDefinitionNames names = 3;
225
226  // scope indicates whether the defined custom resource is cluster- or namespace-scoped.
227  // Allowed values are `Cluster` and `Namespaced`. Default is `Namespaced`.
228  optional string scope = 4;
229
230  // validation describes the schema used for validation and pruning of the custom resource.
231  // If present, this validation schema is used to validate all versions.
232  // Top-level and per-version schemas are mutually exclusive.
233  // +optional
234  optional CustomResourceValidation validation = 5;
235
236  // subresources specify what subresources the defined custom resource has.
237  // If present, this field configures subresources for all versions.
238  // Top-level and per-version subresources are mutually exclusive.
239  // +optional
240  optional CustomResourceSubresources subresources = 6;
241
242  // versions is the list of all API versions of the defined custom resource.
243  // Optional if `version` is specified.
244  // The name of the first item in the `versions` list must match the `version` field if `version` and `versions` are both specified.
245  // Version names are used to compute the order in which served versions are listed in API discovery.
246  // If the version string is "kube-like", it will sort above non "kube-like" version strings, which are ordered
247  // lexicographically. "Kube-like" versions start with a "v", then are followed by a number (the major version),
248  // then optionally the string "alpha" or "beta" and another number (the minor version). These are sorted first
249  // by GA > beta > alpha (where GA is a version with no suffix such as beta or alpha), and then by comparing
250  // major version, then minor version. An example sorted list of versions:
251  // v10, v2, v1, v11beta2, v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10.
252  // +optional
253  repeated CustomResourceDefinitionVersion versions = 7;
254
255  // additionalPrinterColumns specifies additional columns returned in Table output.
256  // See https://kubernetes.io/docs/reference/using-api/api-concepts/#receiving-resources-as-tables for details.
257  // If present, this field configures columns for all versions.
258  // Top-level and per-version columns are mutually exclusive.
259  // If no top-level or per-version columns are specified, a single column displaying the age of the custom resource is used.
260  // +optional
261  repeated CustomResourceColumnDefinition additionalPrinterColumns = 8;
262
263  // conversion defines conversion settings for the CRD.
264  // +optional
265  optional CustomResourceConversion conversion = 9;
266
267  // preserveUnknownFields indicates that object fields which are not specified
268  // in the OpenAPI schema should be preserved when persisting to storage.
269  // apiVersion, kind, metadata and known fields inside metadata are always preserved.
270  // If false, schemas must be defined for all versions.
271  // Defaults to true in v1beta for backwards compatibility.
272  // Deprecated: will be required to be false in v1. Preservation of unknown fields can be specified
273  // in the validation schema using the `x-kubernetes-preserve-unknown-fields: true` extension.
274  // See https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/#pruning-versus-preserving-unknown-fields for details.
275  // +optional
276  optional bool preserveUnknownFields = 10;
277}
278
279// CustomResourceDefinitionStatus indicates the state of the CustomResourceDefinition
280message CustomResourceDefinitionStatus {
281  // conditions indicate state for particular aspects of a CustomResourceDefinition
282  // +optional
283  repeated CustomResourceDefinitionCondition conditions = 1;
284
285  // acceptedNames are the names that are actually being used to serve discovery.
286  // They may be different than the names in spec.
287  // +optional
288  optional CustomResourceDefinitionNames acceptedNames = 2;
289
290  // storedVersions lists all versions of CustomResources that were ever persisted. Tracking these
291  // versions allows a migration path for stored versions in etcd. The field is mutable
292  // so a migration controller can finish a migration to another version (ensuring
293  // no old objects are left in storage), and then remove the rest of the
294  // versions from this list.
295  // Versions may not be removed from `spec.versions` while they exist in this list.
296  // +optional
297  repeated string storedVersions = 3;
298}
299
300// CustomResourceDefinitionVersion describes a version for CRD.
301message CustomResourceDefinitionVersion {
302  // name is the version name, e.g. “v1”, “v2beta1”, etc.
303  // The custom resources are served under this version at `/apis/<group>/<version>/...` if `served` is true.
304  optional string name = 1;
305
306  // served is a flag enabling/disabling this version from being served via REST APIs
307  optional bool served = 2;
308
309  // storage indicates this version should be used when persisting custom resources to storage.
310  // There must be exactly one version with storage=true.
311  optional bool storage = 3;
312
313  // deprecated indicates this version of the custom resource API is deprecated.
314  // When set to true, API requests to this version receive a warning header in the server response.
315  // Defaults to false.
316  // +optional
317  optional bool deprecated = 7;
318
319  // deprecationWarning overrides the default warning returned to API clients.
320  // May only be set when `deprecated` is true.
321  // The default warning indicates this version is deprecated and recommends use
322  // of the newest served version of equal or greater stability, if one exists.
323  // +optional
324  optional string deprecationWarning = 8;
325
326  // schema describes the schema used for validation and pruning of this version of the custom resource.
327  // Top-level and per-version schemas are mutually exclusive.
328  // Per-version schemas must not all be set to identical values (top-level validation schema should be used instead).
329  // +optional
330  optional CustomResourceValidation schema = 4;
331
332  // subresources specify what subresources this version of the defined custom resource have.
333  // Top-level and per-version subresources are mutually exclusive.
334  // Per-version subresources must not all be set to identical values (top-level subresources should be used instead).
335  // +optional
336  optional CustomResourceSubresources subresources = 5;
337
338  // additionalPrinterColumns specifies additional columns returned in Table output.
339  // See https://kubernetes.io/docs/reference/using-api/api-concepts/#receiving-resources-as-tables for details.
340  // Top-level and per-version columns are mutually exclusive.
341  // Per-version columns must not all be set to identical values (top-level columns should be used instead).
342  // If no top-level or per-version columns are specified, a single column displaying the age of the custom resource is used.
343  // +optional
344  repeated CustomResourceColumnDefinition additionalPrinterColumns = 6;
345}
346
347// CustomResourceSubresourceScale defines how to serve the scale subresource for CustomResources.
348message CustomResourceSubresourceScale {
349  // specReplicasPath defines the JSON path inside of a custom resource that corresponds to Scale `spec.replicas`.
350  // Only JSON paths without the array notation are allowed.
351  // Must be a JSON Path under `.spec`.
352  // If there is no value under the given path in the custom resource, the `/scale` subresource will return an error on GET.
353  optional string specReplicasPath = 1;
354
355  // statusReplicasPath defines the JSON path inside of a custom resource that corresponds to Scale `status.replicas`.
356  // Only JSON paths without the array notation are allowed.
357  // Must be a JSON Path under `.status`.
358  // If there is no value under the given path in the custom resource, the `status.replicas` value in the `/scale` subresource
359  // will default to 0.
360  optional string statusReplicasPath = 2;
361
362  // labelSelectorPath defines the JSON path inside of a custom resource that corresponds to Scale `status.selector`.
363  // Only JSON paths without the array notation are allowed.
364  // Must be a JSON Path under `.status` or `.spec`.
365  // Must be set to work with HorizontalPodAutoscaler.
366  // The field pointed by this JSON path must be a string field (not a complex selector struct)
367  // which contains a serialized label selector in string form.
368  // More info: https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions#scale-subresource
369  // If there is no value under the given path in the custom resource, the `status.selector` value in the `/scale`
370  // subresource will default to the empty string.
371  // +optional
372  optional string labelSelectorPath = 3;
373}
374
375// CustomResourceSubresourceStatus defines how to serve the status subresource for CustomResources.
376// Status is represented by the `.status` JSON path inside of a CustomResource. When set,
377// * exposes a /status subresource for the custom resource
378// * PUT requests to the /status subresource take a custom resource object, and ignore changes to anything except the status stanza
379// * PUT/POST/PATCH requests to the custom resource ignore changes to the status stanza
380message CustomResourceSubresourceStatus {
381}
382
383// CustomResourceSubresources defines the status and scale subresources for CustomResources.
384message CustomResourceSubresources {
385  // status indicates the custom resource should serve a `/status` subresource.
386  // When enabled:
387  // 1. requests to the custom resource primary endpoint ignore changes to the `status` stanza of the object.
388  // 2. requests to the custom resource `/status` subresource ignore changes to anything other than the `status` stanza of the object.
389  // +optional
390  optional CustomResourceSubresourceStatus status = 1;
391
392  // scale indicates the custom resource should serve a `/scale` subresource that returns an `autoscaling/v1` Scale object.
393  // +optional
394  optional CustomResourceSubresourceScale scale = 2;
395}
396
397// CustomResourceValidation is a list of validation methods for CustomResources.
398message CustomResourceValidation {
399  // openAPIV3Schema is the OpenAPI v3 schema to use for validation and pruning.
400  // +optional
401  optional JSONSchemaProps openAPIV3Schema = 1;
402}
403
404// ExternalDocumentation allows referencing an external resource for extended documentation.
405message ExternalDocumentation {
406  optional string description = 1;
407
408  optional string url = 2;
409}
410
411// JSON represents any valid JSON value.
412// These types are supported: bool, int64, float64, string, []interface{}, map[string]interface{} and nil.
413message JSON {
414  optional bytes raw = 1;
415}
416
417// JSONSchemaProps is a JSON-Schema following Specification Draft 4 (http://json-schema.org/).
418message JSONSchemaProps {
419  optional string id = 1;
420
421  optional string schema = 2;
422
423  optional string ref = 3;
424
425  optional string description = 4;
426
427  optional string type = 5;
428
429  // format is an OpenAPI v3 format string. Unknown formats are ignored. The following formats are validated:
430  //
431  // - bsonobjectid: a bson object ID, i.e. a 24 characters hex string
432  // - uri: an URI as parsed by Golang net/url.ParseRequestURI
433  // - email: an email address as parsed by Golang net/mail.ParseAddress
434  // - hostname: a valid representation for an Internet host name, as defined by RFC 1034, section 3.1 [RFC1034].
435  // - ipv4: an IPv4 IP as parsed by Golang net.ParseIP
436  // - ipv6: an IPv6 IP as parsed by Golang net.ParseIP
437  // - cidr: a CIDR as parsed by Golang net.ParseCIDR
438  // - mac: a MAC address as parsed by Golang net.ParseMAC
439  // - uuid: an UUID that allows uppercase defined by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{12}$
440  // - uuid3: an UUID3 that allows uppercase defined by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?3[0-9a-f]{3}-?[0-9a-f]{4}-?[0-9a-f]{12}$
441  // - uuid4: an UUID4 that allows uppercase defined by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?4[0-9a-f]{3}-?[89ab][0-9a-f]{3}-?[0-9a-f]{12}$
442  // - uuid5: an UUID5 that allows uppercase defined by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?5[0-9a-f]{3}-?[89ab][0-9a-f]{3}-?[0-9a-f]{12}$
443  // - isbn: an ISBN10 or ISBN13 number string like "0321751043" or "978-0321751041"
444  // - isbn10: an ISBN10 number string like "0321751043"
445  // - isbn13: an ISBN13 number string like "978-0321751041"
446  // - creditcard: a credit card number defined by the regex ^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\\d{3})\\d{11})$ with any non digit characters mixed in
447  // - ssn: a U.S. social security number following the regex ^\\d{3}[- ]?\\d{2}[- ]?\\d{4}$
448  // - hexcolor: an hexadecimal color code like "#FFFFFF: following the regex ^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$
449  // - rgbcolor: an RGB color code like rgb like "rgb(255,255,2559"
450  // - byte: base64 encoded binary data
451  // - password: any kind of string
452  // - date: a date string like "2006-01-02" as defined by full-date in RFC3339
453  // - duration: a duration string like "22 ns" as parsed by Golang time.ParseDuration or compatible with Scala duration format
454  // - datetime: a date time string like "2014-12-15T19:30:20.000Z" as defined by date-time in RFC3339.
455  optional string format = 6;
456
457  optional string title = 7;
458
459  // default is a default value for undefined object fields.
460  // Defaulting is a beta feature under the CustomResourceDefaulting feature gate.
461  // CustomResourceDefinitions with defaults must be created using the v1 (or newer) CustomResourceDefinition API.
462  optional JSON default = 8;
463
464  optional double maximum = 9;
465
466  optional bool exclusiveMaximum = 10;
467
468  optional double minimum = 11;
469
470  optional bool exclusiveMinimum = 12;
471
472  optional int64 maxLength = 13;
473
474  optional int64 minLength = 14;
475
476  optional string pattern = 15;
477
478  optional int64 maxItems = 16;
479
480  optional int64 minItems = 17;
481
482  optional bool uniqueItems = 18;
483
484  optional double multipleOf = 19;
485
486  repeated JSON enum = 20;
487
488  optional int64 maxProperties = 21;
489
490  optional int64 minProperties = 22;
491
492  repeated string required = 23;
493
494  optional JSONSchemaPropsOrArray items = 24;
495
496  repeated JSONSchemaProps allOf = 25;
497
498  repeated JSONSchemaProps oneOf = 26;
499
500  repeated JSONSchemaProps anyOf = 27;
501
502  optional JSONSchemaProps not = 28;
503
504  map<string, JSONSchemaProps> properties = 29;
505
506  optional JSONSchemaPropsOrBool additionalProperties = 30;
507
508  map<string, JSONSchemaProps> patternProperties = 31;
509
510  map<string, JSONSchemaPropsOrStringArray> dependencies = 32;
511
512  optional JSONSchemaPropsOrBool additionalItems = 33;
513
514  map<string, JSONSchemaProps> definitions = 34;
515
516  optional ExternalDocumentation externalDocs = 35;
517
518  optional JSON example = 36;
519
520  optional bool nullable = 37;
521
522  // x-kubernetes-preserve-unknown-fields stops the API server
523  // decoding step from pruning fields which are not specified
524  // in the validation schema. This affects fields recursively,
525  // but switches back to normal pruning behaviour if nested
526  // properties or additionalProperties are specified in the schema.
527  // This can either be true or undefined. False is forbidden.
528  optional bool xKubernetesPreserveUnknownFields = 38;
529
530  // x-kubernetes-embedded-resource defines that the value is an
531  // embedded Kubernetes runtime.Object, with TypeMeta and
532  // ObjectMeta. The type must be object. It is allowed to further
533  // restrict the embedded object. kind, apiVersion and metadata
534  // are validated automatically. x-kubernetes-preserve-unknown-fields
535  // is allowed to be true, but does not have to be if the object
536  // is fully specified (up to kind, apiVersion, metadata).
537  optional bool xKubernetesEmbeddedResource = 39;
538
539  // x-kubernetes-int-or-string specifies that this value is
540  // either an integer or a string. If this is true, an empty
541  // type is allowed and type as child of anyOf is permitted
542  // if following one of the following patterns:
543  //
544  // 1) anyOf:
545  //    - type: integer
546  //    - type: string
547  // 2) allOf:
548  //    - anyOf:
549  //      - type: integer
550  //      - type: string
551  //    - ... zero or more
552  optional bool xKubernetesIntOrString = 40;
553
554  // x-kubernetes-list-map-keys annotates an array with the x-kubernetes-list-type `map` by specifying the keys used
555  // as the index of the map.
556  //
557  // This tag MUST only be used on lists that have the "x-kubernetes-list-type"
558  // extension set to "map". Also, the values specified for this attribute must
559  // be a scalar typed field of the child structure (no nesting is supported).
560  //
561  // The properties specified must either be required or have a default value,
562  // to ensure those properties are present for all list items.
563  //
564  // +optional
565  repeated string xKubernetesListMapKeys = 41;
566
567  // x-kubernetes-list-type annotates an array to further describe its topology.
568  // This extension must only be used on lists and may have 3 possible values:
569  //
570  // 1) `atomic`: the list is treated as a single entity, like a scalar.
571  //      Atomic lists will be entirely replaced when updated. This extension
572  //      may be used on any type of list (struct, scalar, ...).
573  // 2) `set`:
574  //      Sets are lists that must not have multiple items with the same value. Each
575  //      value must be a scalar, an object with x-kubernetes-map-type `atomic` or an
576  //      array with x-kubernetes-list-type `atomic`.
577  // 3) `map`:
578  //      These lists are like maps in that their elements have a non-index key
579  //      used to identify them. Order is preserved upon merge. The map tag
580  //      must only be used on a list with elements of type object.
581  // Defaults to atomic for arrays.
582  // +optional
583  optional string xKubernetesListType = 42;
584
585  // x-kubernetes-map-type annotates an object to further describe its topology.
586  // This extension must only be used when type is object and may have 2 possible values:
587  //
588  // 1) `granular`:
589  //      These maps are actual maps (key-value pairs) and each fields are independent
590  //      from each other (they can each be manipulated by separate actors). This is
591  //      the default behaviour for all maps.
592  // 2) `atomic`: the list is treated as a single entity, like a scalar.
593  //      Atomic maps will be entirely replaced when updated.
594  // +optional
595  optional string xKubernetesMapType = 43;
596}
597
598// JSONSchemaPropsOrArray represents a value that can either be a JSONSchemaProps
599// or an array of JSONSchemaProps. Mainly here for serialization purposes.
600message JSONSchemaPropsOrArray {
601  optional JSONSchemaProps schema = 1;
602
603  repeated JSONSchemaProps jSONSchemas = 2;
604}
605
606// JSONSchemaPropsOrBool represents JSONSchemaProps or a boolean value.
607// Defaults to true for the boolean property.
608message JSONSchemaPropsOrBool {
609  optional bool allows = 1;
610
611  optional JSONSchemaProps schema = 2;
612}
613
614// JSONSchemaPropsOrStringArray represents a JSONSchemaProps or a string array.
615message JSONSchemaPropsOrStringArray {
616  optional JSONSchemaProps schema = 1;
617
618  repeated string property = 2;
619}
620
621// ServiceReference holds a reference to Service.legacy.k8s.io
622message ServiceReference {
623  // namespace is the namespace of the service.
624  // Required
625  optional string namespace = 1;
626
627  // name is the name of the service.
628  // Required
629  optional string name = 2;
630
631  // path is an optional URL path at which the webhook will be contacted.
632  // +optional
633  optional string path = 3;
634
635  // port is an optional service port at which the webhook will be contacted.
636  // `port` should be a valid port number (1-65535, inclusive).
637  // Defaults to 443 for backward compatibility.
638  // +optional
639  optional int32 port = 4;
640}
641
642// WebhookClientConfig contains the information to make a TLS connection with the webhook.
643message WebhookClientConfig {
644  // url gives the location of the webhook, in standard URL form
645  // (`scheme://host:port/path`). Exactly one of `url` or `service`
646  // must be specified.
647  //
648  // The `host` should not refer to a service running in the cluster; use
649  // the `service` field instead. The host might be resolved via external
650  // DNS in some apiservers (e.g., `kube-apiserver` cannot resolve
651  // in-cluster DNS as that would be a layering violation). `host` may
652  // also be an IP address.
653  //
654  // Please note that using `localhost` or `127.0.0.1` as a `host` is
655  // risky unless you take great care to run this webhook on all hosts
656  // which run an apiserver which might need to make calls to this
657  // webhook. Such installs are likely to be non-portable, i.e., not easy
658  // to turn up in a new cluster.
659  //
660  // The scheme must be "https"; the URL must begin with "https://".
661  //
662  // A path is optional, and if present may be any string permissible in
663  // a URL. You may use the path to pass an arbitrary string to the
664  // webhook, for example, a cluster identifier.
665  //
666  // Attempting to use a user or basic auth e.g. "user:password@" is not
667  // allowed. Fragments ("#...") and query parameters ("?...") are not
668  // allowed, either.
669  //
670  // +optional
671  optional string url = 3;
672
673  // service is a reference to the service for this webhook. Either
674  // service or url must be specified.
675  //
676  // If the webhook is running within the cluster, then you should use `service`.
677  //
678  // +optional
679  optional ServiceReference service = 1;
680
681  // caBundle is a PEM encoded CA bundle which will be used to validate the webhook's server certificate.
682  // If unspecified, system trust roots on the apiserver are used.
683  // +optional
684  optional bytes caBundle = 2;
685}
686
687