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

clusterlogging.spec.visualization.ocpConsole.timeout as string fails

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • Logging 5.8.z, Logging 5.9.z
    • Log Collection
    • False
    • None
    • False
    • NEW
    • NEW
    • Bug Fix
    • Low

      Description of problem:

      if `.spec.visualization.ocpConsole.timeout` is set to be an string:

      $ oc get clusterlogging instance -o jsonpath='{.spec.visualization.ocpConsole}'  -n openshift-logging
      {"timeout":"120"} 
      

      as indicated in the API DOC:

      $ oc explain clusterlogging.spec.visualization.ocpConsole.timeout
      GROUP:      logging.openshift.io
      KIND:       ClusterLogging
      VERSION:    v1FIELD: timeout <string>DESCRIPTION:
          Timeout is the max duration before a query timeout 

      An unmarshal error is received in the `logging-view-plugin`:

      time="2024-04-11T13:35:51Z" level=error msg="unable to unmarshall config data" error="yaml: unmarshal errors:\n  line 1: cannot unmarshal !!str `120` into time.Duration" module=server 

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

      Identified in Logging 5.8 and 5.9

      How reproducible:

      Always

      Steps to Reproduce:

      1. Set `clusterlogging.spec.visualization.ocpConsole.timeout` to be an string:
        apiVersion: logging.openshift.io/v1
        kind: ClusterLogging
        metadata:
          name: instance
          namespace: openshift-logging
        spec:
          collection:
            type: vector
          logStore:
            lokistack:
              name: logging-loki
            type: lokistack
          managementState: Managed
          visualization:
            ocpConsole:
              timeout: "120"  <--- defined as an string
        --- OUTPUT OMMITED ---
        

      Actual results:

      An error is received in the `logging-view-plugin` leading to don't set in the OCP Console the `timeout`:

      $ oc logs deployment.apps/logging-view-plugin  |grep  "str .* into time.Duration"
      time="2024-04-11T13:35:51Z" level=error msg="unable to unmarshall config data" error="yaml: unmarshal errors:\n  line 1: cannot unmarshal !!str `120` into time.Duration" module=server
      

      Expected results:

      The API Docs reflects the correct type of `clusterlogging.spec.visualization.ocpConsole.timeout` at the same time that indicates the option of using s=seconds,m=minutes,h=hours,d=days.

      Additional info:

      Set the value of to be an integer followed of s=seconds,m=minutes,h=hours,d=days:

      $ oc patch clusterlogging/instance --type='json' -p='[{"op": "replace", "path":"/spec/visualization/ocpConsole/timeout","value":120s}]' 

      Article: https://access.redhat.com/solutions/7064576

            Unassigned Unassigned
            rhn-support-ocasalsa Oscar Casal Sanchez
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: