Allow removing properties with set-prop

Implement removal of properties in ConfigGroup.setProp,
set_instance_config_prop, and the set-prop clusterioctl command.
This commit is contained in:
Hornwitser committed 2021-01-22 12:53:53 +01:00
1 parent dea3a30cae
commit 0e21060ea3
4 files changed
+24 -11

No files matched your search

+5 -1
View File
@@ -448,7 +448,11 @@ class ConfigGroup {
let prev = this._fields.get(name);
let updated = {...prev || {}};
updated[prop] = value;
if (value !== undefined) {
updated[prop] = value;
} else {
delete updated[prop];
}
this._fields.set(name, updated);
if (this._config && !isDeepStrictEqual(updated, prev)) {
this._config.emit("fieldChanged", this, name, prev);