-
Notifications
You must be signed in to change notification settings - Fork 104
ENT-13495: Made evaluation_order configurable via Augments #3068
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
This change exposes variables for configuring evaluation_order in body common control of the main policy (promises.cf) and in body agent control of both the main and update policies (promises.cf, update.cf). Ticket: ENT-13495 Changelog: Title
dc8691d to
f69698b
Compare
…control It doesn't work in the way that other control variables work.
|
Note, I initially implemented this for both common control and agent control, but in my testing overriding the variable via def.json would not result in a change in value for common control. However, it did work for body agent control. |
| # The order in which promises are evaluated (top_down|classic) | ||
| evaluation_order => "$(default:def.control_agent_update_evaluation_order)"; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nickanderson you'll need to guard this with a minimum version macro.
craigcomstock
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs some work but basically good!
|
|
||
| ### Configure the evaluation order for cf-agent evaluated promises for update policy | ||
|
|
||
| By default CFEngine processes promises in "Normal Order". Configure `default:def.control_agent_evaluation_order` to control the default promise evaluation order for `cf-agent` during the execution of the update policy. This variable is used to set `evaluation_order` in `body agent control` in `update.cf` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe include link to Normal Order around that phrase.
Why is this augment named without any reference to update policy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this update section you should be talking about control_agent_update_evaluation_order and not control_agent_evaluation_order as you have done right? I noticed this difference as I looked at the actual policy below.
MPF.md
Outdated
|
|
||
| - Introduced in 3.27.0. | ||
|
|
||
| **See also:** [Configure the evaluation order of cf-agent for main policy](#Configure the evaluation order of cf-agent for main policy), [Configure the evaluation order of cf-agent for main policy](#Configure the evaluation order of cf-agent for main policy), [`evaluation_order` in `body agent control`][cf-agent#evaluation_order], [Policy style guide on promise ordering][Policy style guide#Promise ordering] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you repeat "main policy" twice. I think you meant to mention "main" and then "update", two separate things.
MPF.md
Outdated
|
|
||
| - Introduced in 3.27.0. | ||
|
|
||
| **See also:** [Configure the evaluation order of all components for main policy](#Configure the evaluation order of all components for main policy), [Configure cf-agent promise evaluation order for update policy](#Configure the evaluation order for cf-agent evaluated promises for update policy), [`evaluation_order` in `body common control`][Components#evaluation_order], [Policy style guide on promise ordering][Policy style guide#Promise ordering] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here this looks OK where you mention main policy and update policy
| # the promise was verified before it is checked again. | ||
|
|
||
| ifelapsed => "1"; | ||
| ifelapsed => "1"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the whitespace change? comments two-spaces indent, then attribute 2 from that?
| any:: | ||
|
|
||
| # The order in which promises are evaluated (top_down|classic) | ||
| evaluation_order => "$(default:def.control_agent_evaluation_order)"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this evaluation_order interact with those in update.cf and promises.cf? It would seem you need to document that behavior from a binary point of view. I see that if you set all three augments, the update/main augments would be evaluated first as they are in the entry-points. After that, the agent evaluation order would be evaluated as the controls policy was read in via inputs attributes in body common control in update.cf and promises.cf.
Ticket: ENT-13495