From 32850001d5095a242243321f0b85039facae2502 Mon Sep 17 00:00:00 2001 From: Xudong Liu Date: Wed, 20 Jan 2021 16:56:07 -0800 Subject: [PATCH] Add LoadBalancerClass field in service KEP-1959: https://github.com/kubernetes/enhancements/tree/master/keps/sig-cloud-provider/1959-service-lb-class-field Kubernetes-commit: 72da0b1bb06607f3f3e067f1bb5ce329ec861e1b --- applyconfigurations/core/v1/servicespec.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/applyconfigurations/core/v1/servicespec.go b/applyconfigurations/core/v1/servicespec.go index 080cd5ea..69162286 100644 --- a/applyconfigurations/core/v1/servicespec.go +++ b/applyconfigurations/core/v1/servicespec.go @@ -43,6 +43,7 @@ type ServiceSpecApplyConfiguration struct { IPFamilies []corev1.IPFamily `json:"ipFamilies,omitempty"` IPFamilyPolicy *corev1.IPFamilyPolicyType `json:"ipFamilyPolicy,omitempty"` AllocateLoadBalancerNodePorts *bool `json:"allocateLoadBalancerNodePorts,omitempty"` + LoadBalancerClass *string `json:"loadBalancerClass,omitempty"` } // ServiceSpecApplyConfiguration constructs an declarative configuration of the ServiceSpec type for use with @@ -215,3 +216,11 @@ func (b *ServiceSpecApplyConfiguration) WithAllocateLoadBalancerNodePorts(value b.AllocateLoadBalancerNodePorts = &value return b } + +// WithLoadBalancerClass sets the LoadBalancerClass field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LoadBalancerClass field is set to the value of the last call. +func (b *ServiceSpecApplyConfiguration) WithLoadBalancerClass(value string) *ServiceSpecApplyConfiguration { + b.LoadBalancerClass = &value + return b +}