diff --git a/example/composition.yaml b/example/composition.yaml deleted file mode 100644 index f2b6d4b..0000000 --- a/example/composition.yaml +++ /dev/null @@ -1,30 +0,0 @@ -apiVersion: apiextensions.crossplane.io/v1 -kind: Composition -metadata: - name: function-patch-and-transform -spec: - compositeTypeRef: - apiVersion: example.crossplane.io/v1 - kind: XR - mode: Pipeline - pipeline: - - step: patch-and-transform - functionRef: - name: function-patch-and-transform - input: - apiVersion: pt.fn.crossplane.io/v1beta1 - kind: Resources - resources: - - name: bucket - base: - apiVersion: s3.aws.upbound.io/v1beta1 - kind: Bucket - patches: - - type: FromCompositeFieldPath - fromFieldPath: "spec.location" - toFieldPath: "spec.forProvider.region" - transforms: - - type: map - map: - EU: "eu-north-1" - US: "us-east-2" \ No newline at end of file diff --git a/example/conditionals/README.md b/example/conditionals/README.md deleted file mode 100644 index a11e471..0000000 --- a/example/conditionals/README.md +++ /dev/null @@ -1,49 +0,0 @@ -# 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 Locally - -This example can be rendered using `crossplane beta render`: - -```shell -crossplane beta render xr.yaml composition.yaml functions.yaml -``` - -## Running this example in a Cluster - -- Install Crossplane version 1.14 or newer. See -- 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` diff --git a/example/conditionals/composition.yaml b/example/conditionals/composition.yaml deleted file mode 100644 index 7fc75ee..0000000 --- a/example/conditionals/composition.yaml +++ /dev/null @@ -1,70 +0,0 @@ ---- -apiVersion: apiextensions.crossplane.io/v1 -kind: Composition -metadata: - name: xnopconditionals.nop.example.org -spec: - compositeTypeRef: - apiVersion: nop.example.org/v1alpha1 - kind: XNopConditional - mode: Pipeline - pipeline: - - step: conditional-patch-and-transform - functionRef: - name: function-conditional-patch-and-transform - input: - apiVersion: conditional-pt.fn.crossplane.io/v1beta1 - kind: Resources - condition: observed.composite.resource.spec.render == true - resources: - - name: blue-resource - condition: observed.composite.resource.spec.deployment.blue == true - base: - apiVersion: nop.crossplane.io/v1alpha1 - kind: NopResource - spec: - forProvider: - fields: - integerField: 42 - stringField: "blue" - objectField: - stringField: "blueObject" - arrayField: - - stringField: "blueArray" - conditionAfter: - - time: 5s - conditionType: Ready - conditionStatus: "True" - connectionDetails: - - name: username - value: fakeuser - - name: password - value: verysecurepassword - - name: endpoint - value: 127.0.0.1 - - name: green-resource - condition: observed.composite.resource.spec.deployment.green == true - base: - apiVersion: nop.crossplane.io/v1alpha1 - kind: NopResource - spec: - forProvider: - fields: - integerField: 42 - stringField: "green" - objectField: - stringField: "greenObject" - arrayField: - - stringField: "greenArray" - conditionAfter: - - time: 5s - conditionType: Ready - conditionStatus: "True" - connectionDetails: - - name: username - value: fakeuser - - name: password - value: verysecurepassword - - name: endpoint - value: 127.0.0.1 - diff --git a/example/conditionals/definition.yaml b/example/conditionals/definition.yaml deleted file mode 100644 index e88d9a6..0000000 --- a/example/conditionals/definition.yaml +++ /dev/null @@ -1,33 +0,0 @@ -apiVersion: apiextensions.crossplane.io/v1 -kind: CompositeResourceDefinition -metadata: - name: xnopconditionals.nop.example.org -spec: - group: nop.example.org - names: - kind: XNopConditional - plural: xnopconditionals - versions: - - name: v1alpha1 - referenceable: true - served: true - schema: - openAPIV3Schema: - type: object - properties: - spec: - type: object - properties: - env: - type: string - render: - type: boolean - deployment: - type: object - properties: - blue: - description: Activate the blue resource - type: boolean - green: - description: Activate the green resource - type: boolean \ No newline at end of file diff --git a/example/conditionals/functions.yaml b/example/conditionals/functions.yaml deleted file mode 100644 index 424e867..0000000 --- a/example/conditionals/functions.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: pkg.crossplane.io/v1beta1 -kind: Function -metadata: - name: function-patch-and-transform - # annotations: - # render.crossplane.io/runtime: Development -spec: - package: xpkg.upbound.io/crossplane-contrib/function-patch-and-transform:v0.2.1 diff --git a/example/conditionals/manifest.yaml b/example/conditionals/manifest.yaml deleted file mode 100644 index 6786637..0000000 --- a/example/conditionals/manifest.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: pkg.crossplane.io/v1beta1 -kind: Function -metadata: - name: function-conditional-patch-and-transform - annotations: - render.crossplane.io/runtime: Development -spec: - package: xpkg.upbound.io/borrelli-org/function-conditional-patch-and-transform:v0.4.0 diff --git a/example/conditionals/provider.yaml b/example/conditionals/provider.yaml deleted file mode 100644 index 1e28f83..0000000 --- a/example/conditionals/provider.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: pkg.crossplane.io/v1 -kind: Provider -metadata: - name: provider-nop -spec: - package: xpkg.upbound.io/crossplane-contrib/provider-nop:v0.2.0 \ No newline at end of file diff --git a/example/conditionals/xr.yaml b/example/conditionals/xr.yaml deleted file mode 100644 index 6ce819f..0000000 --- a/example/conditionals/xr.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: nop.example.org/v1alpha1 -kind: XNopConditional -metadata: - name: test-resource -spec: - env: prod - render: false - deployment: - blue: true - green: false