2525 functionRef :
2626 name : function-pythonic
2727 input :
28- apiVersion : pythonic.fn.fortra.com /v1alpha1
28+ apiVersion : pythonic.fn.crossplane.io /v1alpha1
2929 kind : Composite
3030 composite : |
3131 class VpcComposite(BaseComposite):
@@ -57,7 +57,7 @@ kind: Function
5757metadata :
5858 name : function-pythonic
5959spec :
60- package : xpkg.upbound.io/crossplane-contrib/function-pythonic:v0.1.5
60+ package : xpkg.upbound.io/crossplane-contrib/function-pythonic:v0.2.0
6161` ` `
6262## Composed Resource Dependencies
6363
@@ -203,7 +203,7 @@ The BaseComposite class provides the following fields for manipulating the Compo
203203| self.spec | Map | The composite observed spec |
204204| self.status | Map | The composite desired and observed status, read from observed if not in desired |
205205| self.conditions | Conditions | The composite desired and observed conditions, read from observed if not in desired |
206- | self.events | Events | Returned events against the Composite and optionally on the Claim |
206+ | self.results | Results | Returned results applied to the Composite and optionally on the Claim |
207207| self.connection | Connection | The composite desired and observed connection detials, read from observed if not in desired |
208208| self.ready | Boolean | The composite desired ready state |
209209
@@ -302,19 +302,19 @@ The fields are read only for `Resource.conditions` and `RequiredResource.conditi
302302| Condition.lastTransitionTime | Timestamp | Last transition time, read only |
303303| Condition.claim | Boolean | Also apply the condition the claim |
304304
305- # ## Events
305+ # ## Results
306306
307- The `BaseComposite.events ` field is a list of events to apply to the Composite and
307+ The `BaseComposite.results ` field is a list of results to apply to the Composite and
308308optionally to the Claim.
309309
310310| Field | Type | Description |
311311| ----- | ---- | ----------- |
312- | Event .info | Boolean | Normal informational event |
313- | Event .warning | Boolean | Warning level event |
314- | Event .fatal | Boolean | Fatal events also terminate composing the Composite |
315- | Event .reason | String | PascalCase, machine-readable reason for this event |
316- | Event .message | String | Human-readable details about the event |
317- | Event .claim | Boolean | Also apply the event to the claim |
312+ | Result .info | Boolean | Normal informational result |
313+ | Result .warning | Boolean | Warning level result |
314+ | Result .fatal | Boolean | Fatal results also terminate composing the Composite |
315+ | Result .reason | String | PascalCase, machine-readable reason for this result |
316+ | Result .message | String | Human-readable details about the result |
317+ | Result .claim | Boolean | Also apply the result to the claim |
318318
319319# # Single use Composites
320320
@@ -324,7 +324,7 @@ just to run that Composition once in a single use or initialize task?
324324function-pythonic installs a `Composite` CompositeResourceDefinition that enables
325325creating such tasks using a single Composite resource :
326326` ` ` yaml
327- apiVersion: pythonic.fortra.com /v1alpha1
327+ apiVersion: pythonic.fn.crossplane.io /v1alpha1
328328kind: Composite
329329metadata:
330330 name: composite-example
@@ -337,16 +337,62 @@ spec:
337337
338338# # Quick Start Development
339339
340- The following example demonstrates how to locally render function-python
341- compositions. First, install the `crossplane-function-pythonic` python
342- package into the python environment :
340+ function-pythonic includes a pure python implementation of the `crossplane render ...`
341+ command, which can be used to render Compositions that only use function-pythonic. This
342+ makes it very easy to test and debug using your IDE of choice. It is also blindingly
343+ fast compared to `crossplane render`. To use, install the `crossplane-function-pythonic`
344+ python package into the python environment.
343345` ` ` shell
344346$ pip install crossplane-function-pythonic
345347` ` `
346- Next, create the following files :
348+ Then to render function-pythonic Compositions, use the `function-pythonic render ...`
349+ command.
350+ ` ` ` shell
351+ $ function-pythonic render --help
352+ usage: Crossplane Function Pythonic render [-h] [--debug] [--log-name-width WIDTH] [--python-path DIRECTORY] [--render-unknowns]
353+ [--allow-oversize-protos] [--context-files KEY=PATH] [--context-values KEY=VALUE]
354+ [--observed-resources PATH] [--extra-resources PATH] [--required-resources PATH]
355+ [--function-credentials PATH] [--include-full-xr] [--include-function-results] [--include-context]
356+ PATH [PATH/CLASS]
357+
358+ positional arguments:
359+ PATH A YAML file containing the Composite resource to render.
360+ PATH/CLASS A YAML file containing the Composition resource or the complete path of a function=-pythonic BaseComposite subclass.
361+
362+ options:
363+ -h, --help show this help message and exit
364+ --debug, -d Emit debug logs.
365+ --log-name-width WIDTH
366+ Width of the logger name in the log output, default 40.
367+ --python-path DIRECTORY
368+ Filing system directories to add to the python path.
369+ --render-unknowns, -u
370+ Render resources with unknowns, useful during local development.
371+ --allow-oversize-protos
372+ Allow oversized protobuf messages
373+ --context-files KEY=PATH
374+ Context key-value pairs to pass to the Function pipeline. Values must be files containing YAML/JSON.
375+ --context-values KEY=VALUE
376+ Context key-value pairs to pass to the Function pipeline. Values must be YAML/JSON. Keys take precedence over --context-files.
377+ --observed-resources, -o PATH
378+ A YAML file or directory of YAML files specifying the observed state of composed resources.
379+ --extra-resources PATH
380+ A YAML file or directory of YAML files specifying required resources (deprecated, use --required-resources).
381+ --required-resources, -e PATH
382+ A YAML file or directory of YAML files specifying required resources to pass to the Function pipeline.
383+ --function-credentials PATH
384+ A YAML file or directory of YAML files specifying credentials to use for Functions to render the XR.
385+ --include-full-xr, -x
386+ Include a direct copy of the input XR's spedc and metadata fields in the rendered output.
387+ --include-function-results, -r
388+ Include informational and warning messages from Functions in the rendered output as resources of kind: Result..
389+ --include-context, -c
390+ Include the context in the rendered output as a resource of kind: Context.
391+ ` ` `
392+ The following example demonstrates how to locally render function-python compositions. First, create the following files :
347393# ### xr.yaml
348394` ` ` yaml
349- apiVersion: pythonic.fortra.com /v1alpha1
395+ apiVersion: pythonic.fn.crossplane.io /v1alpha1
350396kind: Hello
351397metadata:
352398 name: world
@@ -358,61 +404,49 @@ spec:
358404apiVersion: apiextensions.crossplane.io/v1
359405kind: Composition
360406metadata:
361- name: hellos.pythonic.fortra.com
407+ name: hellos.pythonic.crossplane.io
362408spec:
363409 compositeTypeRef:
364- apiVersion: pythonic.fortra.com /v1alpha1
410+ apiVersion: pythonic.crossplane.io /v1alpha1
365411 kind: Hello
366412 mode: Pipeline
367413 pipeline:
368414 - step: pythonic
369415 functionRef:
370416 name: function-pythonic
371417 input:
372- apiVersion: pythonic.fn.fortra.com /v1alpha1
418+ apiVersion: pythonic.fn.crossplane.io /v1alpha1
373419 kind: Composite
374420 composite: |
375421 class GreetingComposite(BaseComposite):
376422 def compose(self):
377423 self.status.greeting = f"Hello, {self.spec.who}!"
378424` ` `
379- # ### functions.yaml
380- ` ` ` yaml
381- apiVersion: pkg.crossplane.io/v1
382- kind: Function
383- metadata:
384- name: function-pythonic
385- annotations:
386- render.crossplane.io/runtime: Development
387- spec:
388- package: xpkg.upbound.io/crossplane-contrib/function-pythonic:v0.1.5
389- ` ` `
390- In one terminal session, run function-pythonic :
391- ` ` ` shell
392- $ function-pythonic --insecure --debug --render-unknowns
393- [2025-08-21 15:32:37.966] grpc._cython.cygrpc [DEBUG ] Using AsyncIOEngine.POLLER as I/O engine
394- ` ` `
395- In another terminal session, render the Composite :
425+ Then, to render the above composite and composition, run :
396426` ` ` shell
397- $ crossplane render xr.yaml composition.yaml functions.yaml
427+ $ function-pythonic render --debug --render-unknowns xr.yaml composition.yaml
428+ [2025-12-29 09:44:57.949] io.crossplane.fn.pythonic.Hello.world [DEBUG ] Starting compose, 1st step, 1st pass
429+ [2025-12-29 09:44:57.949] io.crossplane.fn.pythonic.Hello.world [INFO ] Completed compose
398430---
399- apiVersion: pythonic.fortra.com /v1alpha1
431+ apiVersion: pythonic.fn.crossplane.io /v1alpha1
400432kind: Hello
401433metadata:
402434 name: world
403435status:
404436 conditions:
405- - lastTransitionTime: "2024 -01-01T00:00:00Z"
437+ - lastTransitionTime: '2026 -01-01T00:00:00Z'
406438 reason: Available
407- status: " True"
439+ status: ' True'
408440 type: Ready
409- - lastTransitionTime: "2024 -01-01T00:00:00Z"
441+ - lastTransitionTime: '2026 -01-01T00:00:00Z'
410442 message: All resources are composed
411443 reason: AllComposed
412- status: " True"
444+ status: ' True'
413445 type: ResourcesComposed
414446 greeting: Hello, World!
415447` ` `
448+ Most of the examples contain a `render.sh` command which uses `function-pythonic render` to
449+ render the example.
416450
417451# # ConfigMap Packages
418452
@@ -441,7 +475,7 @@ Then, in your Composition:
441475 functionRef:
442476 name: function-pythonic
443477 input:
444- apiVersion: pythonic.fn.fortra.com /v1alpha1
478+ apiVersion: pythonic.fn.crossplane.io /v1alpha1
445479 kind: Composite
446480 composite: |
447481 from example.pythonic import features
@@ -473,7 +507,7 @@ data:
473507 functionRef:
474508 name: function-pythonic
475509 input:
476- apiVersion: pythonic.fn.fortra.com /v1alpha1
510+ apiVersion: pythonic.fn.crossplane.io /v1alpha1
477511 kind: Composite
478512 composite: example.pythonic.features.FeatureOneComposite
479513 ...
@@ -487,7 +521,7 @@ kind: Function
487521metadata:
488522 name: function-pythonic
489523spec:
490- package: xpkg.upbound.io/crossplane-contrib/function-pythonic:v0.1.5
524+ package: xpkg.upbound.io/crossplane-contrib/function-pythonic:v0.2.0
491525 runtimeConfigRef:
492526 name: function-pythonic
493527---
@@ -580,7 +614,7 @@ data:
580614 functionRef:
581615 name: function-pythonic
582616 input:
583- apiVersion: pythonic.fn.fortra.com /v1alpha1
617+ apiVersion: pythonic.fn.crossplane.io /v1alpha1
584618 kind: Composite
585619 parameters:
586620 who: World
0 commit comments