forked from crossplane-contrib/function-patch-and-transform
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from stevendborrelli/0.3.0-release
0.3.0 release
- Loading branch information
Showing
10 changed files
with
294 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Conditional Rendering of Individual Resources | ||
|
||
In this example, we show how each resource in a pipeline step can | ||
be individually rendered based on a condition. We will have a blue and a | ||
green deployment that the user can activate: | ||
|
||
```yaml | ||
apiVersion: nop.example.org/v1alpha1 | ||
kind: XNopConditional | ||
metadata: | ||
name: test-resource | ||
spec: | ||
env: dev | ||
render: true | ||
deployment: | ||
blue: true | ||
green: false | ||
``` | ||
In our Composition both the `blue-resource` and the `green-resource` have a | ||
`condition` that determines if they will be run. | ||
|
||
```yaml | ||
resources: | ||
- name: blue-resource | ||
condition: observed.composite.resource.spec.deployment.blue == true | ||
base: | ||
apiVersion: nop.crossplane.io/v1alpha1 | ||
kind: NopResource | ||
spec: | ||
forProvider: | ||
``` | ||
|
||
## Running this example | ||
|
||
- Install Crossplane version 1.14 or newer. See <https://docs.crossplane.io/v1.14/software/install/> | ||
- Install the nop provider in `kubectl apply -f provider.yaml` | ||
- Install the XRD & Composition in `kubectl apply -f definition.yaml -f composition.yaml` | ||
- Install the Function `kubectl apply -f functions.yaml` | ||
|
||
Finally install the xr: `kubectl apply -f xr` |
Oops, something went wrong.