Uploaded image for project: 'OpenShift Logging'
  1. OpenShift Logging
  2. LOG-6573

CLO doesn't set default value for `outputs[].lokiStack.target.namespace` when it's not set.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Normal Normal
    • Logging 6.1.2
    • Logging 6.2.0, Logging 6.0.z, Logging 6.1.z
    • Log Collection
    • False
    • None
    • False
    • NEW
    • NEW
    • Hide
      Before this change the API documentation claimed lokiStack outputs would default the target namespace which was incorrect and could result in the collector not being able to write to that output. This change updates the API documentation and also adds a validation to require the output target namespace to be set for the resource to be admissible.
      Show
      Before this change the API documentation claimed lokiStack outputs would default the target namespace which was incorrect and could result in the collector not being able to write to that output. This change updates the API documentation and also adds a validation to require the output target namespace to be set for the resource to be admissible.
    • Bug Fix
    • Log Collection - Sprint 265
    • Moderate

      Description of problem:

      In https://github.com/openshift/cluster-logging-operator/blob/master/bundle/manifests/observability.openshift.io_clusterlogforwarders.yaml#L1999-L2011 , it says:

                              target:
                                description: Target points to the LokiStack resources that
                                  should be used as a target for the output.
                                properties:
                                  name:
                                    description: Name of the in-cluster LokiStack resource.
                                    pattern: ^[a-z][a-z0-9-]{2,62}[a-z0-9]$
                                    type: string
                                  namespace:
                                    description: |-
                                      Namespace of the in-cluster LokiStack resource.                                If unset, this defaults to "openshift-logging".
                                    type: string
                                required:
                                - name

      In fact, when the `outputs[].lokiStack.target.namespace` is not set in CLF, the default value `openshift-logging` is not set:

      [sinks.output_lokistack_application]
      type = "loki"
      inputs = ["output_lokistack_application_remap_label"]
      endpoint = "https://logging-loki-gateway-http..svc:8080/api/logs/v1/application" 

      Version-Release number of selected component (if applicable):

      cluster-logging.v6.1.1

      cluster-logging.v6.0.3

      How reproducible:

      Always

      Steps to Reproduce:

      1. Deploy lokistack

      2. Create CLF to forward logs to lokistack:

      apiVersion: observability.openshift.io/v1
      kind: ClusterLogForwarder
      metadata:
        name: collector-lokistack
        namespace: openshift-logging
      spec:
        managementState: Managed
        outputs:
        - lokiStack:
            authentication:
              token:
                from: serviceAccount
            target:
              name: logging-loki
          name: lokistack
          tls:
            ca:
              configMapName: openshift-service-ca.crt
              key: service-ca.crt
          type: lokiStack
        pipelines:
        - inputRefs:
          - application
          - infrastructure
          name: logs-to-loki
          outputRefs:
          - lokistack
        serviceAccount:
          name: log-collector

      3. Check vector.toml

      Actual results:

      CLO doesn't set default value for `outputs[].lokiStack.target.namespace` when it's not set.

      Expected results:

      CLO should set default value for `outputs[].lokiStack.target.namespace` when it's not set. Or the `outputs[].lokiStack.target.namespace` should be a required field.

      Additional info:

              jcantril@redhat.com Jeffrey Cantrill
              qitang@redhat.com Qiaoling Tang
              Qiaoling Tang Qiaoling Tang
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: