deploymentspec.go 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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 v1beta2
  15. import (
  16. corev1 "k8s.io/client-go/applyconfigurations/core/v1"
  17. v1 "k8s.io/client-go/applyconfigurations/meta/v1"
  18. )
  19. // DeploymentSpecApplyConfiguration represents a declarative configuration of the DeploymentSpec type for use
  20. // with apply.
  21. //
  22. // DeploymentSpec is the specification of the desired behavior of the Deployment.
  23. type DeploymentSpecApplyConfiguration struct {
  24. // Number of desired pods. This is a pointer to distinguish between explicit
  25. // zero and not specified. Defaults to 1.
  26. Replicas *int32 `json:"replicas,omitempty"`
  27. // Label selector for pods. Existing ReplicaSets whose pods are
  28. // selected by this will be the ones affected by this deployment.
  29. // It must match the pod template's labels.
  30. Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"`
  31. // Template describes the pods that will be created.
  32. // The only allowed template.spec.restartPolicy value is "Always".
  33. Template *corev1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"`
  34. // The deployment strategy to use to replace existing pods with new ones.
  35. Strategy *DeploymentStrategyApplyConfiguration `json:"strategy,omitempty"`
  36. // Minimum number of seconds for which a newly created pod should be ready
  37. // without any of its container crashing, for it to be considered available.
  38. // Defaults to 0 (pod will be considered available as soon as it is ready)
  39. MinReadySeconds *int32 `json:"minReadySeconds,omitempty"`
  40. // The number of old ReplicaSets to retain to allow rollback.
  41. // This is a pointer to distinguish between explicit zero and not specified.
  42. // Defaults to 10.
  43. RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"`
  44. // Indicates that the deployment is paused.
  45. Paused *bool `json:"paused,omitempty"`
  46. // The maximum time in seconds for a deployment to make progress before it
  47. // is considered to be failed. The deployment controller will continue to
  48. // process failed deployments and a condition with a ProgressDeadlineExceeded
  49. // reason will be surfaced in the deployment status. Note that progress will
  50. // not be estimated during the time a deployment is paused. Defaults to 600s.
  51. ProgressDeadlineSeconds *int32 `json:"progressDeadlineSeconds,omitempty"`
  52. }
  53. // DeploymentSpecApplyConfiguration constructs a declarative configuration of the DeploymentSpec type for use with
  54. // apply.
  55. func DeploymentSpec() *DeploymentSpecApplyConfiguration {
  56. return &DeploymentSpecApplyConfiguration{}
  57. }
  58. // WithReplicas sets the Replicas field in the declarative configuration to the given value
  59. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  60. // If called multiple times, the Replicas field is set to the value of the last call.
  61. func (b *DeploymentSpecApplyConfiguration) WithReplicas(value int32) *DeploymentSpecApplyConfiguration {
  62. b.Replicas = &value
  63. return b
  64. }
  65. // WithSelector sets the Selector field in the declarative configuration to the given value
  66. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  67. // If called multiple times, the Selector field is set to the value of the last call.
  68. func (b *DeploymentSpecApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *DeploymentSpecApplyConfiguration {
  69. b.Selector = value
  70. return b
  71. }
  72. // WithTemplate sets the Template field in the declarative configuration to the given value
  73. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  74. // If called multiple times, the Template field is set to the value of the last call.
  75. func (b *DeploymentSpecApplyConfiguration) WithTemplate(value *corev1.PodTemplateSpecApplyConfiguration) *DeploymentSpecApplyConfiguration {
  76. b.Template = value
  77. return b
  78. }
  79. // WithStrategy sets the Strategy field in the declarative configuration to the given value
  80. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  81. // If called multiple times, the Strategy field is set to the value of the last call.
  82. func (b *DeploymentSpecApplyConfiguration) WithStrategy(value *DeploymentStrategyApplyConfiguration) *DeploymentSpecApplyConfiguration {
  83. b.Strategy = value
  84. return b
  85. }
  86. // WithMinReadySeconds sets the MinReadySeconds field in the declarative configuration to the given value
  87. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  88. // If called multiple times, the MinReadySeconds field is set to the value of the last call.
  89. func (b *DeploymentSpecApplyConfiguration) WithMinReadySeconds(value int32) *DeploymentSpecApplyConfiguration {
  90. b.MinReadySeconds = &value
  91. return b
  92. }
  93. // WithRevisionHistoryLimit sets the RevisionHistoryLimit field in the declarative configuration to the given value
  94. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  95. // If called multiple times, the RevisionHistoryLimit field is set to the value of the last call.
  96. func (b *DeploymentSpecApplyConfiguration) WithRevisionHistoryLimit(value int32) *DeploymentSpecApplyConfiguration {
  97. b.RevisionHistoryLimit = &value
  98. return b
  99. }
  100. // WithPaused sets the Paused field in the declarative configuration to the given value
  101. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  102. // If called multiple times, the Paused field is set to the value of the last call.
  103. func (b *DeploymentSpecApplyConfiguration) WithPaused(value bool) *DeploymentSpecApplyConfiguration {
  104. b.Paused = &value
  105. return b
  106. }
  107. // WithProgressDeadlineSeconds sets the ProgressDeadlineSeconds field in the declarative configuration to the given value
  108. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  109. // If called multiple times, the ProgressDeadlineSeconds field is set to the value of the last call.
  110. func (b *DeploymentSpecApplyConfiguration) WithProgressDeadlineSeconds(value int32) *DeploymentSpecApplyConfiguration {
  111. b.ProgressDeadlineSeconds = &value
  112. return b
  113. }