Bug 2152681

Summary: Support regular expressions for node attributes
Product: Red Hat Enterprise Linux 9 Reporter: Ken Gaillot <kgaillot>
Component: pcsAssignee: Tomas Jelinek <tojeline>
Status: NEW --- QA Contact: cluster-qe <cluster-qe>
Severity: low Docs Contact:
Priority: low    
Version: 9.2CC: cluster-maint, idevat, mlisik, mpospisi, omular, tojeline
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.