Commit b25abefe authored by Quinton Hoole's avatar Quinton Hoole

Add periodic ingress reconciliations.

parent 31d8f112
......@@ -711,10 +711,13 @@ func (ic *IngressController) reconcileIngress(ingress types.NamespacedName) {
objMeta, err := conversion.NewCloner().DeepCopy(clusterIngress.ObjectMeta)
if err != nil {
glog.Errorf("Error deep copying ObjectMeta: %v", err)
ic.deliverIngress(ingress, ic.ingressReviewDelay, true)
}
desiredIngress.ObjectMeta, ok = objMeta.(v1.ObjectMeta)
if !ok {
glog.Errorf("Internal error: Failed to cast to v1.ObjectMeta: %v", objMeta)
ic.deliverIngress(ingress, ic.ingressReviewDelay, true)
}
// Merge any annotations and labels on the federated ingress onto the underlying cluster ingress,
// overwriting duplicates.
......@@ -747,6 +750,7 @@ func (ic *IngressController) reconcileIngress(ingress types.NamespacedName) {
if len(operations) == 0 {
// Everything is in order
glog.V(4).Infof("Ingress %q is up-to-date in all clusters - no propagation to clusters required.", ingress)
ic.deliverIngress(ingress, ic.ingressReviewDelay, false)
return
}
glog.V(4).Infof("Calling federatedUpdater.Update() - operations: %v", operations)
......@@ -759,4 +763,6 @@ func (ic *IngressController) reconcileIngress(ingress types.NamespacedName) {
ic.deliverIngress(ingress, ic.ingressReviewDelay, true)
return
}
// Schedule another periodic reconciliation, only to account for possible bugs in watch processing.
ic.deliverIngress(ingress, ic.ingressReviewDelay, false)
}
......@@ -99,7 +99,6 @@ func TestIngressController(t *testing.T) {
Name: "test-ingress",
Namespace: "mynamespace",
SelfLink: "/api/v1/namespaces/mynamespace/ingress/test-ingress",
// TODO: Remove: Annotations: map[string]string{},
},
Status: extensions_v1beta1.IngressStatus{
LoadBalancer: api_v1.LoadBalancerStatus{
......
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