Skip to content

Commit 1005b0e

Browse files
authored
Report errors in logs for sidecar interaction (FoundationDB#660)
1 parent 8d8ebd7 commit 1005b0e

File tree

2 files changed

+9
-19
lines changed

2 files changed

+9
-19
lines changed

controllers/bounce_processes.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ func (b BounceProcesses) Reconcile(r *FoundationDBClusterReconciler, context ctx
8181
return false, MissingPodErrorByName(process, cluster)
8282
}
8383

84-
synced, _ := r.updatePodDynamicConf(cluster, instances[0])
84+
synced, err := r.updatePodDynamicConf(cluster, instances[0])
8585
if !synced {
86-
log.Info("Update dynamic Pod config", "namespace", cluster.Namespace, "cluster", cluster.Name, "processGroupID", instanceID, "synced", synced)
8786
allSynced = false
87+
log.Info("Update dynamic Pod config", "namespace", cluster.Namespace, "cluster", cluster.Name, "processGroupID", instanceID, "synced", synced, "error", err)
8888
}
8989
}
9090

controllers/update_pod_config.go

+7-17
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ package controllers
2222

2323
import (
2424
ctx "context"
25-
"fmt"
2625
"time"
2726

2827
fdbtypes "github.com/FoundationDB/fdb-kubernetes-operator/api/v1beta1"
@@ -49,7 +48,7 @@ func (u UpdatePodConfig) Reconcile(r *FoundationDBClusterReconciler, context ctx
4948
return false, err
5049
}
5150

52-
var errs []error
51+
allSynced := true
5352
// We try to update all instances and if we observe an error we add it to the error list.
5453
for index := range instances {
5554
instance := instances[index]
@@ -59,31 +58,22 @@ func (u UpdatePodConfig) Reconcile(r *FoundationDBClusterReconciler, context ctx
5958

6059
synced, err := r.updatePodDynamicConf(cluster, instance)
6160
if !synced {
62-
log.Info("Update dynamic Pod config", "namespace", configMap.Namespace, "cluster", cluster.Name, "processGroupID", instance.GetInstanceID(), "synced", synced)
63-
if err != nil {
64-
errs = append(errs, err)
65-
} else {
66-
errs = append(errs, fmt.Errorf("processGroupID %s not synced", instance.GetInstanceID()))
67-
}
68-
61+
allSynced = false
62+
log.Info("Update dynamic Pod config", "namespace", cluster.Namespace, "cluster", cluster.Name, "processGroupID", instance.GetInstanceID(), "synced", synced, "error", err)
6963
continue
7064
}
7165

7266
instance.Metadata.Annotations[fdbtypes.LastConfigMapKey] = configMapHash
7367
err = r.PodLifecycleManager.UpdateMetadata(r, context, cluster, instance)
7468
if err != nil {
69+
allSynced = false
7570
log.Info("Update Pod metadata", "namespace", configMap.Namespace, "cluster", cluster.Name, "processGroupID", instance.GetInstanceID(), "error", err)
76-
errs = append(errs, err)
7771
}
7872
}
7973

80-
if len(errs) > 0 {
81-
// If we return an error we don't requeue
82-
// So we just return that we can't continue but don't have an error
83-
return false, nil
84-
}
85-
86-
return true, nil
74+
// If we return an error we don't requeue
75+
// So we just return that we can't continue but don't have an error
76+
return allSynced, nil
8777
}
8878

8979
// RequeueAfter returns the delay before we should run the reconciliation

0 commit comments

Comments
 (0)