jobspec.go 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. /*
  2. Copyright The Kubernetes Authors.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. // Code generated by applyconfiguration-gen. DO NOT EDIT.
  14. package v1
  15. import (
  16. batchv1 "k8s.io/api/batch/v1"
  17. corev1 "k8s.io/client-go/applyconfigurations/core/v1"
  18. metav1 "k8s.io/client-go/applyconfigurations/meta/v1"
  19. )
  20. // JobSpecApplyConfiguration represents an declarative configuration of the JobSpec type for use
  21. // with apply.
  22. type JobSpecApplyConfiguration struct {
  23. Parallelism *int32 `json:"parallelism,omitempty"`
  24. Completions *int32 `json:"completions,omitempty"`
  25. ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"`
  26. PodFailurePolicy *PodFailurePolicyApplyConfiguration `json:"podFailurePolicy,omitempty"`
  27. BackoffLimit *int32 `json:"backoffLimit,omitempty"`
  28. BackoffLimitPerIndex *int32 `json:"backoffLimitPerIndex,omitempty"`
  29. MaxFailedIndexes *int32 `json:"maxFailedIndexes,omitempty"`
  30. Selector *metav1.LabelSelectorApplyConfiguration `json:"selector,omitempty"`
  31. ManualSelector *bool `json:"manualSelector,omitempty"`
  32. Template *corev1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"`
  33. TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished,omitempty"`
  34. CompletionMode *batchv1.CompletionMode `json:"completionMode,omitempty"`
  35. Suspend *bool `json:"suspend,omitempty"`
  36. PodReplacementPolicy *batchv1.PodReplacementPolicy `json:"podReplacementPolicy,omitempty"`
  37. }
  38. // JobSpecApplyConfiguration constructs an declarative configuration of the JobSpec type for use with
  39. // apply.
  40. func JobSpec() *JobSpecApplyConfiguration {
  41. return &JobSpecApplyConfiguration{}
  42. }
  43. // WithParallelism sets the Parallelism field in the declarative configuration to the given value
  44. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  45. // If called multiple times, the Parallelism field is set to the value of the last call.
  46. func (b *JobSpecApplyConfiguration) WithParallelism(value int32) *JobSpecApplyConfiguration {
  47. b.Parallelism = &value
  48. return b
  49. }
  50. // WithCompletions sets the Completions field in the declarative configuration to the given value
  51. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  52. // If called multiple times, the Completions field is set to the value of the last call.
  53. func (b *JobSpecApplyConfiguration) WithCompletions(value int32) *JobSpecApplyConfiguration {
  54. b.Completions = &value
  55. return b
  56. }
  57. // WithActiveDeadlineSeconds sets the ActiveDeadlineSeconds field in the declarative configuration to the given value
  58. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  59. // If called multiple times, the ActiveDeadlineSeconds field is set to the value of the last call.
  60. func (b *JobSpecApplyConfiguration) WithActiveDeadlineSeconds(value int64) *JobSpecApplyConfiguration {
  61. b.ActiveDeadlineSeconds = &value
  62. return b
  63. }
  64. // WithPodFailurePolicy sets the PodFailurePolicy field in the declarative configuration to the given value
  65. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  66. // If called multiple times, the PodFailurePolicy field is set to the value of the last call.
  67. func (b *JobSpecApplyConfiguration) WithPodFailurePolicy(value *PodFailurePolicyApplyConfiguration) *JobSpecApplyConfiguration {
  68. b.PodFailurePolicy = value
  69. return b
  70. }
  71. // WithBackoffLimit sets the BackoffLimit field in the declarative configuration to the given value
  72. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  73. // If called multiple times, the BackoffLimit field is set to the value of the last call.
  74. func (b *JobSpecApplyConfiguration) WithBackoffLimit(value int32) *JobSpecApplyConfiguration {
  75. b.BackoffLimit = &value
  76. return b
  77. }
  78. // WithBackoffLimitPerIndex sets the BackoffLimitPerIndex field in the declarative configuration to the given value
  79. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  80. // If called multiple times, the BackoffLimitPerIndex field is set to the value of the last call.
  81. func (b *JobSpecApplyConfiguration) WithBackoffLimitPerIndex(value int32) *JobSpecApplyConfiguration {
  82. b.BackoffLimitPerIndex = &value
  83. return b
  84. }
  85. // WithMaxFailedIndexes sets the MaxFailedIndexes field in the declarative configuration to the given value
  86. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  87. // If called multiple times, the MaxFailedIndexes field is set to the value of the last call.
  88. func (b *JobSpecApplyConfiguration) WithMaxFailedIndexes(value int32) *JobSpecApplyConfiguration {
  89. b.MaxFailedIndexes = &value
  90. return b
  91. }
  92. // WithSelector sets the Selector field in the declarative configuration to the given value
  93. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  94. // If called multiple times, the Selector field is set to the value of the last call.
  95. func (b *JobSpecApplyConfiguration) WithSelector(value *metav1.LabelSelectorApplyConfiguration) *JobSpecApplyConfiguration {
  96. b.Selector = value
  97. return b
  98. }
  99. // WithManualSelector sets the ManualSelector field in the declarative configuration to the given value
  100. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  101. // If called multiple times, the ManualSelector field is set to the value of the last call.
  102. func (b *JobSpecApplyConfiguration) WithManualSelector(value bool) *JobSpecApplyConfiguration {
  103. b.ManualSelector = &value
  104. return b
  105. }
  106. // WithTemplate sets the Template field in the declarative configuration to the given value
  107. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  108. // If called multiple times, the Template field is set to the value of the last call.
  109. func (b *JobSpecApplyConfiguration) WithTemplate(value *corev1.PodTemplateSpecApplyConfiguration) *JobSpecApplyConfiguration {
  110. b.Template = value
  111. return b
  112. }
  113. // WithTTLSecondsAfterFinished sets the TTLSecondsAfterFinished field in the declarative configuration to the given value
  114. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  115. // If called multiple times, the TTLSecondsAfterFinished field is set to the value of the last call.
  116. func (b *JobSpecApplyConfiguration) WithTTLSecondsAfterFinished(value int32) *JobSpecApplyConfiguration {
  117. b.TTLSecondsAfterFinished = &value
  118. return b
  119. }
  120. // WithCompletionMode sets the CompletionMode field in the declarative configuration to the given value
  121. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  122. // If called multiple times, the CompletionMode field is set to the value of the last call.
  123. func (b *JobSpecApplyConfiguration) WithCompletionMode(value batchv1.CompletionMode) *JobSpecApplyConfiguration {
  124. b.CompletionMode = &value
  125. return b
  126. }
  127. // WithSuspend sets the Suspend field in the declarative configuration to the given value
  128. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  129. // If called multiple times, the Suspend field is set to the value of the last call.
  130. func (b *JobSpecApplyConfiguration) WithSuspend(value bool) *JobSpecApplyConfiguration {
  131. b.Suspend = &value
  132. return b
  133. }
  134. // WithPodReplacementPolicy sets the PodReplacementPolicy field in the declarative configuration to the given value
  135. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  136. // If called multiple times, the PodReplacementPolicy field is set to the value of the last call.
  137. func (b *JobSpecApplyConfiguration) WithPodReplacementPolicy(value batchv1.PodReplacementPolicy) *JobSpecApplyConfiguration {
  138. b.PodReplacementPolicy = &value
  139. return b
  140. }