Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-33386

`pcs constraint location config resources` shows constraint with expired rule [rhel-10]

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Normal Normal
    • rhel-10.0
    • rhel-9.4
    • pcs
    • pcs-0.12.0~b1-1.el10
    • None
    • Low
    • 05c3344ae636f6c673a643c13aa4c993a66ecb4a
    • rhel-ha
    • 13
    • 23
    • 3
    • False
    • False
    • Hide

      None

      Show
      None
    • Yes
    • Red Hat Enterprise Linux
    • None
    • Bug Fix
    • Hide
      .Resource constraints with expired rules no longer display

      Before this update, the `pcs constraint location config resources` command displayed resource constraints with expired rules in the output. With this update, the command no longer displays constraints with expired rules if you do not specify the `--all` option.
      Show
      .Resource constraints with expired rules no longer display Before this update, the `pcs constraint location config resources` command displayed resource constraints with expired rules in the output. With this update, the command no longer displays constraints with expired rules if you do not specify the `--all` option.
    • Done
    • x86_64
    • None

      .Please provide the package NVR for which bug is seen:

      pcs-0.11.7-2.el9_4.x86_64

      How reproducible:

      easily

      Steps to reproduce:

      • setup a cluster
      • create resources with location constraint, one with expired and one with active rule:
          # pcs resource create dummy1 ocf:pacemaker:Dummy
          # pcs resource create dummy2 ocf:pacemaker:Dummy
          # pcs constraint location dummy1 rule score='-INFINITY' date lt '1999-01-01'
          # pcs constraint location dummy2 rule score='-INFINITY' date lt '2025-01-01'
           
      • check location constraint config:
          # pcs constraint location config resources
          Location Constraints:
            Resource: dummy1
              Constraint:
                Rules:
                  Rule (expired): score=-INFINITY
                    Expression: date lt 1999-01-01
            Resource: dummy2
              Constraint:
                Rules:
                  Rule: score=-INFINITY
                    Expression: date lt 2025-01-01
      

      Expected results:

      Only active location constraint is displayed.

      Actual results:

      Expired location constraint is displayed as well. I expected to see the expired constraints only when using `pcs constraint location config --all`

      Additional info:

      When I try to use both `resources` and `nodes` parameters, I don't get any warning that it is not supported and parameter `nodes` is just ignored.

          # pcs resource create dummy3 ocf:pacemaker:Dummy
          # pcs constraint location dummy3 prefers virt-504='1000' virt-507='1005'
          # pcs constraint location config resources dummy3 nodes virt-504
          Location Constraints:
            Resource: dummy3
              Prefers:
                node 'virt-504' with score 1000
                node 'virt-507' with score 1005
          
          # pcs constraint location config nodes virt-504
          Location Constraints:
            Node: virt-504
              Preferred by:
                resource 'dummy3' with score 1000
      

      There is also an inconsistency in output formatting `Resource: dummy2` vs `resource 'dummy2'`. Please see details below.

          # pcs constraint location config resources dummy2
          Location Constraints:
            Resource: dummy2
              Constraint:
                Rules:
                  Rule: score=-INFINITY
                    Expression: date lt 2025-01-01
      
          # pcs constraint location config --all
          Location Constraints:
            resource 'dummy1'
              Rules:
                Rule (expired): score=-INFINITY
                  Expression: date lt 1999-01-01
            resource 'dummy2'
              Rules:
                Rule: score=-INFINITY
                  Expression: date lt 2025-01-01
      

              rhn-support-nhostako Nina Hostakova
              rhn-support-msmazova Marketa Smazova
              Tomas Jelinek Tomas Jelinek
              Nina Hostakova Nina Hostakova
              Steven Levine Steven Levine (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              12 Start watching this issue

                Created:
                Updated:
                Resolved: