k8s_pb/api/flowcontrol/v1/mod.rs
1// This file is @generated by prost-build.
2/// ExemptPriorityLevelConfiguration describes the configurable aspects
3/// of the handling of exempt requests.
4/// In the mandatory exempt configuration object the values in the fields
5/// here can be modified by authorized users, unlike the rest of the `spec`.
6#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
7pub struct ExemptPriorityLevelConfiguration {
8 /// `nominalConcurrencyShares` (NCS) contributes to the computation of the
9 /// NominalConcurrencyLimit (NominalCL) of this level.
10 /// This is the number of execution seats nominally reserved for this priority level.
11 /// This DOES NOT limit the dispatching from this priority level
12 /// but affects the other priority levels through the borrowing mechanism.
13 /// The server's concurrency limit (ServerCL) is divided among all the
14 /// priority levels in proportion to their NCS values:
15 ///
16 /// NominalCL(i) = ceil( ServerCL * NCS(i) / sum_ncs )
17 /// sum_ncs = sum\[priority level k\] NCS(k)
18 ///
19 /// Bigger numbers mean a larger nominal concurrency limit,
20 /// at the expense of every other priority level.
21 /// This field has a default value of zero.
22 /// +optional
23 #[prost(int32, optional, tag = "1")]
24 pub nominal_concurrency_shares: ::core::option::Option<i32>,
25 /// `lendablePercent` prescribes the fraction of the level's NominalCL that
26 /// can be borrowed by other priority levels. This value of this
27 /// field must be between 0 and 100, inclusive, and it defaults to 0.
28 /// The number of seats that other levels can borrow from this level, known
29 /// as this level's LendableConcurrencyLimit (LendableCL), is defined as follows.
30 ///
31 /// LendableCL(i) = round( NominalCL(i) * lendablePercent(i)/100.0 )
32 ///
33 /// +optional
34 #[prost(int32, optional, tag = "2")]
35 pub lendable_percent: ::core::option::Option<i32>,
36}
37/// FlowDistinguisherMethod specifies the method of a flow distinguisher.
38#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
39pub struct FlowDistinguisherMethod {
40 /// `type` is the type of flow distinguisher method
41 /// The supported types are "ByUser" and "ByNamespace".
42 /// Required.
43 #[prost(string, optional, tag = "1")]
44 pub r#type: ::core::option::Option<::prost::alloc::string::String>,
45}
46/// FlowSchema defines the schema of a group of flows. Note that a flow is made up of a set of inbound API requests with
47/// similar attributes and is identified by a pair of strings: the name of the FlowSchema and a "flow distinguisher".
48#[derive(Clone, PartialEq, ::prost::Message)]
49pub struct FlowSchema {
50 /// `metadata` is the standard object's metadata.
51 /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata>
52 /// +optional
53 #[prost(message, optional, tag = "1")]
54 pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ObjectMeta>,
55 /// `spec` is the specification of the desired behavior of a FlowSchema.
56 /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status>
57 /// +optional
58 #[prost(message, optional, tag = "2")]
59 pub spec: ::core::option::Option<FlowSchemaSpec>,
60 /// `status` is the current status of a FlowSchema.
61 /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status>
62 /// +optional
63 #[prost(message, optional, tag = "3")]
64 pub status: ::core::option::Option<FlowSchemaStatus>,
65}
66/// FlowSchemaCondition describes conditions for a FlowSchema.
67#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
68pub struct FlowSchemaCondition {
69 /// `type` is the type of the condition.
70 /// Required.
71 #[prost(string, optional, tag = "1")]
72 pub r#type: ::core::option::Option<::prost::alloc::string::String>,
73 /// `status` is the status of the condition.
74 /// Can be True, False, Unknown.
75 /// Required.
76 #[prost(string, optional, tag = "2")]
77 pub status: ::core::option::Option<::prost::alloc::string::String>,
78 /// `lastTransitionTime` is the last time the condition transitioned from one status to another.
79 #[prost(message, optional, tag = "3")]
80 pub last_transition_time:
81 ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::Time>,
82 /// `reason` is a unique, one-word, CamelCase reason for the condition's last transition.
83 #[prost(string, optional, tag = "4")]
84 pub reason: ::core::option::Option<::prost::alloc::string::String>,
85 /// `message` is a human-readable message indicating details about last transition.
86 #[prost(string, optional, tag = "5")]
87 pub message: ::core::option::Option<::prost::alloc::string::String>,
88}
89/// FlowSchemaList is a list of FlowSchema objects.
90#[derive(Clone, PartialEq, ::prost::Message)]
91pub struct FlowSchemaList {
92 /// `metadata` is the standard list metadata.
93 /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata>
94 /// +optional
95 #[prost(message, optional, tag = "1")]
96 pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ListMeta>,
97 /// `items` is a list of FlowSchemas.
98 #[prost(message, repeated, tag = "2")]
99 pub items: ::prost::alloc::vec::Vec<FlowSchema>,
100}
101/// FlowSchemaSpec describes how the FlowSchema's specification looks like.
102#[derive(Clone, PartialEq, ::prost::Message)]
103pub struct FlowSchemaSpec {
104 /// `priorityLevelConfiguration` should reference a PriorityLevelConfiguration in the cluster. If the reference cannot
105 /// be resolved, the FlowSchema will be ignored and marked as invalid in its status.
106 /// Required.
107 #[prost(message, optional, tag = "1")]
108 pub priority_level_configuration: ::core::option::Option<PriorityLevelConfigurationReference>,
109 /// `matchingPrecedence` is used to choose among the FlowSchemas that match a given request. The chosen
110 /// FlowSchema is among those with the numerically lowest (which we take to be logically highest)
111 /// MatchingPrecedence. Each MatchingPrecedence value must be ranged in \[1,10000\].
112 /// Note that if the precedence is not specified, it will be set to 1000 as default.
113 /// +optional
114 #[prost(int32, optional, tag = "2")]
115 pub matching_precedence: ::core::option::Option<i32>,
116 /// `distinguisherMethod` defines how to compute the flow distinguisher for requests that match this schema.
117 /// `nil` specifies that the distinguisher is disabled and thus will always be the empty string.
118 /// +optional
119 #[prost(message, optional, tag = "3")]
120 pub distinguisher_method: ::core::option::Option<FlowDistinguisherMethod>,
121 /// `rules` describes which requests will match this flow schema. This FlowSchema matches a request if and only if
122 /// at least one member of rules matches the request.
123 /// if it is an empty slice, there will be no requests matching the FlowSchema.
124 /// +listType=atomic
125 /// +optional
126 #[prost(message, repeated, tag = "4")]
127 pub rules: ::prost::alloc::vec::Vec<PolicyRulesWithSubjects>,
128}
129/// FlowSchemaStatus represents the current state of a FlowSchema.
130#[derive(Clone, PartialEq, ::prost::Message)]
131pub struct FlowSchemaStatus {
132 /// `conditions` is a list of the current states of FlowSchema.
133 /// +listType=map
134 /// +listMapKey=type
135 /// +patchMergeKey=type
136 /// +patchStrategy=merge
137 /// +optional
138 #[prost(message, repeated, tag = "1")]
139 pub conditions: ::prost::alloc::vec::Vec<FlowSchemaCondition>,
140}
141/// GroupSubject holds detailed information for group-kind subject.
142#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
143pub struct GroupSubject {
144 /// name is the user group that matches, or "*" to match all user groups.
145 /// See <https://github.com/kubernetes/apiserver/blob/master/pkg/authentication/user/user.go> for some
146 /// well-known group names.
147 /// Required.
148 #[prost(string, optional, tag = "1")]
149 pub name: ::core::option::Option<::prost::alloc::string::String>,
150}
151/// LimitResponse defines how to handle requests that can not be executed right now.
152/// +union
153#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
154pub struct LimitResponse {
155 /// `type` is "Queue" or "Reject".
156 /// "Queue" means that requests that can not be executed upon arrival
157 /// are held in a queue until they can be executed or a queuing limit
158 /// is reached.
159 /// "Reject" means that requests that can not be executed upon arrival
160 /// are rejected.
161 /// Required.
162 /// +unionDiscriminator
163 #[prost(string, optional, tag = "1")]
164 pub r#type: ::core::option::Option<::prost::alloc::string::String>,
165 /// `queuing` holds the configuration parameters for queuing.
166 /// This field may be non-empty only if `type` is `"Queue"`.
167 /// +optional
168 #[prost(message, optional, tag = "2")]
169 pub queuing: ::core::option::Option<QueuingConfiguration>,
170}
171/// LimitedPriorityLevelConfiguration specifies how to handle requests that are subject to limits.
172/// It addresses two issues:
173/// - How are requests for this priority level limited?
174/// - What should be done with requests that exceed the limit?
175#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
176pub struct LimitedPriorityLevelConfiguration {
177 /// `nominalConcurrencyShares` (NCS) contributes to the computation of the
178 /// NominalConcurrencyLimit (NominalCL) of this level.
179 /// This is the number of execution seats available at this priority level.
180 /// This is used both for requests dispatched from this priority level
181 /// as well as requests dispatched from other priority levels
182 /// borrowing seats from this level.
183 /// The server's concurrency limit (ServerCL) is divided among the
184 /// Limited priority levels in proportion to their NCS values:
185 ///
186 /// NominalCL(i) = ceil( ServerCL * NCS(i) / sum_ncs )
187 /// sum_ncs = sum\[priority level k\] NCS(k)
188 ///
189 /// Bigger numbers mean a larger nominal concurrency limit,
190 /// at the expense of every other priority level.
191 ///
192 /// If not specified, this field defaults to a value of 30.
193 ///
194 /// Setting this field to zero supports the construction of a
195 /// "jail" for this priority level that is used to hold some request(s)
196 ///
197 /// +optional
198 #[prost(int32, optional, tag = "1")]
199 pub nominal_concurrency_shares: ::core::option::Option<i32>,
200 /// `limitResponse` indicates what to do with requests that can not be executed right now
201 #[prost(message, optional, tag = "2")]
202 pub limit_response: ::core::option::Option<LimitResponse>,
203 /// `lendablePercent` prescribes the fraction of the level's NominalCL that
204 /// can be borrowed by other priority levels. The value of this
205 /// field must be between 0 and 100, inclusive, and it defaults to 0.
206 /// The number of seats that other levels can borrow from this level, known
207 /// as this level's LendableConcurrencyLimit (LendableCL), is defined as follows.
208 ///
209 /// LendableCL(i) = round( NominalCL(i) * lendablePercent(i)/100.0 )
210 ///
211 /// +optional
212 #[prost(int32, optional, tag = "3")]
213 pub lendable_percent: ::core::option::Option<i32>,
214 /// `borrowingLimitPercent`, if present, configures a limit on how many
215 /// seats this priority level can borrow from other priority levels.
216 /// The limit is known as this level's BorrowingConcurrencyLimit
217 /// (BorrowingCL) and is a limit on the total number of seats that this
218 /// level may borrow at any one time.
219 /// This field holds the ratio of that limit to the level's nominal
220 /// concurrency limit. When this field is non-nil, it must hold a
221 /// non-negative integer and the limit is calculated as follows.
222 ///
223 /// BorrowingCL(i) = round( NominalCL(i) * borrowingLimitPercent(i)/100.0 )
224 ///
225 /// The value of this field can be more than 100, implying that this
226 /// priority level can borrow a number of seats that is greater than
227 /// its own nominal concurrency limit (NominalCL).
228 /// When this field is left `nil`, the limit is effectively infinite.
229 /// +optional
230 #[prost(int32, optional, tag = "4")]
231 pub borrowing_limit_percent: ::core::option::Option<i32>,
232}
233/// NonResourcePolicyRule is a predicate that matches non-resource requests according to their verb and the
234/// target non-resource URL. A NonResourcePolicyRule matches a request if and only if both (a) at least one member
235/// of verbs matches the request and (b) at least one member of nonResourceURLs matches the request.
236#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
237pub struct NonResourcePolicyRule {
238 /// `verbs` is a list of matching verbs and may not be empty.
239 /// "*" matches all verbs. If it is present, it must be the only entry.
240 /// +listType=set
241 /// Required.
242 #[prost(string, repeated, tag = "1")]
243 pub verbs: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
244 /// `nonResourceURLs` is a set of url prefixes that a user should have access to and may not be empty.
245 /// For example:
246 /// - "/healthz" is legal
247 /// - "/hea*" is illegal
248 /// - "/hea" is legal but matches nothing
249 /// - "/hea/*" also matches nothing
250 /// - "/healthz/*" matches all per-component health checks.
251 /// "*" matches all non-resource urls. if it is present, it must be the only entry.
252 /// +listType=set
253 /// Required.
254 #[prost(string, repeated, tag = "6")]
255 pub non_resource_ur_ls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
256}
257/// PolicyRulesWithSubjects prescribes a test that applies to a request to an apiserver. The test considers the subject
258/// making the request, the verb being requested, and the resource to be acted upon. This PolicyRulesWithSubjects matches
259/// a request if and only if both (a) at least one member of subjects matches the request and (b) at least one member
260/// of resourceRules or nonResourceRules matches the request.
261#[derive(Clone, PartialEq, ::prost::Message)]
262pub struct PolicyRulesWithSubjects {
263 /// subjects is the list of normal user, serviceaccount, or group that this rule cares about.
264 /// There must be at least one member in this slice.
265 /// A slice that includes both the system:authenticated and system:unauthenticated user groups matches every request.
266 /// +listType=atomic
267 /// Required.
268 #[prost(message, repeated, tag = "1")]
269 pub subjects: ::prost::alloc::vec::Vec<Subject>,
270 /// `resourceRules` is a slice of ResourcePolicyRules that identify matching requests according to their verb and the
271 /// target resource.
272 /// At least one of `resourceRules` and `nonResourceRules` has to be non-empty.
273 /// +listType=atomic
274 /// +optional
275 #[prost(message, repeated, tag = "2")]
276 pub resource_rules: ::prost::alloc::vec::Vec<ResourcePolicyRule>,
277 /// `nonResourceRules` is a list of NonResourcePolicyRules that identify matching requests according to their verb
278 /// and the target non-resource URL.
279 /// +listType=atomic
280 /// +optional
281 #[prost(message, repeated, tag = "3")]
282 pub non_resource_rules: ::prost::alloc::vec::Vec<NonResourcePolicyRule>,
283}
284/// PriorityLevelConfiguration represents the configuration of a priority level.
285#[derive(Clone, PartialEq, ::prost::Message)]
286pub struct PriorityLevelConfiguration {
287 /// `metadata` is the standard object's metadata.
288 /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata>
289 /// +optional
290 #[prost(message, optional, tag = "1")]
291 pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ObjectMeta>,
292 /// `spec` is the specification of the desired behavior of a "request-priority".
293 /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status>
294 /// +optional
295 #[prost(message, optional, tag = "2")]
296 pub spec: ::core::option::Option<PriorityLevelConfigurationSpec>,
297 /// `status` is the current status of a "request-priority".
298 /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status>
299 /// +optional
300 #[prost(message, optional, tag = "3")]
301 pub status: ::core::option::Option<PriorityLevelConfigurationStatus>,
302}
303/// PriorityLevelConfigurationCondition defines the condition of priority level.
304#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
305pub struct PriorityLevelConfigurationCondition {
306 /// `type` is the type of the condition.
307 /// Required.
308 #[prost(string, optional, tag = "1")]
309 pub r#type: ::core::option::Option<::prost::alloc::string::String>,
310 /// `status` is the status of the condition.
311 /// Can be True, False, Unknown.
312 /// Required.
313 #[prost(string, optional, tag = "2")]
314 pub status: ::core::option::Option<::prost::alloc::string::String>,
315 /// `lastTransitionTime` is the last time the condition transitioned from one status to another.
316 #[prost(message, optional, tag = "3")]
317 pub last_transition_time:
318 ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::Time>,
319 /// `reason` is a unique, one-word, CamelCase reason for the condition's last transition.
320 #[prost(string, optional, tag = "4")]
321 pub reason: ::core::option::Option<::prost::alloc::string::String>,
322 /// `message` is a human-readable message indicating details about last transition.
323 #[prost(string, optional, tag = "5")]
324 pub message: ::core::option::Option<::prost::alloc::string::String>,
325}
326/// PriorityLevelConfigurationList is a list of PriorityLevelConfiguration objects.
327#[derive(Clone, PartialEq, ::prost::Message)]
328pub struct PriorityLevelConfigurationList {
329 /// `metadata` is the standard object's metadata.
330 /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata>
331 /// +optional
332 #[prost(message, optional, tag = "1")]
333 pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ListMeta>,
334 /// `items` is a list of request-priorities.
335 #[prost(message, repeated, tag = "2")]
336 pub items: ::prost::alloc::vec::Vec<PriorityLevelConfiguration>,
337}
338/// PriorityLevelConfigurationReference contains information that points to the "request-priority" being used.
339#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
340pub struct PriorityLevelConfigurationReference {
341 /// `name` is the name of the priority level configuration being referenced
342 /// Required.
343 #[prost(string, optional, tag = "1")]
344 pub name: ::core::option::Option<::prost::alloc::string::String>,
345}
346/// PriorityLevelConfigurationSpec specifies the configuration of a priority level.
347/// +union
348#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
349pub struct PriorityLevelConfigurationSpec {
350 /// `type` indicates whether this priority level is subject to
351 /// limitation on request execution. A value of `"Exempt"` means
352 /// that requests of this priority level are not subject to a limit
353 /// (and thus are never queued) and do not detract from the
354 /// capacity made available to other priority levels. A value of
355 /// `"Limited"` means that (a) requests of this priority level
356 /// _are_ subject to limits and (b) some of the server's limited
357 /// capacity is made available exclusively to this priority level.
358 /// Required.
359 /// +unionDiscriminator
360 #[prost(string, optional, tag = "1")]
361 pub r#type: ::core::option::Option<::prost::alloc::string::String>,
362 /// `limited` specifies how requests are handled for a Limited priority level.
363 /// This field must be non-empty if and only if `type` is `"Limited"`.
364 /// +optional
365 #[prost(message, optional, tag = "2")]
366 pub limited: ::core::option::Option<LimitedPriorityLevelConfiguration>,
367 /// `exempt` specifies how requests are handled for an exempt priority level.
368 /// This field MUST be empty if `type` is `"Limited"`.
369 /// This field MAY be non-empty if `type` is `"Exempt"`.
370 /// If empty and `type` is `"Exempt"` then the default values
371 /// for `ExemptPriorityLevelConfiguration` apply.
372 /// +optional
373 #[prost(message, optional, tag = "3")]
374 pub exempt: ::core::option::Option<ExemptPriorityLevelConfiguration>,
375}
376/// PriorityLevelConfigurationStatus represents the current state of a "request-priority".
377#[derive(Clone, PartialEq, ::prost::Message)]
378pub struct PriorityLevelConfigurationStatus {
379 /// `conditions` is the current state of "request-priority".
380 /// +listType=map
381 /// +listMapKey=type
382 /// +patchMergeKey=type
383 /// +patchStrategy=merge
384 /// +optional
385 #[prost(message, repeated, tag = "1")]
386 pub conditions: ::prost::alloc::vec::Vec<PriorityLevelConfigurationCondition>,
387}
388/// QueuingConfiguration holds the configuration parameters for queuing
389#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
390pub struct QueuingConfiguration {
391 /// `queues` is the number of queues for this priority level. The
392 /// queues exist independently at each apiserver. The value must be
393 /// positive. Setting it to 1 effectively precludes
394 /// shufflesharding and thus makes the distinguisher method of
395 /// associated flow schemas irrelevant. This field has a default
396 /// value of 64.
397 /// +optional
398 #[prost(int32, optional, tag = "1")]
399 pub queues: ::core::option::Option<i32>,
400 /// `handSize` is a small positive number that configures the
401 /// shuffle sharding of requests into queues. When enqueuing a request
402 /// at this priority level the request's flow identifier (a string
403 /// pair) is hashed and the hash value is used to shuffle the list
404 /// of queues and deal a hand of the size specified here. The
405 /// request is put into one of the shortest queues in that hand.
406 /// `handSize` must be no larger than `queues`, and should be
407 /// significantly smaller (so that a few heavy flows do not
408 /// saturate most of the queues). See the user-facing
409 /// documentation for more extensive guidance on setting this
410 /// field. This field has a default value of 8.
411 /// +optional
412 #[prost(int32, optional, tag = "2")]
413 pub hand_size: ::core::option::Option<i32>,
414 /// `queueLengthLimit` is the maximum number of requests allowed to
415 /// be waiting in a given queue of this priority level at a time;
416 /// excess requests are rejected. This value must be positive. If
417 /// not specified, it will be defaulted to 50.
418 /// +optional
419 #[prost(int32, optional, tag = "3")]
420 pub queue_length_limit: ::core::option::Option<i32>,
421}
422/// ResourcePolicyRule is a predicate that matches some resource
423/// requests, testing the request's verb and the target resource. A
424/// ResourcePolicyRule matches a resource request if and only if: (a)
425/// at least one member of verbs matches the request, (b) at least one
426/// member of apiGroups matches the request, (c) at least one member of
427/// resources matches the request, and (d) either (d1) the request does
428/// not specify a namespace (i.e., `Namespace==""`) and clusterScope is
429/// true or (d2) the request specifies a namespace and least one member
430/// of namespaces matches the request's namespace.
431#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
432pub struct ResourcePolicyRule {
433 /// `verbs` is a list of matching verbs and may not be empty.
434 /// "*" matches all verbs and, if present, must be the only entry.
435 /// +listType=set
436 /// Required.
437 #[prost(string, repeated, tag = "1")]
438 pub verbs: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
439 /// `apiGroups` is a list of matching API groups and may not be empty.
440 /// "*" matches all API groups and, if present, must be the only entry.
441 /// +listType=set
442 /// Required.
443 #[prost(string, repeated, tag = "2")]
444 pub api_groups: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
445 /// `resources` is a list of matching resources (i.e., lowercase
446 /// and plural) with, if desired, subresource. For example, [
447 /// "services", "nodes/status" ]. This list may not be empty.
448 /// "*" matches all resources and, if present, must be the only entry.
449 /// Required.
450 /// +listType=set
451 #[prost(string, repeated, tag = "3")]
452 pub resources: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
453 /// `clusterScope` indicates whether to match requests that do not
454 /// specify a namespace (which happens either because the resource
455 /// is not namespaced or the request targets all namespaces).
456 /// If this field is omitted or false then the `namespaces` field
457 /// must contain a non-empty list.
458 /// +optional
459 #[prost(bool, optional, tag = "4")]
460 pub cluster_scope: ::core::option::Option<bool>,
461 /// `namespaces` is a list of target namespaces that restricts
462 /// matches. A request that specifies a target namespace matches
463 /// only if either (a) this list contains that target namespace or
464 /// (b) this list contains "*". Note that "*" matches any
465 /// specified namespace but does not match a request that _does
466 /// not specify_ a namespace (see the `clusterScope` field for
467 /// that).
468 /// This list may be empty, but only if `clusterScope` is true.
469 /// +optional
470 /// +listType=set
471 #[prost(string, repeated, tag = "5")]
472 pub namespaces: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
473}
474/// ServiceAccountSubject holds detailed information for service-account-kind subject.
475#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
476pub struct ServiceAccountSubject {
477 /// `namespace` is the namespace of matching ServiceAccount objects.
478 /// Required.
479 #[prost(string, optional, tag = "1")]
480 pub namespace: ::core::option::Option<::prost::alloc::string::String>,
481 /// `name` is the name of matching ServiceAccount objects, or "*" to match regardless of name.
482 /// Required.
483 #[prost(string, optional, tag = "2")]
484 pub name: ::core::option::Option<::prost::alloc::string::String>,
485}
486/// Subject matches the originator of a request, as identified by the request authentication system. There are three
487/// ways of matching an originator; by user, group, or service account.
488/// +union
489#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
490pub struct Subject {
491 /// `kind` indicates which one of the other fields is non-empty.
492 /// Required
493 /// +unionDiscriminator
494 #[prost(string, optional, tag = "1")]
495 pub kind: ::core::option::Option<::prost::alloc::string::String>,
496 /// `user` matches based on username.
497 /// +optional
498 #[prost(message, optional, tag = "2")]
499 pub user: ::core::option::Option<UserSubject>,
500 /// `group` matches based on user group name.
501 /// +optional
502 #[prost(message, optional, tag = "3")]
503 pub group: ::core::option::Option<GroupSubject>,
504 /// `serviceAccount` matches ServiceAccounts.
505 /// +optional
506 #[prost(message, optional, tag = "4")]
507 pub service_account: ::core::option::Option<ServiceAccountSubject>,
508}
509/// UserSubject holds detailed information for user-kind subject.
510#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
511pub struct UserSubject {
512 /// `name` is the username that matches, or "*" to match all usernames.
513 /// Required.
514 #[prost(string, optional, tag = "1")]
515 pub name: ::core::option::Option<::prost::alloc::string::String>,
516}
517
518impl crate::Resource for FlowSchema {
519 const API_VERSION: &'static str = "flowcontrol.apiserver.k8s.io/v1";
520 const GROUP: &'static str = "flowcontrol.apiserver.k8s.io";
521 const VERSION: &'static str = "v1";
522 const KIND: &'static str = "FlowSchema";
523 const URL_PATH_SEGMENT: &'static str = "flowschemas";
524 type Scope = crate::ClusterResourceScope;
525}
526impl crate::Metadata for FlowSchema {
527 type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta;
528 fn metadata(&self) -> Option<&<Self as crate::Metadata>::Ty> {
529 self.metadata.as_ref()
530 }
531 fn metadata_mut(&mut self) -> Option<&mut <Self as crate::Metadata>::Ty> {
532 self.metadata.as_mut()
533 }
534}
535impl crate::HasSpec for FlowSchema {
536 type Spec = crate::api::flowcontrol::v1::FlowSchemaSpec;
537 fn spec(&self) -> Option<&<Self as crate::HasSpec>::Spec> {
538 self.spec.as_ref()
539 }
540 fn spec_mut(&mut self) -> Option<&mut <Self as crate::HasSpec>::Spec> {
541 self.spec.as_mut()
542 }
543}
544impl crate::HasStatus for FlowSchema {
545 type Status = crate::api::flowcontrol::v1::FlowSchemaStatus;
546 fn status(&self) -> Option<&<Self as crate::HasStatus>::Status> {
547 self.status.as_ref()
548 }
549 fn status_mut(&mut self) -> Option<&mut <Self as crate::HasStatus>::Status> {
550 self.status.as_mut()
551 }
552}
553impl crate::HasConditions for FlowSchema {
554 type Condition = crate::api::flowcontrol::v1::FlowSchemaCondition;
555 fn conditions(&self) -> Option<&[<Self as crate::HasConditions>::Condition]> {
556 self.status.as_ref().map(|s| s.conditions.as_slice())
557 }
558 fn conditions_mut(&mut self) -> Option<&mut Vec<<Self as crate::HasConditions>::Condition>> {
559 self.status.as_mut().and_then(|s| Some(s.conditions.as_mut()))
560 }
561}
562
563impl crate::Resource for PriorityLevelConfiguration {
564 const API_VERSION: &'static str = "flowcontrol.apiserver.k8s.io/v1";
565 const GROUP: &'static str = "flowcontrol.apiserver.k8s.io";
566 const VERSION: &'static str = "v1";
567 const KIND: &'static str = "PriorityLevelConfiguration";
568 const URL_PATH_SEGMENT: &'static str = "prioritylevelconfigurations";
569 type Scope = crate::ClusterResourceScope;
570}
571impl crate::Metadata for PriorityLevelConfiguration {
572 type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta;
573 fn metadata(&self) -> Option<&<Self as crate::Metadata>::Ty> {
574 self.metadata.as_ref()
575 }
576 fn metadata_mut(&mut self) -> Option<&mut <Self as crate::Metadata>::Ty> {
577 self.metadata.as_mut()
578 }
579}
580impl crate::HasSpec for PriorityLevelConfiguration {
581 type Spec = crate::api::flowcontrol::v1::PriorityLevelConfigurationSpec;
582 fn spec(&self) -> Option<&<Self as crate::HasSpec>::Spec> {
583 self.spec.as_ref()
584 }
585 fn spec_mut(&mut self) -> Option<&mut <Self as crate::HasSpec>::Spec> {
586 self.spec.as_mut()
587 }
588}
589impl crate::HasStatus for PriorityLevelConfiguration {
590 type Status = crate::api::flowcontrol::v1::PriorityLevelConfigurationStatus;
591 fn status(&self) -> Option<&<Self as crate::HasStatus>::Status> {
592 self.status.as_ref()
593 }
594 fn status_mut(&mut self) -> Option<&mut <Self as crate::HasStatus>::Status> {
595 self.status.as_mut()
596 }
597}
598impl crate::HasConditions for PriorityLevelConfiguration {
599 type Condition = crate::api::flowcontrol::v1::PriorityLevelConfigurationCondition;
600 fn conditions(&self) -> Option<&[<Self as crate::HasConditions>::Condition]> {
601 self.status.as_ref().map(|s| s.conditions.as_slice())
602 }
603 fn conditions_mut(&mut self) -> Option<&mut Vec<<Self as crate::HasConditions>::Condition>> {
604 self.status.as_mut().and_then(|s| Some(s.conditions.as_mut()))
605 }
606}