statefulsetspec.go 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. v1beta2 "k8s.io/api/apps/v1beta2"
  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 *v1beta2.PodManagementPolicyType `json:"podManagementPolicy,omitempty"`
  29. UpdateStrategy *StatefulSetUpdateStrategyApplyConfiguration `json:"updateStrategy,omitempty"`
  30. RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"`
  31. }
  32. // StatefulSetSpecApplyConfiguration constructs an declarative configuration of the StatefulSetSpec type for use with
  33. // apply.
  34. func StatefulSetSpec() *StatefulSetSpecApplyConfiguration {
  35. return &StatefulSetSpecApplyConfiguration{}
  36. }
  37. // WithReplicas sets the Replicas field in the declarative configuration to the given value
  38. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  39. // If called multiple times, the Replicas field is set to the value of the last call.
  40. func (b *StatefulSetSpecApplyConfiguration) WithReplicas(value int32) *StatefulSetSpecApplyConfiguration {
  41. b.Replicas = &value
  42. return b
  43. }
  44. // WithSelector sets the Selector field in the declarative configuration to the given value
  45. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  46. // If called multiple times, the Selector field is set to the value of the last call.
  47. func (b *StatefulSetSpecApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *StatefulSetSpecApplyConfiguration {
  48. b.Selector = value
  49. return b
  50. }
  51. // WithTemplate sets the Template field in the declarative configuration to the given value
  52. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  53. // If called multiple times, the Template field is set to the value of the last call.
  54. func (b *StatefulSetSpecApplyConfiguration) WithTemplate(value *corev1.PodTemplateSpecApplyConfiguration) *StatefulSetSpecApplyConfiguration {
  55. b.Template = value
  56. return b
  57. }
  58. // WithVolumeClaimTemplates adds the given value to the VolumeClaimTemplates field in the declarative configuration
  59. // and returns the receiver, so that objects can be build by chaining "With" function invocations.
  60. // If called multiple times, values provided by each call will be appended to the VolumeClaimTemplates field.
  61. func (b *StatefulSetSpecApplyConfiguration) WithVolumeClaimTemplates(values ...*corev1.PersistentVolumeClaimApplyConfiguration) *StatefulSetSpecApplyConfiguration {
  62. for i := range values {
  63. if values[i] == nil {
  64. panic("nil value passed to WithVolumeClaimTemplates")
  65. }
  66. b.VolumeClaimTemplates = append(b.VolumeClaimTemplates, *values[i])
  67. }
  68. return b
  69. }
  70. // WithServiceName sets the ServiceName field in the declarative configuration to the given value
  71. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  72. // If called multiple times, the ServiceName field is set to the value of the last call.
  73. func (b *StatefulSetSpecApplyConfiguration) WithServiceName(value string) *StatefulSetSpecApplyConfiguration {
  74. b.ServiceName = &value
  75. return b
  76. }
  77. // WithPodManagementPolicy sets the PodManagementPolicy field in the declarative configuration to the given value
  78. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  79. // If called multiple times, the PodManagementPolicy field is set to the value of the last call.
  80. func (b *StatefulSetSpecApplyConfiguration) WithPodManagementPolicy(value v1beta2.PodManagementPolicyType) *StatefulSetSpecApplyConfiguration {
  81. b.PodManagementPolicy = &value
  82. return b
  83. }
  84. // WithUpdateStrategy sets the UpdateStrategy field in the declarative configuration to the given value
  85. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  86. // If called multiple times, the UpdateStrategy field is set to the value of the last call.
  87. func (b *StatefulSetSpecApplyConfiguration) WithUpdateStrategy(value *StatefulSetUpdateStrategyApplyConfiguration) *StatefulSetSpecApplyConfiguration {
  88. b.UpdateStrategy = value
  89. return b
  90. }
  91. // WithRevisionHistoryLimit sets the RevisionHistoryLimit field in the declarative configuration to the given value
  92. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  93. // If called multiple times, the RevisionHistoryLimit field is set to the value of the last call.
  94. func (b *StatefulSetSpecApplyConfiguration) WithRevisionHistoryLimit(value int32) *StatefulSetSpecApplyConfiguration {
  95. b.RevisionHistoryLimit = &value
  96. return b
  97. }