Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/howto/manage-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion examples/k8s-4-action/charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions examples/k8s-5-observe/charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ actions:
description: Show username and password in output information
type: boolean
default: False
additionalProperties: false

containers:
demo-server:
Expand Down