description: Podman Desktop when clause contexts reference
tags: [podman-desktop, extension, writing, when clause]
keywords: [podman desktop, extension, writing, when clause]
---
# When clause contexts
Podman Desktop uses when clauses to enable or disable extensions command and UI customizations, such as views.
For example, the Kind extension adds a custom icon to a container that has a label equals to `io.x-k8s.kind.cluster` by using the following instruction.
```json
"views": {
"icons/containersList": [
{
"when": "io.x-k8s.kind.cluster in containerLabelKeys",
"icon": "${kind-icon}"
}
]
}
```
A when clause can consist of a context key (such as `isLinux`) or complex expressions to define a specific state.
### Available context keys
Podman Desktop has a set of context keys that are evaluated to Boolean true/false.
If you are creating your own extension and none of the existing keys suit your needs, you can set your own context key by calling the function `setValue(key: string, value: any, scope?: 'onboarding')` provided by the `context` namespace in the Podman Desktop API.
The scope, if specified, triggers a custom behavior to avoid any type of collisions between different extensions for that specific scope. Podman Desktop is responsible for handling its state and cleans it accordingly when necessary.
If omitted, the key/value is set globally. For this reason it is recommended to use the extension id as part of the key to avoid unexpected collisions with other extensions.
The first example below sets the key `"podmanIsInstalled"` to true globally while the second example sets the key `"toolInstalled"` to `oc.exe` using the onboarding scope.
**Note:** the right side is a value and not considered as a context key, so no value is searched in the context. If it contains whitespaces, it must be wrapped in single-quotes (for example `'my tool.exe'`)
| Less than | `<`, `<=` | `onboardingContext:toolInstalled <= 3` |
#### In and not in
The `in`/`not in` operators allow checking if a value exists/not exists within the other. The right should be a context key, which value is retrieved in the context. The left can be a value or a context key.