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(
vcfgs, err := worker.vcfg.List(labels.Everything())
if err != nil {
if !errors.IsNotFound(err) {
return []update.Status{update.MakeRecoverable("%v", err)}
allStatus = append(allStatus, update.MakeRecoverable("%v", err))
return allStatus
}
}
for _, v := range vcfgs {
......@@ -1237,14 +1238,17 @@ func (worker *NamespaceWorker) addOrUpdateIng(
svc.Namespace, svc.Name)
if status := worker.configSharding(
&vclSpec, vcfg, svc); status.IsError() {
return []update.Status{status}
allStatus = append(allStatus, status)
return allStatus
}
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)
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,
vcfg.Kind, vcfg.Namespace, vcfg.Name)
......@@ -1261,7 +1265,8 @@ func (worker *NamespaceWorker) addOrUpdateIng(
// Varnish is ready.
offldrSpec, err := worker.ings2OffloaderSpec(svc, ings)
if err != nil {
return []update.Status{update.MakeFatal("%v", err)}
allStatus = append(allStatus, update.MakeFatal("%v", err))
return allStatus
}
offldrSpec.Defaults = &haproxyDefSpec
for n, v := range onlds {
......@@ -1272,7 +1277,8 @@ func (worker *NamespaceWorker) addOrUpdateIng(
ingNames)
} else {
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 {
worker.log.Warnf("Service %s: Currently no known "+
"dataplane Secret", svcKey)
......@@ -1286,7 +1292,8 @@ func (worker *NamespaceWorker) addOrUpdateIng(
addrs, offldAddrs, serviceStatus := worker.svc2Addrs(svc)
if serviceStatus.IsError() {
return []update.Status{serviceStatus}
allStatus = append(allStatus, serviceStatus)
return allStatus
}
if len(offldrSpec.Secrets) != 0 || len(onlds) != 0 {
......@@ -1300,13 +1307,15 @@ func (worker *NamespaceWorker) addOrUpdateIng(
}
if status := worker.hController.Update(svcKey, offldAddrs,
offldrSpec); status.IsError() {
return []update.Status{status}
allStatus = append(allStatus, status)
return allStatus
}
for _, tlsSecr := range offldrSpec.Secrets {
status := worker.hController.AddOrUpdateTLSSecret(
svcKey, tlsSecr)
if status.IsError() {
return []update.Status{status}
allStatus = append(allStatus, status)
return allStatus
}
worker.log.Infof("Ingress TLS Secret %s/%s: "+
"Service %s: %s", tlsSecr.Namespace,
......@@ -1316,7 +1325,8 @@ func (worker *NamespaceWorker) addOrUpdateIng(
secret, err := worker.setAdmSecretForSvc(svc)
if err != nil {
return []update.Status{IncompleteIfNotFound(err, "%v", err)}
allStatus = append(allStatus, IncompleteIfNotFound(err, "%v", err))
return allStatus
}
secretKey := secret.Namespace + "/" + secret.Name
updateSvcStatus := worker.vController.UpdateSvcForSecret(svcKey, secretKey)
......@@ -1324,7 +1334,8 @@ func (worker *NamespaceWorker) addOrUpdateIng(
// Only abort on fatal errors.
// Recoverable or Incomplete status may be
// resolved by the upcoming update.
return []update.Status{updateSvcStatus}
allStatus = append(allStatus, updateSvcStatus)
return allStatus
}
worker.hController.SetOffldSecret(svcKey, secretKey)
......@@ -1368,13 +1379,16 @@ func (worker *NamespaceWorker) addOrUpdateIng(
controllerStatus := worker.vController.Update(svcKey, vclSpec, addrs,
ingsMeta, vcfgMeta, bcfgMeta)
if controllerStatus.IsError() {
return []update.Status{controllerStatus}
allStatus = append(allStatus, controllerStatus)
return allStatus
}
worker.log.Debugf("Updated config svc=%s ingressMetaData=%+v "+
"vcfgMetaData=%+v bcfgMetaData=%+v: %+v", svcKey,
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
......
......@@ -276,7 +276,6 @@ func (worker *NamespaceWorker) next() {
}
defer worker.queue.Done(obj)
// if ingress dispatchIngress
status := worker.dispatch(obj)
msgPfx := ""
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