statefulsetspec.go 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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 v1beta1
  15. import (
  16. v1beta1 "k8s.io/api/apps/v1beta1"
  17. corev1 "k8s.io/client-go/applyconfigurations/core/v1"
  18. v1 "k8s.io/client-go/applyconfigurations/meta/v1"
  19. )
  20. // StatefulSetSpecApplyConfiguration represents an declarative configuration of the StatefulSetSpec type for use
  21. // with apply.
  22. type StatefulSetSpecApplyConfiguration struct {
  23. Replicas *int32 `json:"replicas,omitempty"`
  24. Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"`
  25. Template *corev1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"`
  26. VolumeClaimTemplates []corev1.PersistentVolumeClaimApplyConfiguration `json:"volumeClaimTemplates,omitempty"`
  27. ServiceName *string `json:"serviceName,omitempty"`
  28. PodManagementPolicy *v1beta1.PodManagementPolicyType `json:"podManagementPolicy,omitempty"`
  29. UpdateStrategy *StatefulSetUpdateStrategyApplyConfiguration `json:"updateStrategy,omitempty"`
  30. RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"`
  31. MinReadySeconds *int32 `json:"minReadySeconds,omitempty"`
  32. PersistentVolumeClaimRetentionPolicy *StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration `json:"persistentVolumeClaimRetentionPolicy,omitempty"`
  33. Ordinals *StatefulSetOrdinalsApplyConfiguration `json:"ordinals,omitempty"`
  34. }
  35. // StatefulSetSpecApplyConfiguration constructs an declarative configuration of the StatefulSetSpec type for use with
  36. // apply.
  37. func StatefulSetSpec() *StatefulSetSpecApplyConfiguration {
  38. return &StatefulSetSpecApplyConfiguration{}
  39. }
  40. // WithReplicas sets the Replicas 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 Replicas field is set to the value of the last call.
  43. func (b *StatefulSetSpecApplyConfiguration) WithReplicas(value int32) *StatefulSetSpecApplyConfiguration {
  44. b.Replicas = &value
  45. return b
  46. }
  47. // WithSelector sets the Selector 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 Selector field is set to the value of the last call.
  50. func (b *StatefulSetSpecApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *StatefulSetSpecApplyConfiguration {
  51. b.Selector = value
  52. return b
  53. }
  54. // WithTemplate sets the Template 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 Template field is set to the value of the last call.
  57. func (b *StatefulSetSpecApplyConfiguration) WithTemplate(value *corev1.PodTemplateSpecApplyConfiguration) *StatefulSetSpecApplyConfiguration {
  58. b.Template = value
  59. return b
  60. }
  61. // WithVolumeClaimTemplates adds the given value to the VolumeClaimTemplates field in the declarative configuration
  62. // and returns the receiver, so that objects can be build by chaining "With" function invocations.
  63. // If called multiple times, values provided by each call will be appended to the VolumeClaimTemplates field.
  64. func (b *StatefulSetSpecApplyConfiguration) WithVolumeClaimTemplates(values ...*corev1.PersistentVolumeClaimApplyConfiguration) *StatefulSetSpecApplyConfiguration {
  65. for i := range values {
  66. if values[i] == nil {
  67. panic("nil value passed to WithVolumeClaimTemplates")
  68. }
  69. b.VolumeClaimTemplates = append(b.VolumeClaimTemplates, *values[i])
  70. }
  71. return b
  72. }
  73. // WithServiceName sets the ServiceName field in the declarative configuration to the given value
  74. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  75. // If called multiple times, the ServiceName field is set to the value of the last call.
  76. func (b *StatefulSetSpecApplyConfiguration) WithServiceName(value string) *StatefulSetSpecApplyConfiguration {
  77. b.ServiceName = &value
  78. return b
  79. }
  80. // WithPodManagementPolicy sets the PodManagementPolicy field in the declarative configuration to the given value
  81. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  82. // If called multiple times, the PodManagementPolicy field is set to the value of the last call.
  83. func (b *StatefulSetSpecApplyConfiguration) WithPodManagementPolicy(value v1beta1.PodManagementPolicyType) *StatefulSetSpecApplyConfiguration {
  84. b.PodManagementPolicy = &value
  85. return b
  86. }
  87. // WithUpdateStrategy sets the UpdateStrategy field in the declarative configuration to the given value
  88. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  89. // If called multiple times, the UpdateStrategy field is set to the value of the last call.
  90. func (b *StatefulSetSpecApplyConfiguration) WithUpdateStrategy(value *StatefulSetUpdateStrategyApplyConfiguration) *StatefulSetSpecApplyConfiguration {
  91. b.UpdateStrategy = value
  92. return b
  93. }
  94. // WithRevisionHistoryLimit sets the RevisionHistoryLimit field in the declarative configuration to the given value
  95. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  96. // If called multiple times, the RevisionHistoryLimit field is set to the value of the last call.
  97. func (b *StatefulSetSpecApplyConfiguration) WithRevisionHistoryLimit(value int32) *StatefulSetSpecApplyConfiguration {
  98. b.RevisionHistoryLimit = &value
  99. return b
  100. }
  101. // WithMinReadySeconds sets the MinReadySeconds field in the declarative configuration to the given value
  102. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  103. // If called multiple times, the MinReadySeconds field is set to the value of the last call.
  104. func (b *StatefulSetSpecApplyConfiguration) WithMinReadySeconds(value int32) *StatefulSetSpecApplyConfiguration {
  105. b.MinReadySeconds = &value
  106. return b
  107. }
  108. // WithPersistentVolumeClaimRetentionPolicy sets the PersistentVolumeClaimRetentionPolicy field in the declarative configuration to the given value
  109. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  110. // If called multiple times, the PersistentVolumeClaimRetentionPolicy field is set to the value of the last call.
  111. func (b *StatefulSetSpecApplyConfiguration) WithPersistentVolumeClaimRetentionPolicy(value *StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration) *StatefulSetSpecApplyConfiguration {
  112. b.PersistentVolumeClaimRetentionPolicy = value
  113. return b
  114. }
  115. // WithOrdinals sets the Ordinals field in the declarative configuration to the given value
  116. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  117. // If called multiple times, the Ordinals field is set to the value of the last call.
  118. func (b *StatefulSetSpecApplyConfiguration) WithOrdinals(value *StatefulSetOrdinalsApplyConfiguration) *StatefulSetSpecApplyConfiguration {
  119. b.Ordinals = value
  120. return b
  121. }