crossplane-function-pythonic 0.5.0__tar.gz → 0.6.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/PKG-INFO +112 -16
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/README.md +110 -14
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/crossplane/pythonic/__about__.py +1 -1
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/crossplane/pythonic/composite.py +152 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/crossplane/pythonic/function.py +19 -4
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/crossplane/pythonic/grpc.py +24 -3
- crossplane_function_pythonic-0.6.0/crossplane/pythonic/packages.py +180 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/crossplane/pythonic/protobuf.py +2 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/crossplane/pythonic/render.py +105 -9
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/aks-cluster/cluster-function-pythonic.yaml +1 -1
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/context/composition.yaml +1 -1
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/context/resources.yaml +1 -1
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/pyproject.toml +7 -7
- crossplane_function_pythonic-0.5.0/crossplane/pythonic/packages.py +0 -148
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/.gitignore +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/LICENSE +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/crossplane/pythonic/__init__.py +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/crossplane/pythonic/__main__.py +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/crossplane/pythonic/auto_ready.py +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/crossplane/pythonic/command.py +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/crossplane/pythonic/main.py +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/crossplane/pythonic/version.py +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/aks-cluster/README.md +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/aks-cluster/aks/kubernetescluster.py +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/aks-cluster/aks/resourcegroup.py +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/aks-cluster/composition.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/aks-cluster/definition.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/aks-cluster/install.sh +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/aks-cluster/kustomization.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/aks-cluster/providers.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/aks-cluster/render.sh +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/aks-cluster/xr.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/connection-details-composition/composition.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/connection-details-composition/definition.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/connection-details-composition/observed.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/connection-details-composition/render.sh +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/connection-details-composition/resources.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/connection-details-composition/xr.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/connections/composition.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/connections/observed.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/connections/render.sh +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/connections/resources.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/connections/xr.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/eks-cluster/composition-v2.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/eks-cluster/composition.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/eks-cluster/definition.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/eks-cluster/render-v2.sh +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/eks-cluster/render.sh +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/eks-cluster/xr.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/filing-system/README.md +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/filing-system/composition.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/filing-system/definition.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/filing-system/kustomization.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/filing-system/runtime.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/filing-system/vcluster.py +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/filing-system/vcluster.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/conditions/composition.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/conditions/render.sh +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/conditions/xr.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/conditions/xrd.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/context/render.sh +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/context/xr.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/context/xrd.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/functions/fromYaml/composition.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/functions/fromYaml/render.sh +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/functions/fromYaml/xr.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/functions/getComposedResource/composition.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/functions/getComposedResource/observed.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/functions/getComposedResource/render.sh +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/functions/getComposedResource/xr.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/functions/getCompositeResource/composition.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/functions/getCompositeResource/render.sh +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/functions/getCompositeResource/xr.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/functions/getCredentialData/composition.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/functions/getCredentialData/render.sh +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/functions/getCredentialData/resources.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/functions/getCredentialData/xr.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/functions/getResourceCondition/composition.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/functions/getResourceCondition/observed.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/functions/getResourceCondition/render.sh +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/functions/getResourceCondition/xr.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/functions/include/composition.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/functions/include/render.sh +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/functions/include/xr.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/functions/toYaml/composition.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/functions/toYaml/render.sh +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/functions/toYaml/xr.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/inline/composition.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/inline/render.sh +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/inline/xr.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/recursive/composition-real.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/recursive/composition.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/recursive/render.sh +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/recursive/xr.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/required-resources/composition.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/required-resources/render.sh +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/required-resources/resources.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-go-templating/required-resources/xr.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-sequencer/composition.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-sequencer/observed.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-sequencer/render.sh +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-sequencer/sequencer.py +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/function-sequencer/xr.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/get-started-app/composition.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/get-started-app/definition.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/get-started-app/observed.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/get-started-app/render.sh +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/get-started-app/xr.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/helm-copy-secret/composition.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/helm-copy-secret/kustomization.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/helm-copy-secret/render.sh +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/helm-copy-secret/vcluster.py +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/helm-copy-secret/xr.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/helm-copy-secret/xrd.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/import-existing-vpc/README.md +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/import-existing-vpc/composition.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/import-existing-vpc/definition.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/import-existing-vpc/observed.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/import-existing-vpc/provider-ec2.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/import-existing-vpc/render.sh +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/import-existing-vpc/xr.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/inlined/composition.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/inlined/definition.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/inlined/render.sh +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/inlined/xr.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/run-all.sh +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/usages-extra/composition.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/usages-extra/observed.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/usages-extra/render.sh +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/usages-extra/resources.yaml +0 -0
- {crossplane_function_pythonic-0.5.0 → crossplane_function_pythonic-0.6.0}/examples/usages-extra/xr.yaml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: crossplane-function-pythonic
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.0
|
|
4
4
|
Summary: A Python centric Crossplane Function
|
|
5
5
|
Project-URL: Documentation, https://github.com/crossplane-contrib/function-pythonic#readme
|
|
6
6
|
Project-URL: Issues, https://github.com/crossplane-contrib/function-pythonic/issues
|
|
@@ -19,7 +19,7 @@ Requires-Dist: inflect==7.5.0
|
|
|
19
19
|
Requires-Dist: kr8s==0.20.15
|
|
20
20
|
Requires-Dist: pyyaml==6.0.3
|
|
21
21
|
Provides-Extra: packages
|
|
22
|
-
Requires-Dist: kopf==1.
|
|
22
|
+
Requires-Dist: kopf==1.44.4; extra == 'packages'
|
|
23
23
|
Provides-Extra: pip-install
|
|
24
24
|
Requires-Dist: pip==26.0.1; extra == 'pip-install'
|
|
25
25
|
Description-Content-Type: text/markdown
|
|
@@ -83,7 +83,7 @@ kind: Function
|
|
|
83
83
|
metadata:
|
|
84
84
|
name: function-pythonic
|
|
85
85
|
spec:
|
|
86
|
-
package: xpkg.
|
|
86
|
+
package: xpkg.crossplane.io/crossplane-contrib/function-pythonic:v0.6.0
|
|
87
87
|
```
|
|
88
88
|
|
|
89
89
|
### Crossplane V1
|
|
@@ -95,7 +95,7 @@ kind: Function
|
|
|
95
95
|
metadata:
|
|
96
96
|
name: function-pythonic
|
|
97
97
|
spec:
|
|
98
|
-
package: xpkg.
|
|
98
|
+
package: xpkg.crossplane.io/crossplane-contrib/function-pythonic:v0.6.0
|
|
99
99
|
runtimeConfigRef:
|
|
100
100
|
name: function-pythonic
|
|
101
101
|
--
|
|
@@ -292,6 +292,7 @@ The BaseComposite class provides the following fields for manipulating the Compo
|
|
|
292
292
|
| self.metadata | Map | The composite observed metadata |
|
|
293
293
|
| self.spec | Map | The composite observed spec |
|
|
294
294
|
| self.status | Map | The composite desired and observed status, read from observed if not in desired |
|
|
295
|
+
| self.output | Map | The step output, only used during Operations |
|
|
295
296
|
| self.conditions | Conditions | The composite desired and observed conditions, read from observed if not in desired |
|
|
296
297
|
| self.results | Results | Returned results applied to the Composite and optionally on the Claim |
|
|
297
298
|
| self.connectionSecret | Map | The name, namespace, and resourceName to use when generating the connection secret in Crossplane v2 |
|
|
@@ -306,17 +307,31 @@ The BaseComposite also provides access to the following Crossplane Function leve
|
|
|
306
307
|
| self.request | Message | Low level direct access to the RunFunctionRequest message |
|
|
307
308
|
| self.response | Message | Low level direct access to the RunFunctionResponse message |
|
|
308
309
|
| self.logger | Logger | Python logger to log messages to the running function stdout |
|
|
310
|
+
| self.capabilities | Capabilities | This Crossplane version's Capabilities |
|
|
309
311
|
| self.parameters | Map | The configured step parameters |
|
|
310
312
|
| self.ttl | Integer | Get or set the response TTL, in seconds |
|
|
311
313
|
| self.credentials | Credentials | The request credentials |
|
|
312
314
|
| self.context | Map | The response context, initialized from the request context |
|
|
313
315
|
| self.environment | Map | The response environment, initialized from the request context environment |
|
|
314
316
|
| self.requireds | Requireds | Request and read additional local Kubernetes resources |
|
|
317
|
+
| self.schemas | Schemas | Request and read CustomResourceDefinition schemas |
|
|
315
318
|
| self.resources | Resources | Define and process composed resources |
|
|
316
319
|
| self.usages| Boolean | Generate Crossplane Usages for resource dependencies, default False |
|
|
317
320
|
| self.autoReady | Boolean | Perform auto ready processing on all composed resources, default True |
|
|
318
321
|
| self.unknownsFatal | Boolean | Terminate the composition if already created resources are assigned unknown values, default False |
|
|
319
322
|
|
|
323
|
+
### Capabiities
|
|
324
|
+
|
|
325
|
+
The Capabilities of the Crossplane version calling function-pythonic.
|
|
326
|
+
|
|
327
|
+
| Field | Type | Description |
|
|
328
|
+
| ----- | ---- | ----------- |
|
|
329
|
+
| bool(Capabilities) | Boolean | Whether or not the Crossplane version supports Capabilities |
|
|
330
|
+
| Capabiities.requireds | Boolean | Functions can return required resources and Crossplane will fetch the required resources |
|
|
331
|
+
| Capabiities.credentials | Boolean | Functions can receive credentials from secrets specified in the Composition |
|
|
332
|
+
| Capabiities.conditions | Boolean | Functions can return status conditions to be applied to the XR and optionally its claim |
|
|
333
|
+
| Capabiities.schemas | Boolean | Functions can request OpenAPI schemas and Crossplane will return them |
|
|
334
|
+
|
|
320
335
|
### Composed Resources
|
|
321
336
|
|
|
322
337
|
Creating and accessing composed resources is performed using the `BaseComposite.resources` field.
|
|
@@ -350,7 +365,7 @@ Resource class:
|
|
|
350
365
|
|
|
351
366
|
Creating and accessing required resources is performed using the `BaseComposite.requireds` field.
|
|
352
367
|
`BaseComposite.requireds` is a dictionary of the required resources whose key is the required
|
|
353
|
-
|
|
368
|
+
schema name. The value returned when getting a required resource from BaseComposite is the
|
|
354
369
|
following RequiredResources class:
|
|
355
370
|
|
|
356
371
|
| Field | Type | Description |
|
|
@@ -363,9 +378,6 @@ following RequiredResources class:
|
|
|
363
378
|
| RequiredResources.matchName | String | The names to match when returning the required resources |
|
|
364
379
|
| RequiredResources.matchLabels | Map | The labels to match when returning the required resources |
|
|
365
380
|
|
|
366
|
-
The current version of crossplane-sdk-python used by function-pythonic does not support namespace
|
|
367
|
-
selection. For now, use matchLabels and filter the results if required.
|
|
368
|
-
|
|
369
381
|
RequiredResources acts like a Python list to provide access to the found required resources.
|
|
370
382
|
Each resource in the list is the following RequiredResource class:
|
|
371
383
|
|
|
@@ -382,6 +394,22 @@ Each resource in the list is the following RequiredResource class:
|
|
|
382
394
|
| RequiredResource.conditions | Map | The required resource conditions |
|
|
383
395
|
| RequiredResource.connection | Map | The required resource connection details |
|
|
384
396
|
|
|
397
|
+
### Required Schemas
|
|
398
|
+
|
|
399
|
+
Creating and accessing required schemas is performed using the `BaseComposite.schemas` field.
|
|
400
|
+
`BaseComposite.schemas` is a dictionary of the required schema whose key is the required
|
|
401
|
+
resource name. The value returned when getting a required resource from BaseComposite is the
|
|
402
|
+
following Schema class:
|
|
403
|
+
|
|
404
|
+
| Field | Type | Description |
|
|
405
|
+
| ----- | ---- | ----------- |
|
|
406
|
+
| Schema(apiVersion,kind) | Schema | Reset the required schema and set the optional parameters |
|
|
407
|
+
| Schema.name | String | The required schema name |
|
|
408
|
+
| Schema.apiVersion | String | The required schema selector apiVersion |
|
|
409
|
+
| Schema.kind | String | The required schema selector kind |
|
|
410
|
+
| Schema.\_\_getitem\_\_ | Map | The required schema openAPIV3Schema |
|
|
411
|
+
| Schema.\_\_getattr\_\_ | Map | The required schema openAPIV3Schema |
|
|
412
|
+
|
|
385
413
|
### Conditions
|
|
386
414
|
|
|
387
415
|
The `BaseComposite.conditions`, `Resource.conditions`, and `RequiredResource.conditions` fields
|
|
@@ -500,7 +528,7 @@ $ function-pythonic render --help
|
|
|
500
528
|
usage: Crossplane Function Pythonic render [-h] [--debug] [--log-name-width WIDTH] [--logger-level LOGGER=LEVEL] [--python-path DIRECTORY]
|
|
501
529
|
[--render-unknowns] [--allow-oversize-protos] [--crossplane-v1] [--kube-context CONTEXT]
|
|
502
530
|
[--context-files KEY=PATH] [--context-values KEY=VALUE] [--observed-resources PATH]
|
|
503
|
-
[--required-resources PATH] [--
|
|
531
|
+
[--required-resources PATH] [--required-schemas PATH] [--include-full-xr] [--include-connection-xr]
|
|
504
532
|
[--include-function-results] [--include-context]
|
|
505
533
|
COMPOSITE [COMPOSITION]
|
|
506
534
|
|
|
@@ -532,8 +560,8 @@ options:
|
|
|
532
560
|
A YAML file or directory of YAML files specifying the observed state of composed resources.
|
|
533
561
|
--required-resources, -e PATH
|
|
534
562
|
A YAML file or directory of YAML files specifying required resources to pass to the Function pipeline.
|
|
535
|
-
--
|
|
536
|
-
A
|
|
563
|
+
--required-schemas, -s PATH
|
|
564
|
+
A JSON file or directory of JSON files specifying required schemas to pass to the Function pipeline.
|
|
537
565
|
--include-full-xr, -x
|
|
538
566
|
Include a direct copy of the input XR's spedc and metadata fields in the rendered output.
|
|
539
567
|
--include-connection-xr
|
|
@@ -602,9 +630,15 @@ status:
|
|
|
602
630
|
Most of the examples contain a `render.sh` command which uses `function-pythonic render` to
|
|
603
631
|
render the example.
|
|
604
632
|
|
|
605
|
-
##
|
|
633
|
+
## Shared Python Packages
|
|
634
|
+
|
|
635
|
+
Python packages and modules can be added to the function-pythonic runtime
|
|
636
|
+
by including the python code in any of the following resources: ConfigMap,
|
|
637
|
+
Secret, EnvironmentConfig, or Composition
|
|
638
|
+
|
|
639
|
+
### ConfigMap Packages
|
|
606
640
|
|
|
607
|
-
ConfigMap based python packages are enable using the `--packages` and
|
|
641
|
+
ConfigMap based python packages are enable using the `--packages-configmaps` and
|
|
608
642
|
`--packages-namespace` command line options. ConfigMaps with the label
|
|
609
643
|
`function-pythonic.package` will be incorporated in the python path at
|
|
610
644
|
the location configured in the label value. For example, the following
|
|
@@ -666,7 +700,7 @@ data:
|
|
|
666
700
|
composite: example.pythonic.features.FeatureOneComposite
|
|
667
701
|
...
|
|
668
702
|
```
|
|
669
|
-
This requires enabling the the packages support using the `--packages` command
|
|
703
|
+
This requires enabling the the packages support using the `--packages-configmaps` command
|
|
670
704
|
line option in the DeploymentRuntimeConfig and configuring the required
|
|
671
705
|
Kubernetes RBAC permissions. For example:
|
|
672
706
|
```yaml
|
|
@@ -675,7 +709,7 @@ kind: Function
|
|
|
675
709
|
metadata:
|
|
676
710
|
name: function-pythonic
|
|
677
711
|
spec:
|
|
678
|
-
package: xpkg.
|
|
712
|
+
package: xpkg.crossplane.io/crossplane-contrib/function-pythonic:v0.6.0
|
|
679
713
|
runtimeConfigRef:
|
|
680
714
|
name: function-pythonic
|
|
681
715
|
---
|
|
@@ -737,9 +771,71 @@ ClusterRole permissions. The `--packages-namespace` command line option will res
|
|
|
737
771
|
to only using the supplied namespace. This option can be invoked multiple times.
|
|
738
772
|
The above RBAC permission can then be per namespace RBAC Role permissions.
|
|
739
773
|
|
|
774
|
+
### Secret Packages
|
|
775
|
+
|
|
740
776
|
Secrets can also be used in an identical manner as ConfigMaps by enabling the
|
|
741
777
|
`--packages-secrets` command line option. Secrets permissions need to be
|
|
742
|
-
added to the above RBAC configuration.
|
|
778
|
+
added to the above RBAC configuration. Secret based python packages also enable
|
|
779
|
+
provisioning files with binary data.
|
|
780
|
+
|
|
781
|
+
### EnvironmentConfig Packages
|
|
782
|
+
|
|
783
|
+
EnvironmentConfig based provisioning enable an entire package and module
|
|
784
|
+
directory structure. Use the `--packages-environmentconfigs` command line option
|
|
785
|
+
and configure the ClusterRole RBAC access.
|
|
786
|
+
```yaml
|
|
787
|
+
apiVersion: apiextensions.crossplane.io/v1beta1
|
|
788
|
+
kind: EnvironmentConfig
|
|
789
|
+
metadata:
|
|
790
|
+
name: test
|
|
791
|
+
labels:
|
|
792
|
+
function-pythonic.package: 'true'
|
|
793
|
+
data:
|
|
794
|
+
arootpackage:
|
|
795
|
+
asubpackage:
|
|
796
|
+
bmodule.py: |
|
|
797
|
+
def hello(where):
|
|
798
|
+
return f"Hello, {where}!"
|
|
799
|
+
amodule.py: |
|
|
800
|
+
def goodby(where):
|
|
801
|
+
return f"Goodby, {where}!"
|
|
802
|
+
```
|
|
803
|
+
### Composition Packages
|
|
804
|
+
|
|
805
|
+
Composition based provisioning works just like EnvironmentConfig where a
|
|
806
|
+
directory structure is created. Use the `--packages-compositions` command line option
|
|
807
|
+
and configure the ClusterRole RBAC access. The main reason to use Composition
|
|
808
|
+
based provision is because Compositions can be included in a Crossplane
|
|
809
|
+
Configuration Package.
|
|
810
|
+
```yaml
|
|
811
|
+
apiVersion: apiextensions.crossplane.io/v1
|
|
812
|
+
kind: Composition
|
|
813
|
+
metadata:
|
|
814
|
+
labels:
|
|
815
|
+
function-pythonic.package: 'true'
|
|
816
|
+
name: test
|
|
817
|
+
spec:
|
|
818
|
+
compositeTypeRef:
|
|
819
|
+
apiVersion: code.pythoni.com/v1alpha1
|
|
820
|
+
kind: Code
|
|
821
|
+
mode: Pipeline
|
|
822
|
+
pipeline:
|
|
823
|
+
- step: render
|
|
824
|
+
functionRef:
|
|
825
|
+
name: function-pythonic
|
|
826
|
+
input:
|
|
827
|
+
apiVersion: pythonic.fn.crossplane.io/v1alpha1
|
|
828
|
+
kind: Composite
|
|
829
|
+
packages:
|
|
830
|
+
arootpackage:
|
|
831
|
+
asubpackage:
|
|
832
|
+
bmodule.py: |
|
|
833
|
+
def hello(where):
|
|
834
|
+
return f"Hello, {where}!"
|
|
835
|
+
amodule.py: |
|
|
836
|
+
def goodby(where):
|
|
837
|
+
return f"Goodby, {where}!"
|
|
838
|
+
```
|
|
743
839
|
|
|
744
840
|
## Step Parameters
|
|
745
841
|
|
|
@@ -57,7 +57,7 @@ kind: Function
|
|
|
57
57
|
metadata:
|
|
58
58
|
name: function-pythonic
|
|
59
59
|
spec:
|
|
60
|
-
package: xpkg.
|
|
60
|
+
package: xpkg.crossplane.io/crossplane-contrib/function-pythonic:v0.6.0
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
### Crossplane V1
|
|
@@ -69,7 +69,7 @@ kind: Function
|
|
|
69
69
|
metadata:
|
|
70
70
|
name: function-pythonic
|
|
71
71
|
spec:
|
|
72
|
-
package: xpkg.
|
|
72
|
+
package: xpkg.crossplane.io/crossplane-contrib/function-pythonic:v0.6.0
|
|
73
73
|
runtimeConfigRef:
|
|
74
74
|
name: function-pythonic
|
|
75
75
|
--
|
|
@@ -266,6 +266,7 @@ The BaseComposite class provides the following fields for manipulating the Compo
|
|
|
266
266
|
| self.metadata | Map | The composite observed metadata |
|
|
267
267
|
| self.spec | Map | The composite observed spec |
|
|
268
268
|
| self.status | Map | The composite desired and observed status, read from observed if not in desired |
|
|
269
|
+
| self.output | Map | The step output, only used during Operations |
|
|
269
270
|
| self.conditions | Conditions | The composite desired and observed conditions, read from observed if not in desired |
|
|
270
271
|
| self.results | Results | Returned results applied to the Composite and optionally on the Claim |
|
|
271
272
|
| self.connectionSecret | Map | The name, namespace, and resourceName to use when generating the connection secret in Crossplane v2 |
|
|
@@ -280,17 +281,31 @@ The BaseComposite also provides access to the following Crossplane Function leve
|
|
|
280
281
|
| self.request | Message | Low level direct access to the RunFunctionRequest message |
|
|
281
282
|
| self.response | Message | Low level direct access to the RunFunctionResponse message |
|
|
282
283
|
| self.logger | Logger | Python logger to log messages to the running function stdout |
|
|
284
|
+
| self.capabilities | Capabilities | This Crossplane version's Capabilities |
|
|
283
285
|
| self.parameters | Map | The configured step parameters |
|
|
284
286
|
| self.ttl | Integer | Get or set the response TTL, in seconds |
|
|
285
287
|
| self.credentials | Credentials | The request credentials |
|
|
286
288
|
| self.context | Map | The response context, initialized from the request context |
|
|
287
289
|
| self.environment | Map | The response environment, initialized from the request context environment |
|
|
288
290
|
| self.requireds | Requireds | Request and read additional local Kubernetes resources |
|
|
291
|
+
| self.schemas | Schemas | Request and read CustomResourceDefinition schemas |
|
|
289
292
|
| self.resources | Resources | Define and process composed resources |
|
|
290
293
|
| self.usages| Boolean | Generate Crossplane Usages for resource dependencies, default False |
|
|
291
294
|
| self.autoReady | Boolean | Perform auto ready processing on all composed resources, default True |
|
|
292
295
|
| self.unknownsFatal | Boolean | Terminate the composition if already created resources are assigned unknown values, default False |
|
|
293
296
|
|
|
297
|
+
### Capabiities
|
|
298
|
+
|
|
299
|
+
The Capabilities of the Crossplane version calling function-pythonic.
|
|
300
|
+
|
|
301
|
+
| Field | Type | Description |
|
|
302
|
+
| ----- | ---- | ----------- |
|
|
303
|
+
| bool(Capabilities) | Boolean | Whether or not the Crossplane version supports Capabilities |
|
|
304
|
+
| Capabiities.requireds | Boolean | Functions can return required resources and Crossplane will fetch the required resources |
|
|
305
|
+
| Capabiities.credentials | Boolean | Functions can receive credentials from secrets specified in the Composition |
|
|
306
|
+
| Capabiities.conditions | Boolean | Functions can return status conditions to be applied to the XR and optionally its claim |
|
|
307
|
+
| Capabiities.schemas | Boolean | Functions can request OpenAPI schemas and Crossplane will return them |
|
|
308
|
+
|
|
294
309
|
### Composed Resources
|
|
295
310
|
|
|
296
311
|
Creating and accessing composed resources is performed using the `BaseComposite.resources` field.
|
|
@@ -324,7 +339,7 @@ Resource class:
|
|
|
324
339
|
|
|
325
340
|
Creating and accessing required resources is performed using the `BaseComposite.requireds` field.
|
|
326
341
|
`BaseComposite.requireds` is a dictionary of the required resources whose key is the required
|
|
327
|
-
|
|
342
|
+
schema name. The value returned when getting a required resource from BaseComposite is the
|
|
328
343
|
following RequiredResources class:
|
|
329
344
|
|
|
330
345
|
| Field | Type | Description |
|
|
@@ -337,9 +352,6 @@ following RequiredResources class:
|
|
|
337
352
|
| RequiredResources.matchName | String | The names to match when returning the required resources |
|
|
338
353
|
| RequiredResources.matchLabels | Map | The labels to match when returning the required resources |
|
|
339
354
|
|
|
340
|
-
The current version of crossplane-sdk-python used by function-pythonic does not support namespace
|
|
341
|
-
selection. For now, use matchLabels and filter the results if required.
|
|
342
|
-
|
|
343
355
|
RequiredResources acts like a Python list to provide access to the found required resources.
|
|
344
356
|
Each resource in the list is the following RequiredResource class:
|
|
345
357
|
|
|
@@ -356,6 +368,22 @@ Each resource in the list is the following RequiredResource class:
|
|
|
356
368
|
| RequiredResource.conditions | Map | The required resource conditions |
|
|
357
369
|
| RequiredResource.connection | Map | The required resource connection details |
|
|
358
370
|
|
|
371
|
+
### Required Schemas
|
|
372
|
+
|
|
373
|
+
Creating and accessing required schemas is performed using the `BaseComposite.schemas` field.
|
|
374
|
+
`BaseComposite.schemas` is a dictionary of the required schema whose key is the required
|
|
375
|
+
resource name. The value returned when getting a required resource from BaseComposite is the
|
|
376
|
+
following Schema class:
|
|
377
|
+
|
|
378
|
+
| Field | Type | Description |
|
|
379
|
+
| ----- | ---- | ----------- |
|
|
380
|
+
| Schema(apiVersion,kind) | Schema | Reset the required schema and set the optional parameters |
|
|
381
|
+
| Schema.name | String | The required schema name |
|
|
382
|
+
| Schema.apiVersion | String | The required schema selector apiVersion |
|
|
383
|
+
| Schema.kind | String | The required schema selector kind |
|
|
384
|
+
| Schema.\_\_getitem\_\_ | Map | The required schema openAPIV3Schema |
|
|
385
|
+
| Schema.\_\_getattr\_\_ | Map | The required schema openAPIV3Schema |
|
|
386
|
+
|
|
359
387
|
### Conditions
|
|
360
388
|
|
|
361
389
|
The `BaseComposite.conditions`, `Resource.conditions`, and `RequiredResource.conditions` fields
|
|
@@ -474,7 +502,7 @@ $ function-pythonic render --help
|
|
|
474
502
|
usage: Crossplane Function Pythonic render [-h] [--debug] [--log-name-width WIDTH] [--logger-level LOGGER=LEVEL] [--python-path DIRECTORY]
|
|
475
503
|
[--render-unknowns] [--allow-oversize-protos] [--crossplane-v1] [--kube-context CONTEXT]
|
|
476
504
|
[--context-files KEY=PATH] [--context-values KEY=VALUE] [--observed-resources PATH]
|
|
477
|
-
[--required-resources PATH] [--
|
|
505
|
+
[--required-resources PATH] [--required-schemas PATH] [--include-full-xr] [--include-connection-xr]
|
|
478
506
|
[--include-function-results] [--include-context]
|
|
479
507
|
COMPOSITE [COMPOSITION]
|
|
480
508
|
|
|
@@ -506,8 +534,8 @@ options:
|
|
|
506
534
|
A YAML file or directory of YAML files specifying the observed state of composed resources.
|
|
507
535
|
--required-resources, -e PATH
|
|
508
536
|
A YAML file or directory of YAML files specifying required resources to pass to the Function pipeline.
|
|
509
|
-
--
|
|
510
|
-
A
|
|
537
|
+
--required-schemas, -s PATH
|
|
538
|
+
A JSON file or directory of JSON files specifying required schemas to pass to the Function pipeline.
|
|
511
539
|
--include-full-xr, -x
|
|
512
540
|
Include a direct copy of the input XR's spedc and metadata fields in the rendered output.
|
|
513
541
|
--include-connection-xr
|
|
@@ -576,9 +604,15 @@ status:
|
|
|
576
604
|
Most of the examples contain a `render.sh` command which uses `function-pythonic render` to
|
|
577
605
|
render the example.
|
|
578
606
|
|
|
579
|
-
##
|
|
607
|
+
## Shared Python Packages
|
|
608
|
+
|
|
609
|
+
Python packages and modules can be added to the function-pythonic runtime
|
|
610
|
+
by including the python code in any of the following resources: ConfigMap,
|
|
611
|
+
Secret, EnvironmentConfig, or Composition
|
|
612
|
+
|
|
613
|
+
### ConfigMap Packages
|
|
580
614
|
|
|
581
|
-
ConfigMap based python packages are enable using the `--packages` and
|
|
615
|
+
ConfigMap based python packages are enable using the `--packages-configmaps` and
|
|
582
616
|
`--packages-namespace` command line options. ConfigMaps with the label
|
|
583
617
|
`function-pythonic.package` will be incorporated in the python path at
|
|
584
618
|
the location configured in the label value. For example, the following
|
|
@@ -640,7 +674,7 @@ data:
|
|
|
640
674
|
composite: example.pythonic.features.FeatureOneComposite
|
|
641
675
|
...
|
|
642
676
|
```
|
|
643
|
-
This requires enabling the the packages support using the `--packages` command
|
|
677
|
+
This requires enabling the the packages support using the `--packages-configmaps` command
|
|
644
678
|
line option in the DeploymentRuntimeConfig and configuring the required
|
|
645
679
|
Kubernetes RBAC permissions. For example:
|
|
646
680
|
```yaml
|
|
@@ -649,7 +683,7 @@ kind: Function
|
|
|
649
683
|
metadata:
|
|
650
684
|
name: function-pythonic
|
|
651
685
|
spec:
|
|
652
|
-
package: xpkg.
|
|
686
|
+
package: xpkg.crossplane.io/crossplane-contrib/function-pythonic:v0.6.0
|
|
653
687
|
runtimeConfigRef:
|
|
654
688
|
name: function-pythonic
|
|
655
689
|
---
|
|
@@ -711,9 +745,71 @@ ClusterRole permissions. The `--packages-namespace` command line option will res
|
|
|
711
745
|
to only using the supplied namespace. This option can be invoked multiple times.
|
|
712
746
|
The above RBAC permission can then be per namespace RBAC Role permissions.
|
|
713
747
|
|
|
748
|
+
### Secret Packages
|
|
749
|
+
|
|
714
750
|
Secrets can also be used in an identical manner as ConfigMaps by enabling the
|
|
715
751
|
`--packages-secrets` command line option. Secrets permissions need to be
|
|
716
|
-
added to the above RBAC configuration.
|
|
752
|
+
added to the above RBAC configuration. Secret based python packages also enable
|
|
753
|
+
provisioning files with binary data.
|
|
754
|
+
|
|
755
|
+
### EnvironmentConfig Packages
|
|
756
|
+
|
|
757
|
+
EnvironmentConfig based provisioning enable an entire package and module
|
|
758
|
+
directory structure. Use the `--packages-environmentconfigs` command line option
|
|
759
|
+
and configure the ClusterRole RBAC access.
|
|
760
|
+
```yaml
|
|
761
|
+
apiVersion: apiextensions.crossplane.io/v1beta1
|
|
762
|
+
kind: EnvironmentConfig
|
|
763
|
+
metadata:
|
|
764
|
+
name: test
|
|
765
|
+
labels:
|
|
766
|
+
function-pythonic.package: 'true'
|
|
767
|
+
data:
|
|
768
|
+
arootpackage:
|
|
769
|
+
asubpackage:
|
|
770
|
+
bmodule.py: |
|
|
771
|
+
def hello(where):
|
|
772
|
+
return f"Hello, {where}!"
|
|
773
|
+
amodule.py: |
|
|
774
|
+
def goodby(where):
|
|
775
|
+
return f"Goodby, {where}!"
|
|
776
|
+
```
|
|
777
|
+
### Composition Packages
|
|
778
|
+
|
|
779
|
+
Composition based provisioning works just like EnvironmentConfig where a
|
|
780
|
+
directory structure is created. Use the `--packages-compositions` command line option
|
|
781
|
+
and configure the ClusterRole RBAC access. The main reason to use Composition
|
|
782
|
+
based provision is because Compositions can be included in a Crossplane
|
|
783
|
+
Configuration Package.
|
|
784
|
+
```yaml
|
|
785
|
+
apiVersion: apiextensions.crossplane.io/v1
|
|
786
|
+
kind: Composition
|
|
787
|
+
metadata:
|
|
788
|
+
labels:
|
|
789
|
+
function-pythonic.package: 'true'
|
|
790
|
+
name: test
|
|
791
|
+
spec:
|
|
792
|
+
compositeTypeRef:
|
|
793
|
+
apiVersion: code.pythoni.com/v1alpha1
|
|
794
|
+
kind: Code
|
|
795
|
+
mode: Pipeline
|
|
796
|
+
pipeline:
|
|
797
|
+
- step: render
|
|
798
|
+
functionRef:
|
|
799
|
+
name: function-pythonic
|
|
800
|
+
input:
|
|
801
|
+
apiVersion: pythonic.fn.crossplane.io/v1alpha1
|
|
802
|
+
kind: Composite
|
|
803
|
+
packages:
|
|
804
|
+
arootpackage:
|
|
805
|
+
asubpackage:
|
|
806
|
+
bmodule.py: |
|
|
807
|
+
def hello(where):
|
|
808
|
+
return f"Hello, {where}!"
|
|
809
|
+
amodule.py: |
|
|
810
|
+
def goodby(where):
|
|
811
|
+
return f"Goodby, {where}!"
|
|
812
|
+
```
|
|
717
813
|
|
|
718
814
|
## Step Parameters
|
|
719
815
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# This is set at build time, using "hatch version"
|
|
2
|
-
__version__ = "0.
|
|
2
|
+
__version__ = "0.6.0"
|
|
@@ -104,11 +104,13 @@ class BaseComposite:
|
|
|
104
104
|
)
|
|
105
105
|
self.response = protobuf.Message(None, 'response', response.DESCRIPTOR, response)
|
|
106
106
|
self.logger = logger
|
|
107
|
+
self.capabilities = Capabilities(self.request.meta.capabilities)
|
|
107
108
|
self.parameters = self.request.input.parameters
|
|
108
109
|
self.credentials = Credentials(self.request)
|
|
109
110
|
self.context = self.response.context
|
|
110
111
|
self.environment = self.context['apiextensions.crossplane.io/environment']
|
|
111
112
|
self.requireds = Requireds(self)
|
|
113
|
+
self.schemas = Schemas(self)
|
|
112
114
|
self.resources = Resources(self)
|
|
113
115
|
self.autoReady = True
|
|
114
116
|
self.usages = False
|
|
@@ -123,6 +125,7 @@ class BaseComposite:
|
|
|
123
125
|
self.metadata = self.observed.metadata
|
|
124
126
|
self.spec = self.observed.spec
|
|
125
127
|
self.status = self.desired.status
|
|
128
|
+
self.output = self.response.output
|
|
126
129
|
self.conditions = Conditions(observed, self.response)
|
|
127
130
|
self.results = Results(self.response)
|
|
128
131
|
self.events = Results(self.response) # Deprecated, use self.results
|
|
@@ -136,6 +139,30 @@ class BaseComposite:
|
|
|
136
139
|
raise NotImplementedError()
|
|
137
140
|
|
|
138
141
|
|
|
142
|
+
class Capabilities:
|
|
143
|
+
def __init__(self, capabilities):
|
|
144
|
+
self._capabilities = capabilities
|
|
145
|
+
|
|
146
|
+
def __bool__(self):
|
|
147
|
+
return fnv1.CAPABILITY_CAPABILITIES in self._capabilities
|
|
148
|
+
|
|
149
|
+
@property
|
|
150
|
+
def requireds(self):
|
|
151
|
+
return fnv1.CAPABILITY_REQUIRED_RESOURCES in self._capabilities if self else None
|
|
152
|
+
|
|
153
|
+
@property
|
|
154
|
+
def credentials(self):
|
|
155
|
+
return fnv1.CAPABILITY_CREDENTIALS in self._capabilities if self else None
|
|
156
|
+
|
|
157
|
+
@property
|
|
158
|
+
def conditions(self):
|
|
159
|
+
return fnv1.CAPABILITY_CONDITIONS in self._capabilities if self else None
|
|
160
|
+
|
|
161
|
+
@property
|
|
162
|
+
def schemas(self):
|
|
163
|
+
return fnv1.CAPABILITY_REQUIRED_SCHEMAS in self._capabilities if self else None
|
|
164
|
+
|
|
165
|
+
|
|
139
166
|
class Credentials:
|
|
140
167
|
def __init__(self, request):
|
|
141
168
|
self.__dict__['_request'] = request
|
|
@@ -558,6 +585,131 @@ class RequiredResource:
|
|
|
558
585
|
return bool(self.observed)
|
|
559
586
|
|
|
560
587
|
|
|
588
|
+
class Schemas:
|
|
589
|
+
def __init__(self, composite):
|
|
590
|
+
self._composite = composite
|
|
591
|
+
self._cache = {}
|
|
592
|
+
|
|
593
|
+
def __getattr__(self, key):
|
|
594
|
+
return self[key]
|
|
595
|
+
|
|
596
|
+
def __getitem__(self, key):
|
|
597
|
+
schema = self._cache.get(key)
|
|
598
|
+
if not schema:
|
|
599
|
+
schema = Schema(self._composite, key)
|
|
600
|
+
self._cache[key] = schema
|
|
601
|
+
return schema
|
|
602
|
+
|
|
603
|
+
def __bool__(self):
|
|
604
|
+
return bool(len(self))
|
|
605
|
+
|
|
606
|
+
def __len__(self):
|
|
607
|
+
names = set()
|
|
608
|
+
for name, schema in self._composite.request.required_schemas:
|
|
609
|
+
names.add(name)
|
|
610
|
+
for name, selector in self._composite.response.requirements.schemas:
|
|
611
|
+
names.add(name)
|
|
612
|
+
return len(names)
|
|
613
|
+
|
|
614
|
+
def __contains__(self, key):
|
|
615
|
+
if key in self._composite.request.required_schemas:
|
|
616
|
+
return True
|
|
617
|
+
if key in self._composite.response.requirements.schemas:
|
|
618
|
+
return True
|
|
619
|
+
return False
|
|
620
|
+
|
|
621
|
+
def __iter__(self):
|
|
622
|
+
names = set()
|
|
623
|
+
for name, schema in self._composite.request.required_schemas:
|
|
624
|
+
names.add(name)
|
|
625
|
+
for name, selector in self._composite.response.requirements.schemas:
|
|
626
|
+
names.add(name)
|
|
627
|
+
for name in sorted(names):
|
|
628
|
+
yield name, self[name]
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
class Schema:
|
|
632
|
+
def __init__(self, composite, name):
|
|
633
|
+
self.name = name
|
|
634
|
+
self._selector = composite.response.requirements.schemas[name]
|
|
635
|
+
self._schema = composite.request.required_schemas[name].openapi_v3
|
|
636
|
+
|
|
637
|
+
def __call__(self, kind=_notset, apiVersion=_notset):
|
|
638
|
+
self._selector()
|
|
639
|
+
if kind != _notset:
|
|
640
|
+
# Allow for apiVersion in the first arg and kind in the second arg
|
|
641
|
+
if '/' in kind or kind == 'v1':
|
|
642
|
+
if apiVersion != _notset:
|
|
643
|
+
self.kind = apiVersion
|
|
644
|
+
apiVersion = kind
|
|
645
|
+
else:
|
|
646
|
+
self.kind = kind
|
|
647
|
+
if apiVersion != _notset:
|
|
648
|
+
self.apiVersion = apiVersion
|
|
649
|
+
return self
|
|
650
|
+
|
|
651
|
+
@property
|
|
652
|
+
def apiVersion(self):
|
|
653
|
+
return self._selector.api_version
|
|
654
|
+
|
|
655
|
+
@apiVersion.setter
|
|
656
|
+
def apiVersion(self, apiVersion):
|
|
657
|
+
self._selector.api_version = apiVersion
|
|
658
|
+
|
|
659
|
+
@property
|
|
660
|
+
def kind(self):
|
|
661
|
+
return self._selector.kind
|
|
662
|
+
|
|
663
|
+
@kind.setter
|
|
664
|
+
def kind(self, kind):
|
|
665
|
+
self._selector.kind = kind
|
|
666
|
+
|
|
667
|
+
def __enter__(self):
|
|
668
|
+
return self
|
|
669
|
+
|
|
670
|
+
def __exit__(self, exc_type, exc_value, traceback):
|
|
671
|
+
pass
|
|
672
|
+
|
|
673
|
+
def __aenter__(self):
|
|
674
|
+
return self
|
|
675
|
+
|
|
676
|
+
def __aexit__(self, exc_type, exc_value, traceback):
|
|
677
|
+
pass
|
|
678
|
+
|
|
679
|
+
def __getattr__(self, key):
|
|
680
|
+
return self[key]
|
|
681
|
+
|
|
682
|
+
def __getitem__(self, key):
|
|
683
|
+
return self._schema[key]
|
|
684
|
+
|
|
685
|
+
def __bool__(self):
|
|
686
|
+
return bool(self._schema)
|
|
687
|
+
|
|
688
|
+
def __len__(self):
|
|
689
|
+
return len(self._schema)
|
|
690
|
+
|
|
691
|
+
def __contains__(self, item):
|
|
692
|
+
return item in self._schema
|
|
693
|
+
|
|
694
|
+
def __iter__(self):
|
|
695
|
+
for key, value in self._schema:
|
|
696
|
+
yield key, value
|
|
697
|
+
|
|
698
|
+
def __hash__(self):
|
|
699
|
+
return hash(self._schema)
|
|
700
|
+
|
|
701
|
+
def __eq__(self, other):
|
|
702
|
+
if instance(other, Schema):
|
|
703
|
+
other = other._schema
|
|
704
|
+
return self._schema == other
|
|
705
|
+
|
|
706
|
+
def __str__(self):
|
|
707
|
+
return str(self._schema)
|
|
708
|
+
|
|
709
|
+
def __format__(self, spec='yaml'):
|
|
710
|
+
return format(self,_schema, spec)
|
|
711
|
+
|
|
712
|
+
|
|
561
713
|
class Conditions:
|
|
562
714
|
def __init__(self, observed, response=None):
|
|
563
715
|
self._observed = observed
|