Details
-
Task
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
None
-
None
-
Puppet Developer Experience
-
New Feature
-
Add `pdk config set` option to set, update or add to the value(s) in a given configuration key.
-
Needs Assessment
Description
pdk config set [--add] <key> <value>
Sets, updates, or adds to the value(s) in the given configuration key and outputs the new value(s).
If <key> is not a leaf node, exits non-zero with an error message.
If <key> already has a value set, issues a notice before replacing existing value.
If <key> is designed to store multiple values (e.g. a list):
If the current value list is empty, set the first value in the list to the provided <value>.
If the current value list is not empty and <value> is not already present in the list, add <value> to the list.
If <value> is already present in the value list, issues a notice that value was already on list, outputs the current values of <key>, and exits with a success status.
If <key> is a user-defined configuration key where we cannot infer whether or not it can have multiple values, assume it is a single-value key unless the user includes the --add flag. If the user includes the --add flag, treat it as a multi-value key as described above.