Skip to content

[master] Add pruning option to file.keyvalue#65640

Merged
dwoz merged 2 commits intosaltstack:masterfrom
tacerus:keyvalue-prune
Jan 30, 2026
Merged

[master] Add pruning option to file.keyvalue#65640
dwoz merged 2 commits intosaltstack:masterfrom
tacerus:keyvalue-prune

Conversation

@tacerus
Copy link
Contributor

@tacerus tacerus commented Nov 29, 2023

What does this PR do?

This implements a new optional argument "prune" in the file.keyvalue state function, which, if set to True, deletes lines not configured using the "key_values" or "key"/"value" arguments as part of the execution. Useful for ensuring a file only contains the desired key/value pairs and no additional data.

What issues does this PR fix or reference?

Fixes: #65631

Previous Behavior

prune was not a valid argument.

New Behavior

prune is a a valid argument! :-)

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

Yes

@tacerus tacerus requested a review from a team as a code owner November 29, 2023 00:35
@tacerus tacerus requested review from dwoz and removed request for a team November 29, 2023 00:35
@salt-project-bot-prod-environment salt-project-bot-prod-environment bot changed the title Add pruning option to file.keyvalue [master] Add pruning option to file.keyvalue Nov 29, 2023
@tacerus tacerus force-pushed the keyvalue-prune branch 2 times, most recently from e335fd8 to 79a065b Compare November 29, 2023 00:41
@dwoz dwoz added this to the Argon v3008.0 milestone Dec 18, 2023
@dwoz dwoz requested a review from a team as a code owner March 16, 2025 22:09
Copy link
Contributor

@twangboy twangboy left a comment

Choose a reason for hiding this comment

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

If we get this in it will be part of 3008

twangboy
twangboy previously approved these changes Apr 9, 2025
Copy link
Contributor

@twangboy twangboy left a comment

Choose a reason for hiding this comment

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

Once the nightly builds are green we'll need to rebase this.

tacerus and others added 2 commits August 6, 2025 15:16
This implements a new optional argument "prune" in the file.keyvalue
state function, which, if set to True, deletes lines not configured
using the "key_values" or "key"/"value" arguments as part of the
execution. Useful for ensuring a file only contains the desired
key/value pairs and no additional data.

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE REQUEST] Support for deleting unconfigured lines in file.keyvalue

3 participants