k8s_pb/api/batch/v1/mod.rs
1// This file is @generated by prost-build.
2/// CronJob represents the configuration of a single cron job.
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct CronJob {
5 /// Standard object's metadata.
6 /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata>
7 /// +optional
8 #[prost(message, optional, tag = "1")]
9 pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ObjectMeta>,
10 /// Specification of the desired behavior of a cron job, including the schedule.
11 /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status>
12 /// +optional
13 #[prost(message, optional, tag = "2")]
14 pub spec: ::core::option::Option<CronJobSpec>,
15 /// Current status of a cron job.
16 /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status>
17 /// +optional
18 #[prost(message, optional, tag = "3")]
19 pub status: ::core::option::Option<CronJobStatus>,
20}
21/// CronJobList is a collection of cron jobs.
22#[derive(Clone, PartialEq, ::prost::Message)]
23pub struct CronJobList {
24 /// Standard list metadata.
25 /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata>
26 /// +optional
27 #[prost(message, optional, tag = "1")]
28 pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ListMeta>,
29 /// items is the list of CronJobs.
30 #[prost(message, repeated, tag = "2")]
31 pub items: ::prost::alloc::vec::Vec<CronJob>,
32}
33/// CronJobSpec describes how the job execution will look like and when it will actually run.
34#[derive(Clone, PartialEq, ::prost::Message)]
35pub struct CronJobSpec {
36 /// The schedule in Cron format, see <https://en.wikipedia.org/wiki/Cron.>
37 #[prost(string, optional, tag = "1")]
38 pub schedule: ::core::option::Option<::prost::alloc::string::String>,
39 /// The time zone name for the given schedule, see <https://en.wikipedia.org/wiki/List_of_tz_database_time_zones.>
40 /// If not specified, this will default to the time zone of the kube-controller-manager process.
41 /// The set of valid time zone names and the time zone offset is loaded from the system-wide time zone
42 /// database by the API server during CronJob validation and the controller manager during execution.
43 /// If no system-wide time zone database can be found a bundled version of the database is used instead.
44 /// If the time zone name becomes invalid during the lifetime of a CronJob or due to a change in host
45 /// configuration, the controller will stop creating new new Jobs and will create a system event with the
46 /// reason UnknownTimeZone.
47 /// More information can be found in <https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#time-zones>
48 /// +optional
49 #[prost(string, optional, tag = "8")]
50 pub time_zone: ::core::option::Option<::prost::alloc::string::String>,
51 /// Optional deadline in seconds for starting the job if it misses scheduled
52 /// time for any reason. Missed jobs executions will be counted as failed ones.
53 /// +optional
54 #[prost(int64, optional, tag = "2")]
55 pub starting_deadline_seconds: ::core::option::Option<i64>,
56 /// Specifies how to treat concurrent executions of a Job.
57 /// Valid values are:
58 ///
59 /// - "Allow" (default): allows CronJobs to run concurrently;
60 /// - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet;
61 /// - "Replace": cancels currently running job and replaces it with a new one
62 /// +optional
63 #[prost(string, optional, tag = "3")]
64 pub concurrency_policy: ::core::option::Option<::prost::alloc::string::String>,
65 /// This flag tells the controller to suspend subsequent executions, it does
66 /// not apply to already started executions. Defaults to false.
67 /// +optional
68 #[prost(bool, optional, tag = "4")]
69 pub suspend: ::core::option::Option<bool>,
70 /// Specifies the job that will be created when executing a CronJob.
71 #[prost(message, optional, tag = "5")]
72 pub job_template: ::core::option::Option<JobTemplateSpec>,
73 /// The number of successful finished jobs to retain. Value must be non-negative integer.
74 /// Defaults to 3.
75 /// +optional
76 #[prost(int32, optional, tag = "6")]
77 pub successful_jobs_history_limit: ::core::option::Option<i32>,
78 /// The number of failed finished jobs to retain. Value must be non-negative integer.
79 /// Defaults to 1.
80 /// +optional
81 #[prost(int32, optional, tag = "7")]
82 pub failed_jobs_history_limit: ::core::option::Option<i32>,
83}
84/// CronJobStatus represents the current state of a cron job.
85#[derive(Clone, PartialEq, ::prost::Message)]
86pub struct CronJobStatus {
87 /// A list of pointers to currently running jobs.
88 /// +optional
89 /// +listType=atomic
90 #[prost(message, repeated, tag = "1")]
91 pub active: ::prost::alloc::vec::Vec<super::super::core::v1::ObjectReference>,
92 /// Information when was the last time the job was successfully scheduled.
93 /// +optional
94 #[prost(message, optional, tag = "4")]
95 pub last_schedule_time:
96 ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::Time>,
97 /// Information when was the last time the job successfully completed.
98 /// +optional
99 #[prost(message, optional, tag = "5")]
100 pub last_successful_time:
101 ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::Time>,
102}
103/// Job represents the configuration of a single job.
104#[derive(Clone, PartialEq, ::prost::Message)]
105pub struct Job {
106 /// Standard object's metadata.
107 /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata>
108 /// +optional
109 #[prost(message, optional, tag = "1")]
110 pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ObjectMeta>,
111 /// Specification of the desired behavior of a job.
112 /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status>
113 /// +optional
114 #[prost(message, optional, tag = "2")]
115 pub spec: ::core::option::Option<JobSpec>,
116 /// Current status of a job.
117 /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status>
118 /// +optional
119 #[prost(message, optional, tag = "3")]
120 pub status: ::core::option::Option<JobStatus>,
121}
122/// JobCondition describes current state of a job.
123#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
124pub struct JobCondition {
125 /// Type of job condition, Complete or Failed.
126 #[prost(string, optional, tag = "1")]
127 pub r#type: ::core::option::Option<::prost::alloc::string::String>,
128 /// Status of the condition, one of True, False, Unknown.
129 #[prost(string, optional, tag = "2")]
130 pub status: ::core::option::Option<::prost::alloc::string::String>,
131 /// Last time the condition was checked.
132 /// +optional
133 #[prost(message, optional, tag = "3")]
134 pub last_probe_time: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::Time>,
135 /// Last time the condition transit from one status to another.
136 /// +optional
137 #[prost(message, optional, tag = "4")]
138 pub last_transition_time:
139 ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::Time>,
140 /// (brief) reason for the condition's last transition.
141 /// +optional
142 #[prost(string, optional, tag = "5")]
143 pub reason: ::core::option::Option<::prost::alloc::string::String>,
144 /// Human readable message indicating details about last transition.
145 /// +optional
146 #[prost(string, optional, tag = "6")]
147 pub message: ::core::option::Option<::prost::alloc::string::String>,
148}
149/// JobList is a collection of jobs.
150#[derive(Clone, PartialEq, ::prost::Message)]
151pub struct JobList {
152 /// Standard list metadata.
153 /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata>
154 /// +optional
155 #[prost(message, optional, tag = "1")]
156 pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ListMeta>,
157 /// items is the list of Jobs.
158 #[prost(message, repeated, tag = "2")]
159 pub items: ::prost::alloc::vec::Vec<Job>,
160}
161/// JobSpec describes how the job execution will look like.
162#[derive(Clone, PartialEq, ::prost::Message)]
163pub struct JobSpec {
164 /// Specifies the maximum desired number of pods the job should
165 /// run at any given time. The actual number of pods running in steady state will
166 /// be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism),
167 /// i.e. when the work left to do is less than max parallelism.
168 /// More info: <https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/>
169 /// +optional
170 #[prost(int32, optional, tag = "1")]
171 pub parallelism: ::core::option::Option<i32>,
172 /// Specifies the desired number of successfully finished pods the
173 /// job should be run with. Setting to null means that the success of any
174 /// pod signals the success of all pods, and allows parallelism to have any positive
175 /// value. Setting to 1 means that parallelism is limited to 1 and the success of that
176 /// pod signals the success of the job.
177 /// More info: <https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/>
178 /// +optional
179 #[prost(int32, optional, tag = "2")]
180 pub completions: ::core::option::Option<i32>,
181 /// Specifies the duration in seconds relative to the startTime that the job
182 /// may be continuously active before the system tries to terminate it; value
183 /// must be positive integer. If a Job is suspended (at creation or through an
184 /// update), this timer will effectively be stopped and reset when the Job is
185 /// resumed again.
186 /// +optional
187 #[prost(int64, optional, tag = "3")]
188 pub active_deadline_seconds: ::core::option::Option<i64>,
189 /// Specifies the policy of handling failed pods. In particular, it allows to
190 /// specify the set of actions and conditions which need to be
191 /// satisfied to take the associated action.
192 /// If empty, the default behaviour applies - the counter of failed pods,
193 /// represented by the jobs's .status.failed field, is incremented and it is
194 /// checked against the backoffLimit. This field cannot be used in combination
195 /// with restartPolicy=OnFailure.
196 ///
197 /// +optional
198 #[prost(message, optional, tag = "11")]
199 pub pod_failure_policy: ::core::option::Option<PodFailurePolicy>,
200 /// successPolicy specifies the policy when the Job can be declared as succeeded.
201 /// If empty, the default behavior applies - the Job is declared as succeeded
202 /// only when the number of succeeded pods equals to the completions.
203 /// When the field is specified, it must be immutable and works only for the Indexed Jobs.
204 /// Once the Job meets the SuccessPolicy, the lingering pods are terminated.
205 ///
206 /// +optional
207 #[prost(message, optional, tag = "16")]
208 pub success_policy: ::core::option::Option<SuccessPolicy>,
209 /// Specifies the number of retries before marking this job failed.
210 /// Defaults to 6, unless backoffLimitPerIndex (only Indexed Job) is specified.
211 /// When backoffLimitPerIndex is specified, backoffLimit defaults to 2147483647.
212 /// +optional
213 #[prost(int32, optional, tag = "7")]
214 pub backoff_limit: ::core::option::Option<i32>,
215 /// Specifies the limit for the number of retries within an
216 /// index before marking this index as failed. When enabled the number of
217 /// failures per index is kept in the pod's
218 /// batch.kubernetes.io/job-index-failure-count annotation. It can only
219 /// be set when Job's completionMode=Indexed, and the Pod's restart
220 /// policy is Never. The field is immutable.
221 /// +optional
222 #[prost(int32, optional, tag = "12")]
223 pub backoff_limit_per_index: ::core::option::Option<i32>,
224 /// Specifies the maximal number of failed indexes before marking the Job as
225 /// failed, when backoffLimitPerIndex is set. Once the number of failed
226 /// indexes exceeds this number the entire Job is marked as Failed and its
227 /// execution is terminated. When left as null the job continues execution of
228 /// all of its indexes and is marked with the `Complete` Job condition.
229 /// It can only be specified when backoffLimitPerIndex is set.
230 /// It can be null or up to completions. It is required and must be
231 /// less than or equal to 10^4 when is completions greater than 10^5.
232 /// +optional
233 #[prost(int32, optional, tag = "13")]
234 pub max_failed_indexes: ::core::option::Option<i32>,
235 /// A label query over pods that should match the pod count.
236 /// Normally, the system sets this field for you.
237 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors>
238 /// +optional
239 #[prost(message, optional, tag = "4")]
240 pub selector:
241 ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::LabelSelector>,
242 /// manualSelector controls generation of pod labels and pod selectors.
243 /// Leave `manualSelector` unset unless you are certain what you are doing.
244 /// When false or unset, the system pick labels unique to this job
245 /// and appends those labels to the pod template. When true,
246 /// the user is responsible for picking unique labels and specifying
247 /// the selector. Failure to pick a unique label may cause this
248 /// and other jobs to not function correctly. However, You may see
249 /// `manualSelector=true` in jobs that were created with the old `extensions/v1beta1`
250 /// API.
251 /// More info: <https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector>
252 /// +optional
253 #[prost(bool, optional, tag = "5")]
254 pub manual_selector: ::core::option::Option<bool>,
255 /// Describes the pod that will be created when executing a job.
256 /// The only allowed template.spec.restartPolicy values are "Never" or "OnFailure".
257 /// More info: <https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/>
258 #[prost(message, optional, tag = "6")]
259 pub template: ::core::option::Option<super::super::core::v1::PodTemplateSpec>,
260 /// ttlSecondsAfterFinished limits the lifetime of a Job that has finished
261 /// execution (either Complete or Failed). If this field is set,
262 /// ttlSecondsAfterFinished after the Job finishes, it is eligible to be
263 /// automatically deleted. When the Job is being deleted, its lifecycle
264 /// guarantees (e.g. finalizers) will be honored. If this field is unset,
265 /// the Job won't be automatically deleted. If this field is set to zero,
266 /// the Job becomes eligible to be deleted immediately after it finishes.
267 /// +optional
268 #[prost(int32, optional, tag = "8")]
269 pub ttl_seconds_after_finished: ::core::option::Option<i32>,
270 /// completionMode specifies how Pod completions are tracked. It can be
271 /// `NonIndexed` (default) or `Indexed`.
272 ///
273 /// `NonIndexed` means that the Job is considered complete when there have
274 /// been .spec.completions successfully completed Pods. Each Pod completion is
275 /// homologous to each other.
276 ///
277 /// `Indexed` means that the Pods of a
278 /// Job get an associated completion index from 0 to (.spec.completions - 1),
279 /// available in the annotation batch.kubernetes.io/job-completion-index.
280 /// The Job is considered complete when there is one successfully completed Pod
281 /// for each index.
282 /// When value is `Indexed`, .spec.completions must be specified and
283 /// `.spec.parallelism` must be less than or equal to 10^5.
284 /// In addition, The Pod name takes the form
285 /// `$(job-name)-$(index)-$(random-string)`,
286 /// the Pod hostname takes the form `$(job-name)-$(index)`.
287 ///
288 /// More completion modes can be added in the future.
289 /// If the Job controller observes a mode that it doesn't recognize, which
290 /// is possible during upgrades due to version skew, the controller
291 /// skips updates for the Job.
292 /// +optional
293 #[prost(string, optional, tag = "9")]
294 pub completion_mode: ::core::option::Option<::prost::alloc::string::String>,
295 /// suspend specifies whether the Job controller should create Pods or not. If
296 /// a Job is created with suspend set to true, no Pods are created by the Job
297 /// controller. If a Job is suspended after creation (i.e. the flag goes from
298 /// false to true), the Job controller will delete all active Pods associated
299 /// with this Job. Users must design their workload to gracefully handle this.
300 /// Suspending a Job will reset the StartTime field of the Job, effectively
301 /// resetting the ActiveDeadlineSeconds timer too. Defaults to false.
302 ///
303 /// +optional
304 #[prost(bool, optional, tag = "10")]
305 pub suspend: ::core::option::Option<bool>,
306 /// podReplacementPolicy specifies when to create replacement Pods.
307 /// Possible values are:
308 /// - TerminatingOrFailed means that we recreate pods
309 /// when they are terminating (has a metadata.deletionTimestamp) or failed.
310 /// - Failed means to wait until a previously created Pod is fully terminated (has phase
311 /// Failed or Succeeded) before creating a replacement Pod.
312 ///
313 /// When using podFailurePolicy, Failed is the the only allowed value.
314 /// TerminatingOrFailed and Failed are allowed values when podFailurePolicy is not in use.
315 /// +optional
316 #[prost(string, optional, tag = "14")]
317 pub pod_replacement_policy: ::core::option::Option<::prost::alloc::string::String>,
318 /// ManagedBy field indicates the controller that manages a Job. The k8s Job
319 /// controller reconciles jobs which don't have this field at all or the field
320 /// value is the reserved string `kubernetes.io/job-controller`, but skips
321 /// reconciling Jobs with a custom value for this field.
322 /// The value must be a valid domain-prefixed path (e.g. acme.io/foo) -
323 /// all characters before the first "/" must be a valid subdomain as defined
324 /// by RFC 1123. All characters trailing the first "/" must be valid HTTP Path
325 /// characters as defined by RFC 3986. The value cannot exceed 63 characters.
326 /// This field is immutable.
327 /// +optional
328 #[prost(string, optional, tag = "15")]
329 pub managed_by: ::core::option::Option<::prost::alloc::string::String>,
330}
331/// JobStatus represents the current state of a Job.
332#[derive(Clone, PartialEq, ::prost::Message)]
333pub struct JobStatus {
334 /// The latest available observations of an object's current state. When a Job
335 /// fails, one of the conditions will have type "Failed" and status true. When
336 /// a Job is suspended, one of the conditions will have type "Suspended" and
337 /// status true; when the Job is resumed, the status of this condition will
338 /// become false. When a Job is completed, one of the conditions will have
339 /// type "Complete" and status true.
340 ///
341 /// A job is considered finished when it is in a terminal condition, either
342 /// "Complete" or "Failed". A Job cannot have both the "Complete" and "Failed" conditions.
343 /// Additionally, it cannot be in the "Complete" and "FailureTarget" conditions.
344 /// The "Complete", "Failed" and "FailureTarget" conditions cannot be disabled.
345 ///
346 /// More info: <https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/>
347 /// +optional
348 /// +patchMergeKey=type
349 /// +patchStrategy=merge
350 /// +listType=atomic
351 #[prost(message, repeated, tag = "1")]
352 pub conditions: ::prost::alloc::vec::Vec<JobCondition>,
353 /// Represents time when the job controller started processing a job. When a
354 /// Job is created in the suspended state, this field is not set until the
355 /// first time it is resumed. This field is reset every time a Job is resumed
356 /// from suspension. It is represented in RFC3339 form and is in UTC.
357 ///
358 /// Once set, the field can only be removed when the job is suspended.
359 /// The field cannot be modified while the job is unsuspended or finished.
360 ///
361 /// +optional
362 #[prost(message, optional, tag = "2")]
363 pub start_time: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::Time>,
364 /// Represents time when the job was completed. It is not guaranteed to
365 /// be set in happens-before order across separate operations.
366 /// It is represented in RFC3339 form and is in UTC.
367 /// The completion time is set when the job finishes successfully, and only then.
368 /// The value cannot be updated or removed. The value indicates the same or
369 /// later point in time as the startTime field.
370 /// +optional
371 #[prost(message, optional, tag = "3")]
372 pub completion_time: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::Time>,
373 /// The number of pending and running pods which are not terminating (without
374 /// a deletionTimestamp).
375 /// The value is zero for finished jobs.
376 /// +optional
377 #[prost(int32, optional, tag = "4")]
378 pub active: ::core::option::Option<i32>,
379 /// The number of pods which reached phase Succeeded.
380 /// The value increases monotonically for a given spec. However, it may
381 /// decrease in reaction to scale down of elastic indexed jobs.
382 /// +optional
383 #[prost(int32, optional, tag = "5")]
384 pub succeeded: ::core::option::Option<i32>,
385 /// The number of pods which reached phase Failed.
386 /// The value increases monotonically.
387 /// +optional
388 #[prost(int32, optional, tag = "6")]
389 pub failed: ::core::option::Option<i32>,
390 /// The number of pods which are terminating (in phase Pending or Running
391 /// and have a deletionTimestamp).
392 ///
393 /// This field is beta-level. The job controller populates the field when
394 /// the feature gate JobPodReplacementPolicy is enabled (enabled by default).
395 /// +optional
396 #[prost(int32, optional, tag = "11")]
397 pub terminating: ::core::option::Option<i32>,
398 /// completedIndexes holds the completed indexes when .spec.completionMode =
399 /// "Indexed" in a text format. The indexes are represented as decimal integers
400 /// separated by commas. The numbers are listed in increasing order. Three or
401 /// more consecutive numbers are compressed and represented by the first and
402 /// last element of the series, separated by a hyphen.
403 /// For example, if the completed indexes are 1, 3, 4, 5 and 7, they are
404 /// represented as "1,3-5,7".
405 /// +optional
406 #[prost(string, optional, tag = "7")]
407 pub completed_indexes: ::core::option::Option<::prost::alloc::string::String>,
408 /// FailedIndexes holds the failed indexes when spec.backoffLimitPerIndex is set.
409 /// The indexes are represented in the text format analogous as for the
410 /// `completedIndexes` field, ie. they are kept as decimal integers
411 /// separated by commas. The numbers are listed in increasing order. Three or
412 /// more consecutive numbers are compressed and represented by the first and
413 /// last element of the series, separated by a hyphen.
414 /// For example, if the failed indexes are 1, 3, 4, 5 and 7, they are
415 /// represented as "1,3-5,7".
416 /// The set of failed indexes cannot overlap with the set of completed indexes.
417 ///
418 /// +optional
419 #[prost(string, optional, tag = "10")]
420 pub failed_indexes: ::core::option::Option<::prost::alloc::string::String>,
421 /// uncountedTerminatedPods holds the UIDs of Pods that have terminated but
422 /// the job controller hasn't yet accounted for in the status counters.
423 ///
424 /// The job controller creates pods with a finalizer. When a pod terminates
425 /// (succeeded or failed), the controller does three steps to account for it
426 /// in the job status:
427 ///
428 /// 1. Add the pod UID to the arrays in this field.
429 /// 2. Remove the pod finalizer.
430 /// 3. Remove the pod UID from the arrays while increasing the corresponding
431 /// counter.
432 ///
433 /// Old jobs might not be tracked using this field, in which case the field
434 /// remains null.
435 /// The structure is empty for finished jobs.
436 /// +optional
437 #[prost(message, optional, tag = "8")]
438 pub uncounted_terminated_pods: ::core::option::Option<UncountedTerminatedPods>,
439 /// The number of active pods which have a Ready condition and are not
440 /// terminating (without a deletionTimestamp).
441 #[prost(int32, optional, tag = "9")]
442 pub ready: ::core::option::Option<i32>,
443}
444/// JobTemplateSpec describes the data a Job should have when created from a template
445#[derive(Clone, PartialEq, ::prost::Message)]
446pub struct JobTemplateSpec {
447 /// Standard object's metadata of the jobs created from this template.
448 /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata>
449 /// +optional
450 #[prost(message, optional, tag = "1")]
451 pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ObjectMeta>,
452 /// Specification of the desired behavior of the job.
453 /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status>
454 /// +optional
455 #[prost(message, optional, tag = "2")]
456 pub spec: ::core::option::Option<JobSpec>,
457}
458/// PodFailurePolicy describes how failed pods influence the backoffLimit.
459#[derive(Clone, PartialEq, ::prost::Message)]
460pub struct PodFailurePolicy {
461 /// A list of pod failure policy rules. The rules are evaluated in order.
462 /// Once a rule matches a Pod failure, the remaining of the rules are ignored.
463 /// When no rule matches the Pod failure, the default handling applies - the
464 /// counter of pod failures is incremented and it is checked against
465 /// the backoffLimit. At most 20 elements are allowed.
466 /// +listType=atomic
467 #[prost(message, repeated, tag = "1")]
468 pub rules: ::prost::alloc::vec::Vec<PodFailurePolicyRule>,
469}
470/// PodFailurePolicyOnExitCodesRequirement describes the requirement for handling
471/// a failed pod based on its container exit codes. In particular, it lookups the
472/// .state.terminated.exitCode for each app container and init container status,
473/// represented by the .status.containerStatuses and .status.initContainerStatuses
474/// fields in the Pod status, respectively. Containers completed with success
475/// (exit code 0) are excluded from the requirement check.
476#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
477pub struct PodFailurePolicyOnExitCodesRequirement {
478 /// Restricts the check for exit codes to the container with the
479 /// specified name. When null, the rule applies to all containers.
480 /// When specified, it should match one the container or initContainer
481 /// names in the pod template.
482 /// +optional
483 #[prost(string, optional, tag = "1")]
484 pub container_name: ::core::option::Option<::prost::alloc::string::String>,
485 /// Represents the relationship between the container exit code(s) and the
486 /// specified values. Containers completed with success (exit code 0) are
487 /// excluded from the requirement check. Possible values are:
488 ///
489 /// - In: the requirement is satisfied if at least one container exit code
490 /// (might be multiple if there are multiple containers not restricted
491 /// by the 'containerName' field) is in the set of specified values.
492 /// - NotIn: the requirement is satisfied if at least one container exit code
493 /// (might be multiple if there are multiple containers not restricted
494 /// by the 'containerName' field) is not in the set of specified values.
495 /// Additional values are considered to be added in the future. Clients should
496 /// react to an unknown operator by assuming the requirement is not satisfied.
497 #[prost(string, optional, tag = "2")]
498 pub operator: ::core::option::Option<::prost::alloc::string::String>,
499 /// Specifies the set of values. Each returned container exit code (might be
500 /// multiple in case of multiple containers) is checked against this set of
501 /// values with respect to the operator. The list of values must be ordered
502 /// and must not contain duplicates. Value '0' cannot be used for the In operator.
503 /// At least one element is required. At most 255 elements are allowed.
504 /// +listType=set
505 #[prost(int32, repeated, packed = "false", tag = "3")]
506 pub values: ::prost::alloc::vec::Vec<i32>,
507}
508/// PodFailurePolicyOnPodConditionsPattern describes a pattern for matching
509/// an actual pod condition type.
510#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
511pub struct PodFailurePolicyOnPodConditionsPattern {
512 /// Specifies the required Pod condition type. To match a pod condition
513 /// it is required that specified type equals the pod condition type.
514 #[prost(string, optional, tag = "1")]
515 pub r#type: ::core::option::Option<::prost::alloc::string::String>,
516 /// Specifies the required Pod condition status. To match a pod condition
517 /// it is required that the specified status equals the pod condition status.
518 /// Defaults to True.
519 /// +optional
520 #[prost(string, optional, tag = "2")]
521 pub status: ::core::option::Option<::prost::alloc::string::String>,
522}
523/// PodFailurePolicyRule describes how a pod failure is handled when the requirements are met.
524/// One of onExitCodes and onPodConditions, but not both, can be used in each rule.
525#[derive(Clone, PartialEq, ::prost::Message)]
526pub struct PodFailurePolicyRule {
527 /// Specifies the action taken on a pod failure when the requirements are satisfied.
528 /// Possible values are:
529 ///
530 /// - FailJob: indicates that the pod's job is marked as Failed and all
531 /// running pods are terminated.
532 /// - FailIndex: indicates that the pod's index is marked as Failed and will
533 /// not be restarted.
534 /// - Ignore: indicates that the counter towards the .backoffLimit is not
535 /// incremented and a replacement pod is created.
536 /// - Count: indicates that the pod is handled in the default way - the
537 /// counter towards the .backoffLimit is incremented.
538 /// Additional values are considered to be added in the future. Clients should
539 /// react to an unknown action by skipping the rule.
540 #[prost(string, optional, tag = "1")]
541 pub action: ::core::option::Option<::prost::alloc::string::String>,
542 /// Represents the requirement on the container exit codes.
543 /// +optional
544 #[prost(message, optional, tag = "2")]
545 pub on_exit_codes: ::core::option::Option<PodFailurePolicyOnExitCodesRequirement>,
546 /// Represents the requirement on the pod conditions. The requirement is represented
547 /// as a list of pod condition patterns. The requirement is satisfied if at
548 /// least one pattern matches an actual pod condition. At most 20 elements are allowed.
549 /// +listType=atomic
550 /// +optional
551 #[prost(message, repeated, tag = "3")]
552 pub on_pod_conditions: ::prost::alloc::vec::Vec<PodFailurePolicyOnPodConditionsPattern>,
553}
554/// SuccessPolicy describes when a Job can be declared as succeeded based on the success of some indexes.
555#[derive(Clone, PartialEq, ::prost::Message)]
556pub struct SuccessPolicy {
557 /// rules represents the list of alternative rules for the declaring the Jobs
558 /// as successful before `.status.succeeded >= .spec.completions`. Once any of the rules are met,
559 /// the "SuccessCriteriaMet" condition is added, and the lingering pods are removed.
560 /// The terminal state for such a Job has the "Complete" condition.
561 /// Additionally, these rules are evaluated in order; Once the Job meets one of the rules,
562 /// other rules are ignored. At most 20 elements are allowed.
563 /// +listType=atomic
564 #[prost(message, repeated, tag = "1")]
565 pub rules: ::prost::alloc::vec::Vec<SuccessPolicyRule>,
566}
567/// SuccessPolicyRule describes rule for declaring a Job as succeeded.
568/// Each rule must have at least one of the "succeededIndexes" or "succeededCount" specified.
569#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
570pub struct SuccessPolicyRule {
571 /// succeededIndexes specifies the set of indexes
572 /// which need to be contained in the actual set of the succeeded indexes for the Job.
573 /// The list of indexes must be within 0 to ".spec.completions-1" and
574 /// must not contain duplicates. At least one element is required.
575 /// The indexes are represented as intervals separated by commas.
576 /// The intervals can be a decimal integer or a pair of decimal integers separated by a hyphen.
577 /// The number are listed in represented by the first and last element of the series,
578 /// separated by a hyphen.
579 /// For example, if the completed indexes are 1, 3, 4, 5 and 7, they are
580 /// represented as "1,3-5,7".
581 /// When this field is null, this field doesn't default to any value
582 /// and is never evaluated at any time.
583 ///
584 /// +optional
585 #[prost(string, optional, tag = "1")]
586 pub succeeded_indexes: ::core::option::Option<::prost::alloc::string::String>,
587 /// succeededCount specifies the minimal required size of the actual set of the succeeded indexes
588 /// for the Job. When succeededCount is used along with succeededIndexes, the check is
589 /// constrained only to the set of indexes specified by succeededIndexes.
590 /// For example, given that succeededIndexes is "1-4", succeededCount is "3",
591 /// and completed indexes are "1", "3", and "5", the Job isn't declared as succeeded
592 /// because only "1" and "3" indexes are considered in that rules.
593 /// When this field is null, this doesn't default to any value and
594 /// is never evaluated at any time.
595 /// When specified it needs to be a positive integer.
596 ///
597 /// +optional
598 #[prost(int32, optional, tag = "2")]
599 pub succeeded_count: ::core::option::Option<i32>,
600}
601/// UncountedTerminatedPods holds UIDs of Pods that have terminated but haven't
602/// been accounted in Job status counters.
603#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
604pub struct UncountedTerminatedPods {
605 /// succeeded holds UIDs of succeeded Pods.
606 /// +listType=set
607 /// +optional
608 #[prost(string, repeated, tag = "1")]
609 pub succeeded: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
610 /// failed holds UIDs of failed Pods.
611 /// +listType=set
612 /// +optional
613 #[prost(string, repeated, tag = "2")]
614 pub failed: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
615}
616
617impl crate::Resource for CronJob {
618 const API_VERSION: &'static str = "batch/v1";
619 const GROUP: &'static str = "batch";
620 const VERSION: &'static str = "v1";
621 const KIND: &'static str = "CronJob";
622 const URL_PATH_SEGMENT: &'static str = "cronjobs";
623 type Scope = crate::NamespaceResourceScope;
624}
625impl crate::Metadata for CronJob {
626 type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta;
627 fn metadata(&self) -> Option<&<Self as crate::Metadata>::Ty> {
628 self.metadata.as_ref()
629 }
630 fn metadata_mut(&mut self) -> Option<&mut <Self as crate::Metadata>::Ty> {
631 self.metadata.as_mut()
632 }
633}
634impl crate::HasSpec for CronJob {
635 type Spec = crate::api::batch::v1::CronJobSpec;
636 fn spec(&self) -> Option<&<Self as crate::HasSpec>::Spec> {
637 self.spec.as_ref()
638 }
639 fn spec_mut(&mut self) -> Option<&mut <Self as crate::HasSpec>::Spec> {
640 self.spec.as_mut()
641 }
642}
643impl crate::HasStatus for CronJob {
644 type Status = crate::api::batch::v1::CronJobStatus;
645 fn status(&self) -> Option<&<Self as crate::HasStatus>::Status> {
646 self.status.as_ref()
647 }
648 fn status_mut(&mut self) -> Option<&mut <Self as crate::HasStatus>::Status> {
649 self.status.as_mut()
650 }
651}
652
653impl crate::Resource for Job {
654 const API_VERSION: &'static str = "batch/v1";
655 const GROUP: &'static str = "batch";
656 const VERSION: &'static str = "v1";
657 const KIND: &'static str = "Job";
658 const URL_PATH_SEGMENT: &'static str = "jobs";
659 type Scope = crate::NamespaceResourceScope;
660}
661impl crate::Metadata for Job {
662 type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta;
663 fn metadata(&self) -> Option<&<Self as crate::Metadata>::Ty> {
664 self.metadata.as_ref()
665 }
666 fn metadata_mut(&mut self) -> Option<&mut <Self as crate::Metadata>::Ty> {
667 self.metadata.as_mut()
668 }
669}
670impl crate::HasSpec for Job {
671 type Spec = crate::api::batch::v1::JobSpec;
672 fn spec(&self) -> Option<&<Self as crate::HasSpec>::Spec> {
673 self.spec.as_ref()
674 }
675 fn spec_mut(&mut self) -> Option<&mut <Self as crate::HasSpec>::Spec> {
676 self.spec.as_mut()
677 }
678}
679impl crate::HasStatus for Job {
680 type Status = crate::api::batch::v1::JobStatus;
681 fn status(&self) -> Option<&<Self as crate::HasStatus>::Status> {
682 self.status.as_ref()
683 }
684 fn status_mut(&mut self) -> Option<&mut <Self as crate::HasStatus>::Status> {
685 self.status.as_mut()
686 }
687}
688impl crate::HasConditions for Job {
689 type Condition = crate::api::batch::v1::JobCondition;
690 fn conditions(&self) -> Option<&[<Self as crate::HasConditions>::Condition]> {
691 self.status.as_ref().map(|s| s.conditions.as_slice())
692 }
693 fn conditions_mut(&mut self) -> Option<&mut Vec<<Self as crate::HasConditions>::Condition>> {
694 self.status.as_mut().and_then(|s| Some(s.conditions.as_mut()))
695 }
696}