Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-51191

cluster-compare capture group fails with regex content in source CR

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • 4.18
    • oc / cluster-compare
    • None
    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • Proposed
    • Telco kube-compare Sprint 267
    • 1
    • In Progress
    • Bug Fix
    • Hide
      The capturegroup inline diff algorithm could miss properly matching source text if the source text overlapped with the capturegroup's definition (for example, if the source text ended in a ')' character). The updated algorithm avoids this oversight by properly escaping the capturegroup definition from being broken by partial source-text matches.
      Show
      The capturegroup inline diff algorithm could miss properly matching source text if the source text overlapped with the capturegroup's definition (for example, if the source text ended in a ')' character). The updated algorithm avoids this oversight by properly escaping the capturegroup definition from being broken by partial source-text matches.
    • None
    • None
    • None
    • None

      Description of problem:

      With a user/cluster CR matching this:

      ---
      apiVersion: tuned.openshift.io/v1
      kind: Tuned
      metadata:
        name: configuration-nic
        namespace: openshift-cluster-node-tuning-operator
      spec:
        profile:
        - data: |
            [main]
            summary=Configuration to set to 32 the nb of interrupt per NIC
            # Make sure the include name matches the PerformanceProfile
            include=openshift-node-performance-my-pp-name
            [net]
            type=net
            # Update the NIC name pattern
            devices_udev_regex=^INTERFACE=eno(0|1)
            channels=combined 16
          name: configuration-nic
        recommend:
        - machineConfigLabels:
            machineconfiguration.openshift.io/role: "worker-2"
          priority: 19
          profile: configuration-nic
      

      I want to use the following template, but it fails to correctly match

       

      ---
      apiVersion: tuned.openshift.io/v1
      kind: Tuned
      metadata:
        name: configuration-nic
        namespace: openshift-cluster-node-tuning-operator
      spec:
        profile:
        {{- range .spec.profile }}
        - data: |
            [main]
            summary=Configuration to set to 32 the nb of interrupt per NIC
            # Make sure the include name matches the PerformanceProfile
            include=openshift-node-performance-$name
            [net]
            type=net
            # Update the NIC name pattern
            devices_udev_regex=^INTERFACE=(?<ifregex>[^\n\r]+)
            channels=combined (?<chcount>[0-9]+)
          name: configuration-nic
        {{- end }}
        recommend:
        - machineConfigLabels:
            machineconfiguration.openshift.io/role: "worker-2"
          priority: 19
          profile: configuration-nic 

       

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

      4.17    

      How reproducible:

          100%

      Steps to Reproduce:

          1.
          2.
          3.
          

      Actual results:

          

      Expected results:

          

      Additional info:

          

              jramsay1@redhat.com Jim Ramsay
              rhn-support-imiller Ian Miller
              None
              None
              Yogesh Ahire Yogesh Ahire
              None
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: