Repository navigation
Documented the complete list of unsafe functions for --simulate mode - #3799
Open
nickanderson wants to merge 1 commit into
Open
nickanderson wants to merge 1 commit into
nickanderson wants to merge 1 commit into
Conversation
nickanderson
force-pushed
the
doc-unsafe-functions-simulate
branch
2 times, most recently
from
October 21, 2026 16:10
730dcb3 to
331b218
Compare
The --simulate documentation mentioned "unsafe functions" but only gave execresult() as an example without listing all four unsafe functions. - Added a comprehensive table of all unsafe functions (execresult, execresult_as_data, returnszero, usemodule) to the --simulate section - Restructured the --simulate section with subheadings for clarity - Added a "Simulate mode" note to each of the four unsafe function reference pages linking back to the --simulate documentation - Noted that variables depending on unsafe functions will be unresolved unless tagged simulate_safe
nickanderson
force-pushed
the
doc-unsafe-functions-simulate
branch
from
October 21, 2026 16:11
331b218 to
9a4ded0
Compare
craigcomstock
requested changes
Oct 21, 2026
craigcomstock
left a comment
Contributor
There was a problem hiding this comment.
I do think this would be improved by changing "tagged" to "meta attribute added" in general.
|
|
||
| If a promise uses an unsafe function but you know the command is read-only (no | ||
| side effects), you can tag the promise with `simulate_safe` to allow it to | ||
| execute in simulate mode: |
Contributor
There was a problem hiding this comment.
"can tag the promise" probably deserves an example bit of code to make sure folks understand what that means... or a link to where we describe how to "tag a promise".
https://docs.cfengine.com/docs/master/reference/components/cf-agent/#simulate
bundle agent __main__
{
vars:
"msg"
string => execresult("/bin/echo Hello world!", "useshell"),
meta => { "simulate_safe" };
}
| - Supported on Linux for `files` and `packages` type promises | ||
| - Supported on Linux for `files` and `packages` type promises. | ||
| - Variables that depend on unsafe functions will be unresolved unless the | ||
| promise is tagged `simulate_safe`. |
Contributor
There was a problem hiding this comment.
again here maybe change "is tagged" to "has a meta attribute"
e.g. https://docs.cfengine.com/docs/master/reference/promise-types/#meta
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The --simulate documentation mentioned "unsafe functions" but only gave
execresult() as an example without listing all four unsafe functions.
execresult_as_data, returnszero, usemodule) to the --simulate section
reference pages linking back to the --simulate documentation
unless tagged simulate_safe