mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-21 01:26:28 +00:00
Revert conditional updates to configmap that breaks ingress
This commit is contained in:
parent
b201ac2f8f
commit
676291474a
@ -501,12 +501,6 @@ func (ic *IngressController) reconcileConfigMapForCluster(clusterName string) {
|
||||
return
|
||||
}
|
||||
|
||||
ingressList := ic.ingressInformerStore.List()
|
||||
if len(ingressList) <= 0 {
|
||||
glog.V(4).Infof("No federated ingresses, ignore reconcile config map.")
|
||||
return
|
||||
}
|
||||
|
||||
if clusterName == allClustersKey {
|
||||
clusters, err := ic.configMapFederatedInformer.GetReadyClusters()
|
||||
if err != nil {
|
||||
@ -529,7 +523,12 @@ func (ic *IngressController) reconcileConfigMapForCluster(clusterName string) {
|
||||
uidConfigMapNamespacedName := types.NamespacedName{Name: uidConfigMapName, Namespace: uidConfigMapNamespace}
|
||||
configMapObj, found, err := ic.configMapFederatedInformer.GetTargetStore().GetByKey(cluster.Name, uidConfigMapNamespacedName.String())
|
||||
if !found || err != nil {
|
||||
glog.Errorf("Failed to get ConfigMap %q for cluster %q. Will try again later: %v", uidConfigMapNamespacedName, cluster.Name, err)
|
||||
logmsg := fmt.Sprintf("Failed to get ConfigMap %q for cluster %q. Will try again later: %v", uidConfigMapNamespacedName, cluster.Name, err)
|
||||
if len(ic.ingressInformerStore.List()) > 0 { // Error-level if ingresses are active, Info-level otherwise.
|
||||
glog.Errorf(logmsg)
|
||||
} else {
|
||||
glog.V(4).Infof(logmsg)
|
||||
}
|
||||
ic.configMapDeliverer.DeliverAfter(clusterName, nil, ic.configMapReviewDelay)
|
||||
return
|
||||
}
|
||||
|
@ -130,15 +130,15 @@ func TestIngressController(t *testing.T) {
|
||||
t.Log("Adding Ingress UID ConfigMap to cluster 1")
|
||||
cluster1ConfigMapWatch.Add(cfg1)
|
||||
|
||||
// Test add federated ingress.
|
||||
t.Log("Adding Federated Ingress")
|
||||
fedIngressWatch.Add(&fedIngress)
|
||||
|
||||
t.Log("Checking that UID annotation on Cluster 1 annotation was correctly updated after adding Federated Ingress")
|
||||
t.Log("Checking that UID annotation on Cluster 1 annotation was correctly updated prior to adding Federated Ingress")
|
||||
cluster := GetClusterFromChan(fedClusterUpdateChan)
|
||||
assert.NotNil(t, cluster)
|
||||
assert.Equal(t, cluster.ObjectMeta.Annotations[uidAnnotationKey], cfg1.Data[uidKey])
|
||||
|
||||
// Test add federated ingress.
|
||||
t.Log("Adding Federated Ingress")
|
||||
fedIngressWatch.Add(&fedIngress)
|
||||
|
||||
t.Logf("Checking that appropriate finalizers are added")
|
||||
// There should be an update to add both the finalizers.
|
||||
updatedIngress := GetIngressFromChan(t, fedIngressUpdateChan)
|
||||
|
Loading…
Reference in New Issue
Block a user