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

+6
View File
@@ -397,6 +397,12 @@ describe("lib/config/classes", function() {
testInstance.setProp("json", "test", true);
assert.deepEqual(testInstance.get("json"), { test: true });
});
it("should unset field if passed undefined", function() {
testInstance.set("json", { test: true, extra: "yes" });
testInstance.setProp("json", "extra", undefined);
assert.deepEqual(testInstance.get("json"), { test: true });
});
});
});