jobspec.go 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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. Selector *metav1.LabelSelectorApplyConfiguration `json:"selector,omitempty"`
  29. ManualSelector *bool `json:"manualSelector,omitempty"`
  30. Template *corev1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"`
  31. TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished,omitempty"`
  32. CompletionMode *batchv1.CompletionMode `json:"completionMode,omitempty"`
  33. Suspend *bool `json:"suspend,omitempty"`
  34. }
  35. // JobSpecApplyConfiguration constructs an declarative configuration of the JobSpec type for use with
  36. // apply.
  37. func JobSpec() *JobSpecApplyConfiguration {
  38. return &JobSpecApplyConfiguration{}
  39. }
  40. // WithParallelism sets the Parallelism field in the declarative configuration to the given value
  41. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  42. // If called multiple times, the Parallelism field is set to the value of the last call.
  43. func (b *JobSpecApplyConfiguration) WithParallelism(value int32) *JobSpecApplyConfiguration {
  44. b.Parallelism = &value
  45. return b
  46. }
  47. // WithCompletions sets the Completions field in the declarative configuration to the given value
  48. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  49. // If called multiple times, the Completions field is set to the value of the last call.
  50. func (b *JobSpecApplyConfiguration) WithCompletions(value int32) *JobSpecApplyConfiguration {
  51. b.Completions = &value
  52. return b
  53. }
  54. // WithActiveDeadlineSeconds sets the ActiveDeadlineSeconds field in the declarative configuration to the given value
  55. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  56. // If called multiple times, the ActiveDeadlineSeconds field is set to the value of the last call.
  57. func (b *JobSpecApplyConfiguration) WithActiveDeadlineSeconds(value int64) *JobSpecApplyConfiguration {
  58. b.ActiveDeadlineSeconds = &value
  59. return b
  60. }
  61. // WithPodFailurePolicy sets the PodFailurePolicy field in the declarative configuration to the given value
  62. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  63. // If called multiple times, the PodFailurePolicy field is set to the value of the last call.
  64. func (b *JobSpecApplyConfiguration) WithPodFailurePolicy(value *PodFailurePolicyApplyConfiguration) *JobSpecApplyConfiguration {
  65. b.PodFailurePolicy = value
  66. return b
  67. }
  68. // WithBackoffLimit sets the BackoffLimit field in the declarative configuration to the given value
  69. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  70. // If called multiple times, the BackoffLimit field is set to the value of the last call.
  71. func (b *JobSpecApplyConfiguration) WithBackoffLimit(value int32) *JobSpecApplyConfiguration {
  72. b.BackoffLimit = &value
  73. return b
  74. }
  75. // WithSelector sets the Selector field in the declarative configuration to the given value
  76. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  77. // If called multiple times, the Selector field is set to the value of the last call.
  78. func (b *JobSpecApplyConfiguration) WithSelector(value *metav1.LabelSelectorApplyConfiguration) *JobSpecApplyConfiguration {
  79. b.Selector = value
  80. return b
  81. }
  82. // WithManualSelector sets the ManualSelector field in the declarative configuration to the given value
  83. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  84. // If called multiple times, the ManualSelector field is set to the value of the last call.
  85. func (b *JobSpecApplyConfiguration) WithManualSelector(value bool) *JobSpecApplyConfiguration {
  86. b.ManualSelector = &value
  87. return b
  88. }
  89. // WithTemplate sets the Template field in the declarative configuration to the given value
  90. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  91. // If called multiple times, the Template field is set to the value of the last call.
  92. func (b *JobSpecApplyConfiguration) WithTemplate(value *corev1.PodTemplateSpecApplyConfiguration) *JobSpecApplyConfiguration {
  93. b.Template = value
  94. return b
  95. }
  96. // WithTTLSecondsAfterFinished sets the TTLSecondsAfterFinished field in the declarative configuration to the given value
  97. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  98. // If called multiple times, the TTLSecondsAfterFinished field is set to the value of the last call.
  99. func (b *JobSpecApplyConfiguration) WithTTLSecondsAfterFinished(value int32) *JobSpecApplyConfiguration {
  100. b.TTLSecondsAfterFinished = &value
  101. return b
  102. }
  103. // WithCompletionMode sets the CompletionMode field in the declarative configuration to the given value
  104. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  105. // If called multiple times, the CompletionMode field is set to the value of the last call.
  106. func (b *JobSpecApplyConfiguration) WithCompletionMode(value batchv1.CompletionMode) *JobSpecApplyConfiguration {
  107. b.CompletionMode = &value
  108. return b
  109. }
  110. // WithSuspend sets the Suspend field in the declarative configuration to the given value
  111. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  112. // If called multiple times, the Suspend field is set to the value of the last call.
  113. func (b *JobSpecApplyConfiguration) WithSuspend(value bool) *JobSpecApplyConfiguration {
  114. b.Suspend = &value
  115. return b
  116. }