Skip to content

Adapt checks to Pacemaker 3 - #83

Open
antgamdia wants to merge 3 commits into
mainfrom
TRNT-4562-adapt-pacemaker3
Open

Adapt checks to Pacemaker 3#83
antgamdia wants to merge 3 commits into
mainfrom
TRNT-4562-adapt-pacemaker3

Conversation

@antgamdia

@antgamdia antgamdia commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Description

This pull request refactors several check files to enhance compatibility and robustness for old and new Pacemaker versions.

  • Support change from <master> to <clone promotable=true> syntax, that is, wherever we used .master, now we filter by promotable clones instead.
  • Accept legacy (master/slave) and new roles (promoted/unpromoted).

Specifically:

Refactoring for Promotable Clone Support:

  • Updated all expectation checks in files like AE0C5F.yaml, AE0C60.yaml, AE0C61.yaml, AE0C62.yaml, AE0C63.yaml, AE0C64.yaml, AE0C65.yaml, AE0C67.yaml, AE0C6A.yaml, and AE0C6B.yaml to aggregate both master resources and clone resources flagged as promotable, ensuring checks apply to all relevant resource types.

Role Name Compatibility:

  • Modified logic to accept both "Master" and "Promoted" (and "Slave" and "Unpromoted") as valid operation roles when searching for monitor operations, improving compatibility with different resource configurations. [

Colocation Constraint Handling:

  • Removed unused value definitions for col_with_rsc_role and msclone in 3D8598.yaml, and updated colocation constraint checks to accept either "Promoted" or "Master" as the with-rsc-role, making the check less brittle.

Related #TRNT-4562

How was this tested?

N/A

Documentation changes

No

Additional information

Related to #77

Signed-off-by: Antonio Gamez Diaz <antonio.gamez@suse.com>
Signed-off-by: Antonio Gamez Diaz <antonio.gamez@suse.com>
Signed-off-by: Antonio Gamez Diaz <antonio.gamez@suse.com>
Comment thread checks/3D8598.yaml
Comment on lines -62 to -73
- name: col_with_rsc_role
customization_disabled: true
default: "Promoted"
conditions:
- value: "Master"
when: env.architecture_type == "classic"
- name: msclone
customization_disabled: true
default: "clone"
conditions:
- value: "master"
when: env.architecture_type == "classic"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just for saying: if "classic" --> use old names; if "angi" --> use new ones ... but I think we can support old/new Pacemaker terminology without tying it up to a certain version of our resource agent.

Comment thread checks/AE0C60.yaml
Comment on lines 61 to 71

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of only considering facts.resources.master we just find the promotable clones, as it is the new syntax.

Comment thread checks/AE0C60.yaml
for prim in rsc {
if prim.type == "SAPHana" {
let op = prim.operations.op.find(|oname| oname.name == "monitor" && oname.role == "Master");
let op = prim.operations.op.find(|oname| oname.name == "monitor" && (oname.role == "Master" || oname.role == "Promoted"));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this is another change to support Master and the new one Promoted.

@antgamdia
antgamdia requested review from abravosuse and ksanjeet July 30, 2026 08:48
@abravosuse

Copy link
Copy Markdown
Contributor

I am not sure what to do with this PR @antgamdia . From the code itself I cannot tell whether the changes will work or not. I would have to deploy clusters using the new terminology and test the changes against them. But I don't have the bandwidth to do that right now.

@arbulu89 arbulu89 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@antgamdia
All of this changes depend on new pacemaker attributes and values, right?
I think a better approach would be to send pacemaker version as metadata, and based on that, change the values with the when clause.
Most of the code could would look cleaner.
Anyway, it might not fix all the issues and some check changes are needed

@antgamdia

Copy link
Copy Markdown
Contributor Author

I am not sure what to do with this PR

No worries, I just added you for awareness. Nothing actually is required at the moment.

All of this changes depend on new pacemaker attributes and values, right?

Partially. Some changes have been around for some time, like the promotable clones (since 2.1.0). It is in v3 where some fields were deprecated (like the master/slave roles), but I wouldn't add two different code branches (if new then xxx else then yyy), it might end up in more duplication rather than adding a couple of OR operations.

That said, I'm not an expert on writing checks, so up to the checks team's preference :P

@antgamdia antgamdia added the enhancement New feature or request label Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Development

Successfully merging this pull request may close these issues.

3 participants