Skip to content

Commit

Permalink
Add compound constraint section
Browse files Browse the repository at this point in the history
Signed-off-by: Vu Dinh <[email protected]>
  • Loading branch information
dinhxuanvu committed Sep 10, 2021
1 parent f979265 commit 8ab48ec
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions enhancements/cluster-runtime-constraints.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,27 @@ The constraints that are specified in `olm-runtime-constraints` Configmap are co

If constraints are added to bundles, they will be evaluated and must be satisfied similarly to `olm.gvk.required` and `olm.package.required` properties.

#### Compound Constraint

It is possible to write `cel-go` expression to evaluate multiple different properties in one single expression that is specified in one constraint. For example:

```json=
{
"type": "olm.constraint",
"value": {
"evaluator": {
"id": "cel",
}
"source": 'properties.exists(p, p.type == "certified") && properties.exists(p, p.type == "new")',
"action": {
"id": "require"
}
}
}
```

The expression in `source` has two requirements that are linked in an AND (&&) logical operator. In order for that expression to be true, both requirements must be satisfied. This concept represents the compound constraint.

### Risks and Mitigations

### Prototype
Expand Down

0 comments on commit 8ab48ec

Please sign in to comment.