podfailurepolicyrule.go 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. v1 "k8s.io/api/batch/v1"
  17. )
  18. // PodFailurePolicyRuleApplyConfiguration represents an declarative configuration of the PodFailurePolicyRule type for use
  19. // with apply.
  20. type PodFailurePolicyRuleApplyConfiguration struct {
  21. Action *v1.PodFailurePolicyAction `json:"action,omitempty"`
  22. OnExitCodes *PodFailurePolicyOnExitCodesRequirementApplyConfiguration `json:"onExitCodes,omitempty"`
  23. OnPodConditions []PodFailurePolicyOnPodConditionsPatternApplyConfiguration `json:"onPodConditions,omitempty"`
  24. }
  25. // PodFailurePolicyRuleApplyConfiguration constructs an declarative configuration of the PodFailurePolicyRule type for use with
  26. // apply.
  27. func PodFailurePolicyRule() *PodFailurePolicyRuleApplyConfiguration {
  28. return &PodFailurePolicyRuleApplyConfiguration{}
  29. }
  30. // WithAction sets the Action field in the declarative configuration to the given value
  31. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  32. // If called multiple times, the Action field is set to the value of the last call.
  33. func (b *PodFailurePolicyRuleApplyConfiguration) WithAction(value v1.PodFailurePolicyAction) *PodFailurePolicyRuleApplyConfiguration {
  34. b.Action = &value
  35. return b
  36. }
  37. // WithOnExitCodes sets the OnExitCodes 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 OnExitCodes field is set to the value of the last call.
  40. func (b *PodFailurePolicyRuleApplyConfiguration) WithOnExitCodes(value *PodFailurePolicyOnExitCodesRequirementApplyConfiguration) *PodFailurePolicyRuleApplyConfiguration {
  41. b.OnExitCodes = value
  42. return b
  43. }
  44. // WithOnPodConditions adds the given value to the OnPodConditions field in the declarative configuration
  45. // and returns the receiver, so that objects can be build by chaining "With" function invocations.
  46. // If called multiple times, values provided by each call will be appended to the OnPodConditions field.
  47. func (b *PodFailurePolicyRuleApplyConfiguration) WithOnPodConditions(values ...*PodFailurePolicyOnPodConditionsPatternApplyConfiguration) *PodFailurePolicyRuleApplyConfiguration {
  48. for i := range values {
  49. if values[i] == nil {
  50. panic("nil value passed to WithOnPodConditions")
  51. }
  52. b.OnPodConditions = append(b.OnPodConditions, *values[i])
  53. }
  54. return b
  55. }