k8s.io/client-go@v0.22.2/applyconfigurations/apps/v1beta2/statefulsetspec.go (about)

     1  /*
     2  Copyright The Kubernetes Authors.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  // Code generated by applyconfiguration-gen. DO NOT EDIT.
    18  
    19  package v1beta2
    20  
    21  import (
    22  	v1beta2 "k8s.io/api/apps/v1beta2"
    23  	corev1 "k8s.io/client-go/applyconfigurations/core/v1"
    24  	v1 "k8s.io/client-go/applyconfigurations/meta/v1"
    25  )
    26  
    27  // StatefulSetSpecApplyConfiguration represents an declarative configuration of the StatefulSetSpec type for use
    28  // with apply.
    29  type StatefulSetSpecApplyConfiguration struct {
    30  	Replicas             *int32                                           `json:"replicas,omitempty"`
    31  	Selector             *v1.LabelSelectorApplyConfiguration              `json:"selector,omitempty"`
    32  	Template             *corev1.PodTemplateSpecApplyConfiguration        `json:"template,omitempty"`
    33  	VolumeClaimTemplates []corev1.PersistentVolumeClaimApplyConfiguration `json:"volumeClaimTemplates,omitempty"`
    34  	ServiceName          *string                                          `json:"serviceName,omitempty"`
    35  	PodManagementPolicy  *v1beta2.PodManagementPolicyType                 `json:"podManagementPolicy,omitempty"`
    36  	UpdateStrategy       *StatefulSetUpdateStrategyApplyConfiguration     `json:"updateStrategy,omitempty"`
    37  	RevisionHistoryLimit *int32                                           `json:"revisionHistoryLimit,omitempty"`
    38  	MinReadySeconds      *int32                                           `json:"minReadySeconds,omitempty"`
    39  }
    40  
    41  // StatefulSetSpecApplyConfiguration constructs an declarative configuration of the StatefulSetSpec type for use with
    42  // apply.
    43  func StatefulSetSpec() *StatefulSetSpecApplyConfiguration {
    44  	return &StatefulSetSpecApplyConfiguration{}
    45  }
    46  
    47  // WithReplicas sets the Replicas 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 Replicas field is set to the value of the last call.
    50  func (b *StatefulSetSpecApplyConfiguration) WithReplicas(value int32) *StatefulSetSpecApplyConfiguration {
    51  	b.Replicas = &value
    52  	return b
    53  }
    54  
    55  // WithSelector sets the Selector 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 Selector field is set to the value of the last call.
    58  func (b *StatefulSetSpecApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *StatefulSetSpecApplyConfiguration {
    59  	b.Selector = value
    60  	return b
    61  }
    62  
    63  // WithTemplate sets the Template field in the declarative configuration to the given value
    64  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    65  // If called multiple times, the Template field is set to the value of the last call.
    66  func (b *StatefulSetSpecApplyConfiguration) WithTemplate(value *corev1.PodTemplateSpecApplyConfiguration) *StatefulSetSpecApplyConfiguration {
    67  	b.Template = value
    68  	return b
    69  }
    70  
    71  // WithVolumeClaimTemplates adds the given value to the VolumeClaimTemplates field in the declarative configuration
    72  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
    73  // If called multiple times, values provided by each call will be appended to the VolumeClaimTemplates field.
    74  func (b *StatefulSetSpecApplyConfiguration) WithVolumeClaimTemplates(values ...*corev1.PersistentVolumeClaimApplyConfiguration) *StatefulSetSpecApplyConfiguration {
    75  	for i := range values {
    76  		if values[i] == nil {
    77  			panic("nil value passed to WithVolumeClaimTemplates")
    78  		}
    79  		b.VolumeClaimTemplates = append(b.VolumeClaimTemplates, *values[i])
    80  	}
    81  	return b
    82  }
    83  
    84  // WithServiceName sets the ServiceName 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 ServiceName field is set to the value of the last call.
    87  func (b *StatefulSetSpecApplyConfiguration) WithServiceName(value string) *StatefulSetSpecApplyConfiguration {
    88  	b.ServiceName = &value
    89  	return b
    90  }
    91  
    92  // WithPodManagementPolicy sets the PodManagementPolicy field in the declarative configuration to the given value
    93  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    94  // If called multiple times, the PodManagementPolicy field is set to the value of the last call.
    95  func (b *StatefulSetSpecApplyConfiguration) WithPodManagementPolicy(value v1beta2.PodManagementPolicyType) *StatefulSetSpecApplyConfiguration {
    96  	b.PodManagementPolicy = &value
    97  	return b
    98  }
    99  
   100  // WithUpdateStrategy sets the UpdateStrategy field in the declarative configuration to the given value
   101  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   102  // If called multiple times, the UpdateStrategy field is set to the value of the last call.
   103  func (b *StatefulSetSpecApplyConfiguration) WithUpdateStrategy(value *StatefulSetUpdateStrategyApplyConfiguration) *StatefulSetSpecApplyConfiguration {
   104  	b.UpdateStrategy = value
   105  	return b
   106  }
   107  
   108  // WithRevisionHistoryLimit sets the RevisionHistoryLimit 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 RevisionHistoryLimit field is set to the value of the last call.
   111  func (b *StatefulSetSpecApplyConfiguration) WithRevisionHistoryLimit(value int32) *StatefulSetSpecApplyConfiguration {
   112  	b.RevisionHistoryLimit = &value
   113  	return b
   114  }
   115  
   116  // WithMinReadySeconds sets the MinReadySeconds field in the declarative configuration to the given value
   117  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   118  // If called multiple times, the MinReadySeconds field is set to the value of the last call.
   119  func (b *StatefulSetSpecApplyConfiguration) WithMinReadySeconds(value int32) *StatefulSetSpecApplyConfiguration {
   120  	b.MinReadySeconds = &value
   121  	return b
   122  }