Commit 1bd42928 authored by Tim Leers's avatar Tim Leers

collect all status and return them

parent 1d3e51ba
...@@ -1218,7 +1218,8 @@ func (worker *NamespaceWorker) addOrUpdateIng( ...@@ -1218,7 +1218,8 @@ func (worker *NamespaceWorker) addOrUpdateIng(
vcfgs, err := worker.vcfg.List(labels.Everything()) vcfgs, err := worker.vcfg.List(labels.Everything())
if err != nil { if err != nil {
if !errors.IsNotFound(err) { if !errors.IsNotFound(err) {
return []update.Status{update.MakeRecoverable("%v", err)} allStatus = append(allStatus, update.MakeRecoverable("%v", err))
return allStatus
} }
} }
for _, v := range vcfgs { for _, v := range vcfgs {
...@@ -1237,14 +1238,17 @@ func (worker *NamespaceWorker) addOrUpdateIng( ...@@ -1237,14 +1238,17 @@ func (worker *NamespaceWorker) addOrUpdateIng(
svc.Namespace, svc.Name) svc.Namespace, svc.Name)
if status := worker.configSharding( if status := worker.configSharding(
&vclSpec, vcfg, svc); status.IsError() { &vclSpec, vcfg, svc); status.IsError() {
return []update.Status{status} allStatus = append(allStatus, status)
return allStatus
} }
if err := worker.configAuth(&vclSpec, vcfg); err != nil { if err := worker.configAuth(&vclSpec, vcfg); err != nil {
return []update.Status{update.MakeIncomplete("%v", err)} allStatus = append(allStatus, update.MakeIncomplete("%v", err))
return allStatus
} }
worker.configACL(&vclSpec, vcfg) worker.configACL(&vclSpec, vcfg)
if err := worker.configRewrites(&vclSpec, vcfg); err != nil { if err := worker.configRewrites(&vclSpec, vcfg); err != nil {
return []update.Status{update.MakeFatal("%v", err)} allStatus = append(allStatus, update.MakeFatal("%v", err))
return allStatus
} }
worker.configReqDisps(&vclSpec, vcfg.Spec.ReqDispositions, worker.configReqDisps(&vclSpec, vcfg.Spec.ReqDispositions,
vcfg.Kind, vcfg.Namespace, vcfg.Name) vcfg.Kind, vcfg.Namespace, vcfg.Name)
...@@ -1261,7 +1265,8 @@ func (worker *NamespaceWorker) addOrUpdateIng( ...@@ -1261,7 +1265,8 @@ func (worker *NamespaceWorker) addOrUpdateIng(
// Varnish is ready. // Varnish is ready.
offldrSpec, err := worker.ings2OffloaderSpec(svc, ings) offldrSpec, err := worker.ings2OffloaderSpec(svc, ings)
if err != nil { if err != nil {
return []update.Status{update.MakeFatal("%v", err)} allStatus = append(allStatus, update.MakeFatal("%v", err))
return allStatus
} }
offldrSpec.Defaults = &haproxyDefSpec offldrSpec.Defaults = &haproxyDefSpec
for n, v := range onlds { for n, v := range onlds {
...@@ -1272,7 +1277,8 @@ func (worker *NamespaceWorker) addOrUpdateIng( ...@@ -1272,7 +1277,8 @@ func (worker *NamespaceWorker) addOrUpdateIng(
ingNames) ingNames)
} else { } else {
if secrKey, dSecr, err := worker.getDplaneSecret(); err != nil { if secrKey, dSecr, err := worker.getDplaneSecret(); err != nil {
return []update.Status{update.MakeIncomplete("%s", err)} allStatus = append(allStatus, update.MakeIncomplete("%s", err))
return allStatus
} else if dSecr == nil { } else if dSecr == nil {
worker.log.Warnf("Service %s: Currently no known "+ worker.log.Warnf("Service %s: Currently no known "+
"dataplane Secret", svcKey) "dataplane Secret", svcKey)
...@@ -1286,7 +1292,8 @@ func (worker *NamespaceWorker) addOrUpdateIng( ...@@ -1286,7 +1292,8 @@ func (worker *NamespaceWorker) addOrUpdateIng(
addrs, offldAddrs, serviceStatus := worker.svc2Addrs(svc) addrs, offldAddrs, serviceStatus := worker.svc2Addrs(svc)
if serviceStatus.IsError() { if serviceStatus.IsError() {
return []update.Status{serviceStatus} allStatus = append(allStatus, serviceStatus)
return allStatus
} }
if len(offldrSpec.Secrets) != 0 || len(onlds) != 0 { if len(offldrSpec.Secrets) != 0 || len(onlds) != 0 {
...@@ -1300,13 +1307,15 @@ func (worker *NamespaceWorker) addOrUpdateIng( ...@@ -1300,13 +1307,15 @@ func (worker *NamespaceWorker) addOrUpdateIng(
} }
if status := worker.hController.Update(svcKey, offldAddrs, if status := worker.hController.Update(svcKey, offldAddrs,
offldrSpec); status.IsError() { offldrSpec); status.IsError() {
return []update.Status{status} allStatus = append(allStatus, status)
return allStatus
} }
for _, tlsSecr := range offldrSpec.Secrets { for _, tlsSecr := range offldrSpec.Secrets {
status := worker.hController.AddOrUpdateTLSSecret( status := worker.hController.AddOrUpdateTLSSecret(
svcKey, tlsSecr) svcKey, tlsSecr)
if status.IsError() { if status.IsError() {
return []update.Status{status} allStatus = append(allStatus, status)
return allStatus
} }
worker.log.Infof("Ingress TLS Secret %s/%s: "+ worker.log.Infof("Ingress TLS Secret %s/%s: "+
"Service %s: %s", tlsSecr.Namespace, "Service %s: %s", tlsSecr.Namespace,
...@@ -1316,7 +1325,8 @@ func (worker *NamespaceWorker) addOrUpdateIng( ...@@ -1316,7 +1325,8 @@ func (worker *NamespaceWorker) addOrUpdateIng(
secret, err := worker.setAdmSecretForSvc(svc) secret, err := worker.setAdmSecretForSvc(svc)
if err != nil { if err != nil {
return []update.Status{IncompleteIfNotFound(err, "%v", err)} allStatus = append(allStatus, IncompleteIfNotFound(err, "%v", err))
return allStatus
} }
secretKey := secret.Namespace + "/" + secret.Name secretKey := secret.Namespace + "/" + secret.Name
updateSvcStatus := worker.vController.UpdateSvcForSecret(svcKey, secretKey) updateSvcStatus := worker.vController.UpdateSvcForSecret(svcKey, secretKey)
...@@ -1324,7 +1334,8 @@ func (worker *NamespaceWorker) addOrUpdateIng( ...@@ -1324,7 +1334,8 @@ func (worker *NamespaceWorker) addOrUpdateIng(
// Only abort on fatal errors. // Only abort on fatal errors.
// Recoverable or Incomplete status may be // Recoverable or Incomplete status may be
// resolved by the upcoming update. // resolved by the upcoming update.
return []update.Status{updateSvcStatus} allStatus = append(allStatus, updateSvcStatus)
return allStatus
} }
worker.hController.SetOffldSecret(svcKey, secretKey) worker.hController.SetOffldSecret(svcKey, secretKey)
...@@ -1368,13 +1379,16 @@ func (worker *NamespaceWorker) addOrUpdateIng( ...@@ -1368,13 +1379,16 @@ func (worker *NamespaceWorker) addOrUpdateIng(
controllerStatus := worker.vController.Update(svcKey, vclSpec, addrs, controllerStatus := worker.vController.Update(svcKey, vclSpec, addrs,
ingsMeta, vcfgMeta, bcfgMeta) ingsMeta, vcfgMeta, bcfgMeta)
if controllerStatus.IsError() { if controllerStatus.IsError() {
return []update.Status{controllerStatus} allStatus = append(allStatus, controllerStatus)
return allStatus
} }
worker.log.Debugf("Updated config svc=%s ingressMetaData=%+v "+ worker.log.Debugf("Updated config svc=%s ingressMetaData=%+v "+
"vcfgMetaData=%+v bcfgMetaData=%+v: %+v", svcKey, "vcfgMetaData=%+v bcfgMetaData=%+v: %+v", svcKey,
ingsMeta, vcfgMeta, bcfgMeta, vclSpec) ingsMeta, vcfgMeta, bcfgMeta, vclSpec)
} }
return []update.Status{worker.updateIngStatus(svc, ings)}
allStatus = append(allStatus, worker.updateIngStatus(svc, ings))
return allStatus
} }
// We only handle Ingresses whose IngressClass is set to the value // We only handle Ingresses whose IngressClass is set to the value
......
...@@ -276,7 +276,6 @@ func (worker *NamespaceWorker) next() { ...@@ -276,7 +276,6 @@ func (worker *NamespaceWorker) next() {
} }
defer worker.queue.Done(obj) defer worker.queue.Done(obj)
// if ingress dispatchIngress
status := worker.dispatch(obj) status := worker.dispatch(obj)
msgPfx := "" msgPfx := ""
if syncObj, ok := obj.(*SyncObj); ok { if syncObj, ok := obj.(*SyncObj); ok {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment