@@ -238,7 +238,7 @@ func (l *loadbalancers) EnsureLoadBalancer(ctx context.Context, clusterName stri
238238 klog .Infof ("created new NodeBalancer (%d) for service (%s)" , nb .ID , serviceNn )
239239
240240 case nil :
241- if err = l .updateNodeBalancer (ctx , service , nodes , nb ); err != nil {
241+ if err = l .updateNodeBalancer (ctx , clusterName , service , nodes , nb ); err != nil {
242242 sentry .CaptureError (ctx , err )
243243 return nil , err
244244 }
@@ -262,7 +262,7 @@ func (l *loadbalancers) EnsureLoadBalancer(ctx context.Context, clusterName stri
262262}
263263
264264//nolint:funlen
265- func (l * loadbalancers ) updateNodeBalancer (ctx context.Context , service * v1.Service , nodes []* v1.Node , nb * linodego.NodeBalancer ) (err error ) {
265+ func (l * loadbalancers ) updateNodeBalancer (ctx context.Context , clusterName string , service * v1.Service , nodes []* v1.Node , nb * linodego.NodeBalancer ) (err error ) {
266266 if len (nodes ) == 0 {
267267 return fmt .Errorf ("%w: service %s" , errNoNodesAvailable , getServiceNn (service ))
268268 }
@@ -279,7 +279,7 @@ func (l *loadbalancers) updateNodeBalancer(ctx context.Context, service *v1.Serv
279279 }
280280 }
281281
282- tags := l .getLoadBalancerTags (ctx , service )
282+ tags := l .getLoadBalancerTags (ctx , clusterName , service )
283283 if ! reflect .DeepEqual (nb .Tags , tags ) {
284284 update := nb .GetUpdateOptions ()
285285 update .Tags = & tags
@@ -391,7 +391,7 @@ func (l *loadbalancers) UpdateLoadBalancer(ctx context.Context, clusterName stri
391391 }
392392 }
393393
394- return l .updateNodeBalancer (ctx , serviceWithStatus , nodes , nb )
394+ return l .updateNodeBalancer (ctx , clusterName , serviceWithStatus , nodes , nb )
395395}
396396
397397// Delete any NodeBalancer configs for ports that no longer exist on the Service
@@ -504,19 +504,20 @@ func (l *loadbalancers) getNodeBalancerByID(ctx context.Context, service *v1.Ser
504504 return nb , nil
505505}
506506
507- func (l * loadbalancers ) getLoadBalancerTags (_ context.Context , service * v1.Service ) []string {
507+ func (l * loadbalancers ) getLoadBalancerTags (_ context.Context , clusterName string , service * v1.Service ) []string {
508+ tags := []string {clusterName }
508509 tagStr , ok := getServiceAnnotation (service , annLinodeLoadBalancerTags )
509510 if ok {
510- return strings .Split (tagStr , "," )
511+ return append ( tags , strings .Split (tagStr , "," ) ... )
511512 }
512- return [] string {}
513+ return tags
513514}
514515
515516func (l * loadbalancers ) createNodeBalancer (ctx context.Context , clusterName string , service * v1.Service , configs []* linodego.NodeBalancerConfigCreateOptions ) (lb * linodego.NodeBalancer , err error ) {
516517 connThrottle := getConnectionThrottle (service )
517518
518519 label := l .GetLoadBalancerName (ctx , clusterName , service )
519- tags := l .getLoadBalancerTags (ctx , service )
520+ tags := l .getLoadBalancerTags (ctx , clusterName , service )
520521 createOpts := linodego.NodeBalancerCreateOptions {
521522 Label : & label ,
522523 Region : l .zone ,
0 commit comments