From 35b4e10e3084007e8131723ee6cb305ca251ce3c Mon Sep 17 00:00:00 2001 From: Samuel Allan Date: Mon, 5 Feb 2024 09:24:02 +1030 Subject: [PATCH] Prevent unknown params passed to tempest charm See: https://bugs.launchpad.net/juju/+bug/2051187 By default, juju allows extra params to be passed to an action. This is risky here, because if a user makes a typo on a parameter, it could be the difference between running a small fast set of tests, or a very large slow set of tests... For example, if the test-list or regex params are typoed. Change-Id: Ic6daaab66b6187e8fb6151d861a0ba82e72ed756 --- charms/tempest-k8s/charmcraft.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/charms/tempest-k8s/charmcraft.yaml b/charms/tempest-k8s/charmcraft.yaml index 563e27a4..5b1ead80 100644 --- a/charms/tempest-k8s/charmcraft.yaml +++ b/charms/tempest-k8s/charmcraft.yaml @@ -106,6 +106,7 @@ actions: - found in test list "list1" - AND match regex "one" or "two" - AND don't match regex "three" + additionalProperties: false params: regex: type: string @@ -136,3 +137,4 @@ actions: get-lists: description: List existing test lists, to be used with validate action. + additionalProperties: false