@@ -93,6 +93,7 @@ const (
93
93
ServiceAnnotationLoadBalancerHealthMonitorTimeout = "loadbalancer.openstack.org/health-monitor-timeout"
94
94
ServiceAnnotationLoadBalancerHealthMonitorMaxRetries = "loadbalancer.openstack.org/health-monitor-max-retries"
95
95
ServiceAnnotationLoadBalancerLoadbalancerHostname = "loadbalancer.openstack.org/hostname"
96
+ ServiceAnnotationLoadBalancerAddress = "loadbalancer.openstack.org/load-balancer-address"
96
97
// revive:disable:var-naming
97
98
ServiceAnnotationTlsContainerRef = "loadbalancer.openstack.org/default-tls-container-ref"
98
99
// revive:enable:var-naming
@@ -1799,11 +1800,13 @@ func (sp *servicePatcher) Patch(ctx context.Context, err error) error {
1799
1800
return utilerrors .NewAggregate ([]error {err , perr })
1800
1801
}
1801
1802
1802
- func (lbaas * LbaasV2 ) updateServiceAnnotation (service * corev1.Service , annotName , annotValue string ) {
1803
+ func (lbaas * LbaasV2 ) updateServiceAnnotations (service * corev1.Service , annotations map [ string ] string ) {
1803
1804
if service .ObjectMeta .Annotations == nil {
1804
1805
service .ObjectMeta .Annotations = map [string ]string {}
1805
1806
}
1806
- service .ObjectMeta .Annotations [annotName ] = annotValue
1807
+ for key , value := range annotations {
1808
+ service .ObjectMeta .Annotations [key ] = value
1809
+ }
1807
1810
}
1808
1811
1809
1812
// createLoadBalancerStatus creates the loadbalancer status from the different possible sources
@@ -1958,7 +1961,11 @@ func (lbaas *LbaasV2) ensureOctaviaLoadBalancer(ctx context.Context, clusterName
1958
1961
}
1959
1962
1960
1963
// Add annotation to Service and add LB name to load balancer tags.
1961
- lbaas .updateServiceAnnotation (service , ServiceAnnotationLoadBalancerID , loadbalancer .ID )
1964
+ annotationUpdate := map [string ]string {
1965
+ ServiceAnnotationLoadBalancerID : loadbalancer .ID ,
1966
+ ServiceAnnotationLoadBalancerAddress : addr ,
1967
+ }
1968
+ lbaas .updateServiceAnnotations (service , annotationUpdate )
1962
1969
if svcConf .supportLBTags {
1963
1970
lbTags := loadbalancer .Tags
1964
1971
if ! cpoutil .Contains (lbTags , lbName ) {
0 commit comments