Bug 2152681 - Support regular expressions for node attributes
Summary: Support regular expressions for node attributes
Keywords:
Status: NEW
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: pcs
Version: 9.2
Hardware: All
OS: All
low
low
Target Milestone: rc
: ---
Assignee: Tomas Jelinek
QA Contact: cluster-qe
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-12-12 16:53 UTC by Ken Gaillot
Modified: 2023-08-10 15:42 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-141932 0 None None None 2022-12-12 17:02:41 UTC

Description Ken Gaillot 2022-12-12 16:53:45 UTC
Description of problem: pcs doesn't support regular expressions when updating, querying, or deleting node attributes

Additional info: crm_attribute supports POSIX extended regular expressions given with -P/--pattern in combination with -G/--query (since 1.1.17 / feature set 3.0.13), or with -v/--update and -D/--delete when used with -l/--lifetime=reboot (since 2.1.5 / feature set 3.16.1). Example:

    crm_attribute --query --node node1 --pattern 'ban-.*'

would list all node attributes like ban-httpd, ban-ip, etc.

I believe that currently, pcs only supports permanent node attributes (i.e. beneath <node>), not transient node attributes (i.e. beneath <node_state>). So, only --query would be usable currently. Adding support for transient attributes would mean adding them with crm_attribute --lifetime=reboot (or attrd_updater, but that does not support regular expressions).

Comment 1 Ken Gaillot 2022-12-14 17:53:26 UTC
It turned out to be trivial to enable regular expressions with -v/--update and -D/--delete regardless of lifetime, so the --lifetime limitation will be lifted in RHEL 8.9/9.3.


Note You need to log in before you can comment on or make changes to this bug.