From 3244e5da5a391446ca932002663f2ceaaf91473f Mon Sep 17 00:00:00 2001 From: Pavithra Ramesh Date: Wed, 31 Jul 2019 16:15:20 -0700 Subject: [PATCH] Added comment on how to use ImplementedElsewhere --- staging/src/k8s.io/cloud-provider/cloud.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/staging/src/k8s.io/cloud-provider/cloud.go b/staging/src/k8s.io/cloud-provider/cloud.go index c42160e25d6..f7bb761a57f 100644 --- a/staging/src/k8s.io/cloud-provider/cloud.go +++ b/staging/src/k8s.io/cloud-provider/cloud.go @@ -104,6 +104,12 @@ func GetInstanceProviderID(ctx context.Context, cloud Interface, nodeName types. } // LoadBalancer is an abstract, pluggable interface for load balancers. +// PR https://github.com/kubernetes/kubernetes/pull/80660 added support for cloud providers to return an error +// ImplementedElsewhere. This error is used to indicate that the loadbalancer implementation is handled outside of +// cloud provider, maybe in a different controller. +// In order to use this correctly, the cloud-provider implementation needs to return "NotFound" +// for GetLoadBalancer and empty string for GetLoadBalancerName. EnsureLoadBalancer and UpdateLoadBalancer need to +// return ImplementedElsewhere error. EnsureLoadBalancerDeleted can return ImplementedElsewhere as well. type LoadBalancer interface { // TODO: Break this up into different interfaces (LB, etc) when we have more than one type of service // GetLoadBalancer returns whether the specified load balancer exists, and