diff --git a/docs/howto/manage-actions.md b/docs/howto/manage-actions.md index 40d46345e..0bd090577 100644 --- a/docs/howto/manage-actions.md +++ b/docs/howto/manage-actions.md @@ -39,6 +39,8 @@ actions: additionalProperties: false ``` +You should **always** include the `additionalProperties` field, which controls whether users can provide properties that are not in the definition. The default value of the field changed from `true` in Juju 3 to `false` in Juju 4. If you don't explicitly include the field, the charm behaviour will differ depending on which Juju version the charm is deployed to. + In the `src/charm.py` file of the charm, add a class that mirrors the configuration from `charmcraft.yaml`. This lets your static type checker and IDE know what Python type the parameters should be, and provides a place to do diff --git a/docs/tutorial/from-zero-to-hero-write-your-first-kubernetes-charm/expose-operational-tasks-via-actions.md b/docs/tutorial/from-zero-to-hero-write-your-first-kubernetes-charm/expose-operational-tasks-via-actions.md index 95351e8b2..710829372 100644 --- a/docs/tutorial/from-zero-to-hero-write-your-first-kubernetes-charm/expose-operational-tasks-via-actions.md +++ b/docs/tutorial/from-zero-to-hero-write-your-first-kubernetes-charm/expose-operational-tasks-via-actions.md @@ -36,7 +36,8 @@ actions: show-password: description: Show username and password in output information type: boolean - default: False + default: false + additionalProperties: false ``` ## Define an action class diff --git a/examples/k8s-4-action/charmcraft.yaml b/examples/k8s-4-action/charmcraft.yaml index 8340a8b9c..6b8c21948 100644 --- a/examples/k8s-4-action/charmcraft.yaml +++ b/examples/k8s-4-action/charmcraft.yaml @@ -43,7 +43,8 @@ actions: show-password: description: Show username and password in output information type: boolean - default: False + default: false + additionalProperties: false containers: demo-server: diff --git a/examples/k8s-5-observe/charmcraft.yaml b/examples/k8s-5-observe/charmcraft.yaml index b1a775b06..1624500fb 100644 --- a/examples/k8s-5-observe/charmcraft.yaml +++ b/examples/k8s-5-observe/charmcraft.yaml @@ -69,6 +69,7 @@ actions: description: Show username and password in output information type: boolean default: False + additionalProperties: false containers: demo-server: