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 (
errStrLbNoHosts = "cannot EnsureLoadBalancer() with no hosts"
ELBRbsFinalizer = "gke.networking.io/l4-netlb-v2"
)
// 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 {
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 {
return nil, fmt.Errorf(errStrLbNoHosts)