Skip to content

Commit

Permalink
feat: optional environment label selector fieldpath
Browse files Browse the repository at this point in the history
Signed-off-by: Philippe Scorsolini <p.scorsolini@gmail.com>
  • Loading branch information
phisco committed Sep 5, 2023
1 parent 480b7e9 commit 3705439
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions content/master/concepts/environment-configs.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,35 @@ spec:
# Removed for brevity
```

By default, Crossplane will error out if the
{{<hover label="byLabel" line="16">}}valueFromFieldPath{{</hover>}}
field doesn't exist in the composite resource, for example if it's marked as
optional. You can change this behavior with the
{{<hover label="byLabelOptional" line="17">}}fromFieldPathPolicy{{</hover>}} field.

```yaml {label="byLabelOptional",copy-lines="all"}
apiVersion: apiextensions.crossplane.io/v1
kind: Composition
metadata:
name: example-composition
spec:
environment:
environmentConfigs:
- type: Selector
selector:
matchLabels:
- key: my-label-key
type: Value
value: my-label-value
- key: my-label-key
type: FromCompositeFieldPath
valueFromFieldPath: spec.parameters.deploy
fromFieldPathPolicy: Optional
resources:
# Removed for brevity
```


#### Manage selector results

Selecting environments by labels may return more than one environment.
Expand Down

0 comments on commit 3705439

Please sign in to comment.