poddisruptionbudgetspec.go 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. policyv1 "k8s.io/api/policy/v1"
  17. intstr "k8s.io/apimachinery/pkg/util/intstr"
  18. v1 "k8s.io/client-go/applyconfigurations/meta/v1"
  19. )
  20. // PodDisruptionBudgetSpecApplyConfiguration represents an declarative configuration of the PodDisruptionBudgetSpec type for use
  21. // with apply.
  22. type PodDisruptionBudgetSpecApplyConfiguration struct {
  23. MinAvailable *intstr.IntOrString `json:"minAvailable,omitempty"`
  24. Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"`
  25. MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"`
  26. UnhealthyPodEvictionPolicy *policyv1.UnhealthyPodEvictionPolicyType `json:"unhealthyPodEvictionPolicy,omitempty"`
  27. }
  28. // PodDisruptionBudgetSpecApplyConfiguration constructs an declarative configuration of the PodDisruptionBudgetSpec type for use with
  29. // apply.
  30. func PodDisruptionBudgetSpec() *PodDisruptionBudgetSpecApplyConfiguration {
  31. return &PodDisruptionBudgetSpecApplyConfiguration{}
  32. }
  33. // WithMinAvailable sets the MinAvailable field in the declarative configuration to the given value
  34. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  35. // If called multiple times, the MinAvailable field is set to the value of the last call.
  36. func (b *PodDisruptionBudgetSpecApplyConfiguration) WithMinAvailable(value intstr.IntOrString) *PodDisruptionBudgetSpecApplyConfiguration {
  37. b.MinAvailable = &value
  38. return b
  39. }
  40. // WithSelector sets the Selector 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 Selector field is set to the value of the last call.
  43. func (b *PodDisruptionBudgetSpecApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *PodDisruptionBudgetSpecApplyConfiguration {
  44. b.Selector = value
  45. return b
  46. }
  47. // WithMaxUnavailable sets the MaxUnavailable 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 MaxUnavailable field is set to the value of the last call.
  50. func (b *PodDisruptionBudgetSpecApplyConfiguration) WithMaxUnavailable(value intstr.IntOrString) *PodDisruptionBudgetSpecApplyConfiguration {
  51. b.MaxUnavailable = &value
  52. return b
  53. }
  54. // WithUnhealthyPodEvictionPolicy sets the UnhealthyPodEvictionPolicy 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 UnhealthyPodEvictionPolicy field is set to the value of the last call.
  57. func (b *PodDisruptionBudgetSpecApplyConfiguration) WithUnhealthyPodEvictionPolicy(value policyv1.UnhealthyPodEvictionPolicyType) *PodDisruptionBudgetSpecApplyConfiguration {
  58. b.UnhealthyPodEvictionPolicy = &value
  59. return b
  60. }