Skip to content

Commit

Permalink
NetLBFinalizerV3 for NEG variant of L4 RBS NetLB.
Browse files Browse the repository at this point in the history
NetLBFinalizerV3 will be added to the L4 RBS NetLBs that opt-in for NEG support.
  • Loading branch information
mmamczur committed May 29, 2024
1 parent 9abc64c commit d27d63c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/utils/common/finalizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ const (
NegFinalizerKey = "networking.gke.io/neg-finalizer"
// NetLBFinalizerV2 is the finalizer used by newer controllers that manage L4 External LoadBalancer services.
NetLBFinalizerV2 = "gke.networking.io/l4-netlb-v2"
// NetLBFinalizerV3 is the finalizer used by the NEG backed variant of the L4 External LoadBalancer services.
NetLBFinalizerV3 = "gke.networking.io/l4-netlb-v3"
// LoadBalancerCleanupFinalizer added by original kubernetes service controller. This is not required in L4 RBS/ILB-subsetting services.
LoadBalancerCleanupFinalizer = "service.kubernetes.io/load-balancer-cleanup"
)
Expand Down
5 changes: 5 additions & 0 deletions pkg/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,11 @@ func HasL4NetLBFinalizerV2(svc *api_v1.Service) bool {
return slice.ContainsString(svc.ObjectMeta.Finalizers, common.NetLBFinalizerV2, nil)
}

// HasL4NetLBFinalizerV3 returns true if the given Service has NetLBFinalizerV3
func HasL4NetLBFinalizerV3(svc *api_v1.Service) bool {
return slice.ContainsString(svc.ObjectMeta.Finalizers, common.NetLBFinalizerV3, nil)
}

func LegacyForwardingRuleName(svc *api_v1.Service) string {
return cloudprovider.DefaultLoadBalancerName(svc)
}
Expand Down

0 comments on commit d27d63c

Please sign in to comment.