From 6dc1241e2c9baa62f5e0596cb63200b06a6f7a02 Mon Sep 17 00:00:00 2001 From: Rohit Ramkumar Date: Tue, 19 Jun 2018 08:42:30 -0700 Subject: [PATCH] On removal of backend config name from service annotaion, ensure no existing settings are affected --- pkg/controller/translator/translator.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/controller/translator/translator.go b/pkg/controller/translator/translator.go index daaaedaca1..f6ab2b068f 100644 --- a/pkg/controller/translator/translator.go +++ b/pkg/controller/translator/translator.go @@ -108,9 +108,11 @@ func (t *Translator) getServicePort(id utils.ServicePortID) (*utils.ServicePort, if t.ctx.BackendConfigEnabled { beConfig, err = backendconfig.GetBackendConfigForServicePort(t.ctx.BackendConfigInformer.GetIndexer(), svc, port) if err != nil { - if err == backendconfig.ErrNoBackendConfigForPort { - beConfig = &backendconfigv1beta1.BackendConfig{} - } else { + // If we could not find a backend config name for the current + // service port, then do not return an error. Removing a reference + // to a backend config from the service annotation is a valid + // step that a user could take. + if err != backendconfig.ErrNoBackendConfigForPort { return svcPort, errors.ErrSvcBackendConfig{ServicePortID: id, Err: err} } }