Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClusterLogForwarder's status is constantly replaced, leading to infinite reconciliation runs #2315

Closed
andreaskaris opened this issue Jan 18, 2024 · 1 comment · Fixed by #2313
Assignees

Comments

@andreaskaris
Copy link
Contributor

andreaskaris commented Jan 18, 2024

ClusterLogForwarder's status is constantly replaced, leading to infinite reconciliation runs

The following code:

controllers/forwarding/forwarding_controller.go
@@ -83,7 +83,9 @@ func (r *ReconcileForwarder) Reconcile(ctx context.Context, request ctrl.Request
        // Fetch the ClusterLogForwarder instance
        instance, err, status := loader.FetchClusterLogForwarder(r.Client, request.NamespacedName.Namespace, request.NamespacedName.Name, true, func() logging.ClusterLogging { return *cl })
        if status != nil {
              instance.Status = *status

always repalces the entire CLF status. That in turn leads to constant status updates of the type Ready condition where lastTransitionTime is always set, even though no actual transition happens.

In turn, the operator infinitely reconciles resources, even though nothing happens.

You can easily see this by running the current version of the Operator with debug level 3:

 LOG_LEVEL=3 make run

With the following 2 resources in place:

[akaris@workstation logging]$ cat configuring-cluster-logging-minimal.yaml
apiVersion: "logging.openshift.io/v1"
kind: "ClusterLogging"
metadata:
  name: "instance" 
  namespace: openshift-logging
spec:
  managementState: "Managed"
  collection:
    tolerations:
    - effect: NoSchedule
      key: node-role.kubernetes.io/master
      operator: Exists
    type: vector
[akaris@workstation logging]$ cat configuring-log-forwarder.yaml
apiVersion: logging.openshift.io/v1
kind: ClusterLogForwarder
metadata:
  name: instance
  namespace: openshift-logging
spec:
  pipelines:
   - inputRefs:
     - audit
     outputRefs:
     - loki-external
     labels:
       job: openshift-audit
       clusterid: sno10
   - inputRefs:
     - application
     outputRefs:
     - loki-external
     labels:
       job: openshift-application
       clusterid: sno10
   - inputRefs:
     - infrastructure
     outputRefs:
     - loki-external
     labels:
       job: openshift-infrastructure
       clusterid: sno10
  outputs:
  - name: loki-external
    type: loki
    url: http://192.168.18.75:3100
@andreaskaris
Copy link
Contributor Author

/assign

andreaskaris added a commit to andreaskaris/cluster-logging-operator that referenced this issue Feb 9, 2024
Test for openshift#2315

Signed-off-by: Andreas Karis <ak.karis@gmail.com>
andreaskaris added a commit to andreaskaris/cluster-logging-operator that referenced this issue Feb 9, 2024
Test for openshift#2315

Signed-off-by: Andreas Karis <ak.karis@gmail.com>
andreaskaris added a commit to andreaskaris/cluster-logging-operator that referenced this issue Feb 19, 2024
Test for openshift#2315

Signed-off-by: Andreas Karis <ak.karis@gmail.com>
andreaskaris added a commit to andreaskaris/cluster-logging-operator that referenced this issue Feb 19, 2024
Test for openshift#2315

Signed-off-by: Andreas Karis <ak.karis@gmail.com>
andreaskaris added a commit to andreaskaris/cluster-logging-operator that referenced this issue Feb 19, 2024
Test for openshift#2315

Signed-off-by: Andreas Karis <ak.karis@gmail.com>
andreaskaris added a commit to andreaskaris/cluster-logging-operator that referenced this issue Feb 19, 2024
Test for openshift#2315

Signed-off-by: Andreas Karis <ak.karis@gmail.com>
andreaskaris added a commit to andreaskaris/cluster-logging-operator that referenced this issue Feb 19, 2024
Test for openshift#2315

Signed-off-by: Andreas Karis <ak.karis@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant