poddisruptionbudgetstatus.go 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
  17. metav1 "k8s.io/client-go/applyconfigurations/meta/v1"
  18. )
  19. // PodDisruptionBudgetStatusApplyConfiguration represents an declarative configuration of the PodDisruptionBudgetStatus type for use
  20. // with apply.
  21. type PodDisruptionBudgetStatusApplyConfiguration struct {
  22. ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
  23. DisruptedPods map[string]v1.Time `json:"disruptedPods,omitempty"`
  24. DisruptionsAllowed *int32 `json:"disruptionsAllowed,omitempty"`
  25. CurrentHealthy *int32 `json:"currentHealthy,omitempty"`
  26. DesiredHealthy *int32 `json:"desiredHealthy,omitempty"`
  27. ExpectedPods *int32 `json:"expectedPods,omitempty"`
  28. Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"`
  29. }
  30. // PodDisruptionBudgetStatusApplyConfiguration constructs an declarative configuration of the PodDisruptionBudgetStatus type for use with
  31. // apply.
  32. func PodDisruptionBudgetStatus() *PodDisruptionBudgetStatusApplyConfiguration {
  33. return &PodDisruptionBudgetStatusApplyConfiguration{}
  34. }
  35. // WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value
  36. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  37. // If called multiple times, the ObservedGeneration field is set to the value of the last call.
  38. func (b *PodDisruptionBudgetStatusApplyConfiguration) WithObservedGeneration(value int64) *PodDisruptionBudgetStatusApplyConfiguration {
  39. b.ObservedGeneration = &value
  40. return b
  41. }
  42. // WithDisruptedPods puts the entries into the DisruptedPods field in the declarative configuration
  43. // and returns the receiver, so that objects can be build by chaining "With" function invocations.
  44. // If called multiple times, the entries provided by each call will be put on the DisruptedPods field,
  45. // overwriting an existing map entries in DisruptedPods field with the same key.
  46. func (b *PodDisruptionBudgetStatusApplyConfiguration) WithDisruptedPods(entries map[string]v1.Time) *PodDisruptionBudgetStatusApplyConfiguration {
  47. if b.DisruptedPods == nil && len(entries) > 0 {
  48. b.DisruptedPods = make(map[string]v1.Time, len(entries))
  49. }
  50. for k, v := range entries {
  51. b.DisruptedPods[k] = v
  52. }
  53. return b
  54. }
  55. // WithDisruptionsAllowed sets the DisruptionsAllowed field in the declarative configuration to the given value
  56. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  57. // If called multiple times, the DisruptionsAllowed field is set to the value of the last call.
  58. func (b *PodDisruptionBudgetStatusApplyConfiguration) WithDisruptionsAllowed(value int32) *PodDisruptionBudgetStatusApplyConfiguration {
  59. b.DisruptionsAllowed = &value
  60. return b
  61. }
  62. // WithCurrentHealthy sets the CurrentHealthy field in the declarative configuration to the given value
  63. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  64. // If called multiple times, the CurrentHealthy field is set to the value of the last call.
  65. func (b *PodDisruptionBudgetStatusApplyConfiguration) WithCurrentHealthy(value int32) *PodDisruptionBudgetStatusApplyConfiguration {
  66. b.CurrentHealthy = &value
  67. return b
  68. }
  69. // WithDesiredHealthy sets the DesiredHealthy field in the declarative configuration to the given value
  70. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  71. // If called multiple times, the DesiredHealthy field is set to the value of the last call.
  72. func (b *PodDisruptionBudgetStatusApplyConfiguration) WithDesiredHealthy(value int32) *PodDisruptionBudgetStatusApplyConfiguration {
  73. b.DesiredHealthy = &value
  74. return b
  75. }
  76. // WithExpectedPods sets the ExpectedPods field in the declarative configuration to the given value
  77. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  78. // If called multiple times, the ExpectedPods field is set to the value of the last call.
  79. func (b *PodDisruptionBudgetStatusApplyConfiguration) WithExpectedPods(value int32) *PodDisruptionBudgetStatusApplyConfiguration {
  80. b.ExpectedPods = &value
  81. return b
  82. }
  83. // WithConditions adds the given value to the Conditions field in the declarative configuration
  84. // and returns the receiver, so that objects can be build by chaining "With" function invocations.
  85. // If called multiple times, values provided by each call will be appended to the Conditions field.
  86. func (b *PodDisruptionBudgetStatusApplyConfiguration) WithConditions(values ...*metav1.ConditionApplyConfiguration) *PodDisruptionBudgetStatusApplyConfiguration {
  87. for i := range values {
  88. if values[i] == nil {
  89. panic("nil value passed to WithConditions")
  90. }
  91. b.Conditions = append(b.Conditions, *values[i])
  92. }
  93. return b
  94. }