Skip to content

Added ifthen() policy function - #6441

Draft
nickanderson wants to merge 1 commit into
cfengine:masterfrom
nickanderson:ENT-14719/master
Draft

nickanderson wants to merge 1 commit into
cfengine:masterfrom
nickanderson:ENT-14719/master

Conversation

@nickanderson

Copy link
Copy Markdown
Member

ifthen() takes pairs of a class expression and a value and returns the
value of the first true class expression, like ifelse() without the
fall-through value. If no class expression is true, it returns nothing
and the promise using it doesn't define the variable, so there is no
need for a placeholder default.

Unlike 3-argument ifelse(), it is skipped for now while any argument
contains an unresolved variable, like other functions.

Ticket: ENT-14719
Changelog: Title

@nickanderson
nickanderson marked this pull request as draft October 26, 2026 13:08
ifthen() takes pairs of a class expression and a value and returns the
value of the first true class expression, like ifelse() without the
fall-through value. If no class expression is true, it returns nothing
and the promise using it doesn't define the variable, so there is no
need for a placeholder default.

Unlike 3-argument ifelse(), it is skipped for now while any argument
contains an unresolved variable, like other functions.

Ticket: ENT-14719
Changelog: Title
@cf-bottom

Copy link
Copy Markdown

Thank you for submitting a PR! Maybe @craigcomstock can review this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants