Call deleteBalancer for services of the wrong type.
Turns out, you _can_ convert a service from type LoadBalancer to
something else, whereas I thought that the type was immutable after
creation. Oops!
@@ -45,17 +45,17 @@ type controller struct {
}
func (c *controller) SetBalancer(name string, svcRo *v1.Service) error {
+ glog.Infof("%s: start update", name)
+ defer glog.Infof("%s: end update", name)
+
if svcRo == nil {
return c.deleteBalancer(name)
}
if svcRo.Spec.Type != "LoadBalancer" {
- return nil
+ return c.deleteBalancer(name)
}
- glog.Infof("%s: start update", name)
- defer glog.Infof("%s: end update", name)
-
if c.config == nil {
// Config hasn't been read, nothing we can do just yet.
glog.Infof("%s: skipped, waiting for config", name)
