@@ -385,25 +385,78 @@ optionally to the Claim.
385385| Result.message | String | Human-readable details about the result |
386386| Result.claim | Boolean | Also apply the result to the claim |
387387
388- # # Single use Composites
388+ # # Inlined Composites
389389
390390Tired of creating a CompositeResourceDefinition, a Composition, and a Composite
391- just to run that Composition once in a single use or initialize task?
391+ just to run that Composition once in a setup or initialize task?
392392
393- function-pythonic installs a `Composite` CompositeResourceDefinition that enables
394- creating such tasks using a single Composite resource :
393+ function-pythonic supports "inlined" Compositions, where the python module
394+ from a field in the Composite's spec.
395395` ` ` yaml
396- apiVersion: pythonic.fn.crossplane.io /v1alpha1
397- kind: Composite
396+ apiVersion: inlined.example.org /v1alpha1
397+ kind: Step
398398metadata:
399- name: composite -example
399+ name: inlined -example
400400spec:
401401 composite: |
402402 class HelloComposite(BaseComposite):
403403 def compose(self):
404- self.status.composite = 'Hello, World!'
404+ self.status.step = 'Hello, World!'
405+ ` ` `
406+ The CompositeResourceDefinition and Composition to support the above example :
407+ ` ` ` yaml
408+ apiVersion: apiextensions.crossplane.io/v1
409+ kind: CompositeResourceDefinition
410+ metadata:
411+ name: inlined.example.org/v1alpha1
412+ spec:
413+ group: inlined.example.org
414+ names:
415+ kind: Step
416+ plural: steps
417+ defaultCompositionRef:
418+ name: steps.inlined.example.org
419+ versions:
420+ - name: v1alpha1
421+ served: true
422+ referenceable: true
423+ schema:
424+ openAPIV3Schema:
425+ type: object
426+ properties:
427+ spec:
428+ type: object
429+ properties:
430+ composite:
431+ type: string
432+ description: 'A Python module that defines a class with the signature: class Composite(BaseComposite)'
433+ required:
434+ - composite
435+ status:
436+ type: object
437+ properties:
438+ composite:
439+ x-kubernetes-preserve-unknown-fields: true
440+ ` ` `
441+ ` ` ` yaml
442+ apiVersion: apiextensions.crossplane.io/v1
443+ kind: Composition
444+ metadata:
445+ name: steps.inlined.example.org
446+ spec:
447+ compositeTypeRef:
448+ apiVersion: inlined.example.org/v1alpha1
449+ kind: Step
450+ mode: Pipeline
451+ pipeline:
452+ - step: inlined
453+ functionRef:
454+ name: function-pythonic
455+ input:
456+ apiVersion: pythonic.fn.crossplane.io/v1alpha1
457+ kind: Composite
458+ inlined: composite
405459` ` `
406-
407460# # Quick Start Development
408461
409462function-pythonic includes a pure python implementation of the `crossplane render ...`
0 commit comments