add ELBRbsFinalizer

This commit is contained in:
Slavik Panasovets 2021-12-02 15:48:52 +00:00
parent 6ba8c86fc3
commit e2c49a0dd1

View File

@ -41,6 +41,8 @@ import (
const ( const (
errStrLbNoHosts = "cannot EnsureLoadBalancer() with no hosts" errStrLbNoHosts = "cannot EnsureLoadBalancer() with no hosts"
ELBRbsFinalizer = "gke.networking.io/l4-netlb-v2"
) )
// ensureExternalLoadBalancer is the external implementation of LoadBalancer.EnsureLoadBalancer. // ensureExternalLoadBalancer is the external implementation of LoadBalancer.EnsureLoadBalancer.
@ -56,6 +58,10 @@ func (g *Cloud) ensureExternalLoadBalancer(clusterName string, clusterID string,
if val, ok := apiService.Annotations[RBSAnnotationKey]; ok && val == RBSEnabled { if val, ok := apiService.Annotations[RBSAnnotationKey]; ok && val == RBSEnabled {
return nil, cloudprovider.ImplementedElsewhere return nil, cloudprovider.ImplementedElsewhere
} }
// Skip service handling if service has Regional Backend Services finalizer
if hasFinalizer(apiService, ELBRbsFinalizer) {
return nil, cloudprovider.ImplementedElsewhere
}
if len(nodes) == 0 { if len(nodes) == 0 {
return nil, fmt.Errorf(errStrLbNoHosts) return nil, fmt.Errorf(errStrLbNoHosts)