crossplane-function-pythonic 0.5.0__py3-none-any.whl → 0.6.1__py3-none-any.whl

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: crossplane-function-pythonic
3
- Version: 0.5.0
3
+ Version: 0.6.1
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
@@ -14,14 +14,15 @@ Classifier: Programming Language :: Python :: 3.12
14
14
  Classifier: Programming Language :: Python :: 3.13
15
15
  Classifier: Programming Language :: Python :: 3.14
16
16
  Requires-Python: <3.15,>=3.12
17
- Requires-Dist: crossplane-function-sdk-python==0.11.0
17
+ Requires-Dist: grpcio==1.80.0
18
18
  Requires-Dist: inflect==7.5.0
19
19
  Requires-Dist: kr8s==0.20.15
20
+ Requires-Dist: protobuf==7.35.0
20
21
  Requires-Dist: pyyaml==6.0.3
21
22
  Provides-Extra: packages
22
- Requires-Dist: kopf==1.43.0; extra == 'packages'
23
+ Requires-Dist: kopf==1.44.5; extra == 'packages'
23
24
  Provides-Extra: pip-install
24
- Requires-Dist: pip==26.0.1; extra == 'pip-install'
25
+ Requires-Dist: pip==26.1.1; extra == 'pip-install'
25
26
  Description-Content-Type: text/markdown
26
27
 
27
28
  # function-pythonic
@@ -83,7 +84,7 @@ kind: Function
83
84
  metadata:
84
85
  name: function-pythonic
85
86
  spec:
86
- package: xpkg.upbound.io/crossplane-contrib/function-pythonic:v0.4.2
87
+ package: xpkg.crossplane.io/crossplane-contrib/function-pythonic:v0.6.0
87
88
  ```
88
89
 
89
90
  ### Crossplane V1
@@ -95,7 +96,7 @@ kind: Function
95
96
  metadata:
96
97
  name: function-pythonic
97
98
  spec:
98
- package: xpkg.upbound.io/crossplane-contrib/function-pythonic:v0.4.2
99
+ package: xpkg.crossplane.io/crossplane-contrib/function-pythonic:v0.6.0
99
100
  runtimeConfigRef:
100
101
  name: function-pythonic
101
102
  --
@@ -292,6 +293,7 @@ The BaseComposite class provides the following fields for manipulating the Compo
292
293
  | self.metadata | Map | The composite observed metadata |
293
294
  | self.spec | Map | The composite observed spec |
294
295
  | self.status | Map | The composite desired and observed status, read from observed if not in desired |
296
+ | self.output | Map | The step output, only used during Operations |
295
297
  | self.conditions | Conditions | The composite desired and observed conditions, read from observed if not in desired |
296
298
  | self.results | Results | Returned results applied to the Composite and optionally on the Claim |
297
299
  | self.connectionSecret | Map | The name, namespace, and resourceName to use when generating the connection secret in Crossplane v2 |
@@ -306,17 +308,31 @@ The BaseComposite also provides access to the following Crossplane Function leve
306
308
  | self.request | Message | Low level direct access to the RunFunctionRequest message |
307
309
  | self.response | Message | Low level direct access to the RunFunctionResponse message |
308
310
  | self.logger | Logger | Python logger to log messages to the running function stdout |
311
+ | self.capabilities | Capabilities | This Crossplane version's Capabilities |
309
312
  | self.parameters | Map | The configured step parameters |
310
313
  | self.ttl | Integer | Get or set the response TTL, in seconds |
311
314
  | self.credentials | Credentials | The request credentials |
312
315
  | self.context | Map | The response context, initialized from the request context |
313
316
  | self.environment | Map | The response environment, initialized from the request context environment |
314
317
  | self.requireds | Requireds | Request and read additional local Kubernetes resources |
318
+ | self.schemas | Schemas | Request and read CustomResourceDefinition schemas |
315
319
  | self.resources | Resources | Define and process composed resources |
316
320
  | self.usages| Boolean | Generate Crossplane Usages for resource dependencies, default False |
317
321
  | self.autoReady | Boolean | Perform auto ready processing on all composed resources, default True |
318
322
  | self.unknownsFatal | Boolean | Terminate the composition if already created resources are assigned unknown values, default False |
319
323
 
324
+ ### Capabiities
325
+
326
+ The Capabilities of the Crossplane version calling function-pythonic.
327
+
328
+ | Field | Type | Description |
329
+ | ----- | ---- | ----------- |
330
+ | bool(Capabilities) | Boolean | Whether or not the Crossplane version supports Capabilities |
331
+ | Capabiities.requireds | Boolean | Functions can return required resources and Crossplane will fetch the required resources |
332
+ | Capabiities.credentials | Boolean | Functions can receive credentials from secrets specified in the Composition |
333
+ | Capabiities.conditions | Boolean | Functions can return status conditions to be applied to the XR and optionally its claim |
334
+ | Capabiities.schemas | Boolean | Functions can request OpenAPI schemas and Crossplane will return them |
335
+
320
336
  ### Composed Resources
321
337
 
322
338
  Creating and accessing composed resources is performed using the `BaseComposite.resources` field.
@@ -350,7 +366,7 @@ Resource class:
350
366
 
351
367
  Creating and accessing required resources is performed using the `BaseComposite.requireds` field.
352
368
  `BaseComposite.requireds` is a dictionary of the required resources whose key is the required
353
- resource name. The value returned when getting a required resource from BaseComposite is the
369
+ schema name. The value returned when getting a required resource from BaseComposite is the
354
370
  following RequiredResources class:
355
371
 
356
372
  | Field | Type | Description |
@@ -363,9 +379,6 @@ following RequiredResources class:
363
379
  | RequiredResources.matchName | String | The names to match when returning the required resources |
364
380
  | RequiredResources.matchLabels | Map | The labels to match when returning the required resources |
365
381
 
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
382
  RequiredResources acts like a Python list to provide access to the found required resources.
370
383
  Each resource in the list is the following RequiredResource class:
371
384
 
@@ -382,6 +395,22 @@ Each resource in the list is the following RequiredResource class:
382
395
  | RequiredResource.conditions | Map | The required resource conditions |
383
396
  | RequiredResource.connection | Map | The required resource connection details |
384
397
 
398
+ ### Required Schemas
399
+
400
+ Creating and accessing required schemas is performed using the `BaseComposite.schemas` field.
401
+ `BaseComposite.schemas` is a dictionary of the required schema whose key is the required
402
+ resource name. The value returned when getting a required resource from BaseComposite is the
403
+ following Schema class:
404
+
405
+ | Field | Type | Description |
406
+ | ----- | ---- | ----------- |
407
+ | Schema(apiVersion,kind) | Schema | Reset the required schema and set the optional parameters |
408
+ | Schema.name | String | The required schema name |
409
+ | Schema.apiVersion | String | The required schema selector apiVersion |
410
+ | Schema.kind | String | The required schema selector kind |
411
+ | Schema.\_\_getitem\_\_ | Map | The required schema openAPIV3Schema |
412
+ | Schema.\_\_getattr\_\_ | Map | The required schema openAPIV3Schema |
413
+
385
414
  ### Conditions
386
415
 
387
416
  The `BaseComposite.conditions`, `Resource.conditions`, and `RequiredResource.conditions` fields
@@ -500,7 +529,7 @@ $ function-pythonic render --help
500
529
  usage: Crossplane Function Pythonic render [-h] [--debug] [--log-name-width WIDTH] [--logger-level LOGGER=LEVEL] [--python-path DIRECTORY]
501
530
  [--render-unknowns] [--allow-oversize-protos] [--crossplane-v1] [--kube-context CONTEXT]
502
531
  [--context-files KEY=PATH] [--context-values KEY=VALUE] [--observed-resources PATH]
503
- [--required-resources PATH] [--secret-store PATH] [--include-full-xr] [--include-connection-xr]
532
+ [--required-resources PATH] [--required-schemas PATH] [--include-full-xr] [--include-connection-xr]
504
533
  [--include-function-results] [--include-context]
505
534
  COMPOSITE [COMPOSITION]
506
535
 
@@ -532,8 +561,8 @@ options:
532
561
  A YAML file or directory of YAML files specifying the observed state of composed resources.
533
562
  --required-resources, -e PATH
534
563
  A YAML file or directory of YAML files specifying required resources to pass to the Function pipeline.
535
- --secret-store, -s PATH
536
- A YAML file or directory of YAML files specifying Secrets to use to resolve connections and credentials.
564
+ --required-schemas, -s PATH
565
+ A JSON file or directory of JSON files specifying required schemas to pass to the Function pipeline.
537
566
  --include-full-xr, -x
538
567
  Include a direct copy of the input XR's spedc and metadata fields in the rendered output.
539
568
  --include-connection-xr
@@ -602,9 +631,15 @@ status:
602
631
  Most of the examples contain a `render.sh` command which uses `function-pythonic render` to
603
632
  render the example.
604
633
 
605
- ## ConfigMap Packages
634
+ ## Shared Python Packages
635
+
636
+ Python packages and modules can be added to the function-pythonic runtime
637
+ by including the python code in any of the following resources: ConfigMap,
638
+ Secret, EnvironmentConfig, or Composition
639
+
640
+ ### ConfigMap Packages
606
641
 
607
- ConfigMap based python packages are enable using the `--packages` and
642
+ ConfigMap based python packages are enable using the `--packages-configmaps` and
608
643
  `--packages-namespace` command line options. ConfigMaps with the label
609
644
  `function-pythonic.package` will be incorporated in the python path at
610
645
  the location configured in the label value. For example, the following
@@ -666,7 +701,7 @@ data:
666
701
  composite: example.pythonic.features.FeatureOneComposite
667
702
  ...
668
703
  ```
669
- This requires enabling the the packages support using the `--packages` command
704
+ This requires enabling the the packages support using the `--packages-configmaps` command
670
705
  line option in the DeploymentRuntimeConfig and configuring the required
671
706
  Kubernetes RBAC permissions. For example:
672
707
  ```yaml
@@ -675,7 +710,7 @@ kind: Function
675
710
  metadata:
676
711
  name: function-pythonic
677
712
  spec:
678
- package: xpkg.upbound.io/crossplane-contrib/function-pythonic:v0.4.2
713
+ package: xpkg.crossplane.io/crossplane-contrib/function-pythonic:v0.6.0
679
714
  runtimeConfigRef:
680
715
  name: function-pythonic
681
716
  ---
@@ -737,9 +772,71 @@ ClusterRole permissions. The `--packages-namespace` command line option will res
737
772
  to only using the supplied namespace. This option can be invoked multiple times.
738
773
  The above RBAC permission can then be per namespace RBAC Role permissions.
739
774
 
775
+ ### Secret Packages
776
+
740
777
  Secrets can also be used in an identical manner as ConfigMaps by enabling the
741
778
  `--packages-secrets` command line option. Secrets permissions need to be
742
- added to the above RBAC configuration.
779
+ added to the above RBAC configuration. Secret based python packages also enable
780
+ provisioning files with binary data.
781
+
782
+ ### EnvironmentConfig Packages
783
+
784
+ EnvironmentConfig based provisioning enable an entire package and module
785
+ directory structure. Use the `--packages-environmentconfigs` command line option
786
+ and configure the ClusterRole RBAC access.
787
+ ```yaml
788
+ apiVersion: apiextensions.crossplane.io/v1beta1
789
+ kind: EnvironmentConfig
790
+ metadata:
791
+ name: test
792
+ labels:
793
+ function-pythonic.package: 'true'
794
+ data:
795
+ arootpackage:
796
+ asubpackage:
797
+ bmodule.py: |
798
+ def hello(where):
799
+ return f"Hello, {where}!"
800
+ amodule.py: |
801
+ def goodby(where):
802
+ return f"Goodby, {where}!"
803
+ ```
804
+ ### Composition Packages
805
+
806
+ Composition based provisioning works just like EnvironmentConfig where a
807
+ directory structure is created. Use the `--packages-compositions` command line option
808
+ and configure the ClusterRole RBAC access. The main reason to use Composition
809
+ based provision is because Compositions can be included in a Crossplane
810
+ Configuration Package.
811
+ ```yaml
812
+ apiVersion: apiextensions.crossplane.io/v1
813
+ kind: Composition
814
+ metadata:
815
+ labels:
816
+ function-pythonic.package: 'true'
817
+ name: test
818
+ spec:
819
+ compositeTypeRef:
820
+ apiVersion: code.pythoni.com/v1alpha1
821
+ kind: Code
822
+ mode: Pipeline
823
+ pipeline:
824
+ - step: render
825
+ functionRef:
826
+ name: function-pythonic
827
+ input:
828
+ apiVersion: pythonic.fn.crossplane.io/v1alpha1
829
+ kind: Composite
830
+ packages:
831
+ arootpackage:
832
+ asubpackage:
833
+ bmodule.py: |
834
+ def hello(where):
835
+ return f"Hello, {where}!"
836
+ amodule.py: |
837
+ def goodby(where):
838
+ return f"Goodby, {where}!"
839
+ ```
743
840
 
744
841
  ## Step Parameters
745
842
 
@@ -0,0 +1,22 @@
1
+ crossplane/pythonic/__about__.py,sha256=BmpWZgjXb-VKaTW2Ok13c3aMep0Fd7G8hL8yn1f5Ak0,73
2
+ crossplane/pythonic/__init__.py,sha256=cRk12kc18RLhc9s5dW6sQqZSCEp80fooRO5zxXqc1oA,292
3
+ crossplane/pythonic/__main__.py,sha256=6vYRlYDJtqFgLyiTamnl3htiNOtz8QlDl5WlIP98I8o,31
4
+ crossplane/pythonic/auto_ready.py,sha256=sPetUuJRhwZbg9muaDmbdqmtTIIUDmY4qoadoJA0EtQ,7201
5
+ crossplane/pythonic/command.py,sha256=aT58WBrhU_scaOGeqmsBfofIDnXyW1CQOpCktVGBj5s,4211
6
+ crossplane/pythonic/composite.py,sha256=jEMXPy9PchOLZxWDGq5ni6lq3g9guItU5hMZi98ZO34,34440
7
+ crossplane/pythonic/function.py,sha256=sea1BJ9_lOPlhYyD8tO9PV6ieeRb-iQOeez07pG2vZk,18535
8
+ crossplane/pythonic/grpc.py,sha256=F3BrfjISGRS2TKeoxUjWeA1LopBaFlZ6nCq_Hei4Di8,5681
9
+ crossplane/pythonic/main.py,sha256=ujUa_FYElQSGqnhZ-0NJrD3kSyYjfRbIp79FV2Yl7hs,599
10
+ crossplane/pythonic/packages.py,sha256=cOlF-wo2CzknwFPAfuwgCiwdT5vDE4n7oBMfQErVzbA,7023
11
+ crossplane/pythonic/protobuf.py,sha256=1Yj8Cgku0w0UYU3dOh6QIaE8HFtkdkhL9b5UERzwAQ0,53978
12
+ crossplane/pythonic/render.py,sha256=lz65rwcg3EvzdWMTUMMA6PvSHqMVTTkrEK11lLe-0XY,33804
13
+ crossplane/pythonic/version.py,sha256=-RiB0p146ayqJj0SXfYxTNv49u9Fx9pPgm59Ji2blhc,214
14
+ crossplane/pythonic/proto/v1/run_function.proto,sha256=GbJ0wVUEjfpMsn2DsnhiPvtmL09z3oyMbWwf6viQtiw,16676
15
+ crossplane/pythonic/proto/v1/run_function_pb2.py,sha256=adoDilRP8JNSsNWtvLQv8egrlnmpnZk8qbo3REMR8EY,14440
16
+ crossplane/pythonic/proto/v1/run_function_pb2.pyi,sha256=MvjcY39d1xJ4ZZmRibhehCKF1mHVGb6qfpoCQO8XYqE,14374
17
+ crossplane/pythonic/proto/v1/run_function_pb2_grpc.py,sha256=mwfE6i_TQHEfh-KemCT10fKA6jlyZ1A0Ih1z6nELkXk,3968
18
+ crossplane_function_pythonic-0.6.1.dist-info/METADATA,sha256=4RBD7g6NimpRSnPQ_qj54B7-k4uk8iSH5Xc7EzHOFfQ,36686
19
+ crossplane_function_pythonic-0.6.1.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
20
+ crossplane_function_pythonic-0.6.1.dist-info/entry_points.txt,sha256=jJ4baywFDviB9WyAhyhNYF2VOCb6XtbRSjKf7bnBwhg,68
21
+ crossplane_function_pythonic-0.6.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
22
+ crossplane_function_pythonic-0.6.1.dist-info/RECORD,,
@@ -1,18 +0,0 @@
1
- crossplane/pythonic/__about__.py,sha256=S3lIpABQ5LwPMuO5TLfDrT_eJOQtFzsph4TXcfnx4OY,73
2
- crossplane/pythonic/__init__.py,sha256=cRk12kc18RLhc9s5dW6sQqZSCEp80fooRO5zxXqc1oA,292
3
- crossplane/pythonic/__main__.py,sha256=6vYRlYDJtqFgLyiTamnl3htiNOtz8QlDl5WlIP98I8o,31
4
- crossplane/pythonic/auto_ready.py,sha256=sPetUuJRhwZbg9muaDmbdqmtTIIUDmY4qoadoJA0EtQ,7201
5
- crossplane/pythonic/command.py,sha256=aT58WBrhU_scaOGeqmsBfofIDnXyW1CQOpCktVGBj5s,4211
6
- crossplane/pythonic/composite.py,sha256=niq-JSVZ8NB53Q7khkMqH9vQTJPb6yB-13O-wa2Is1U,30311
7
- crossplane/pythonic/function.py,sha256=CL2j_Br0eYWbn_8r8md9O9ErfHizz78H1KR8l2oV1IA,17964
8
- crossplane/pythonic/grpc.py,sha256=9ZQceboDju37NB6AhcUSWpBx_hZQ5W7uo7CZF6ynhfI,4451
9
- crossplane/pythonic/main.py,sha256=ujUa_FYElQSGqnhZ-0NJrD3kSyYjfRbIp79FV2Yl7hs,599
10
- crossplane/pythonic/packages.py,sha256=4TxyT6V79R0m4tJbC8R1gwU_vgHGLXKSBzeTTKd8xGo,5120
11
- crossplane/pythonic/protobuf.py,sha256=nmVf-Xn_-ER8BEfEbqd8uQo2gdhmNYyQh9QlhcaYebs,53083
12
- crossplane/pythonic/render.py,sha256=Y1-fdjQxvPBSkGjfJnNwCOOg6I-bX7Ys9X4jXkqIZp4,30140
13
- crossplane/pythonic/version.py,sha256=-RiB0p146ayqJj0SXfYxTNv49u9Fx9pPgm59Ji2blhc,214
14
- crossplane_function_pythonic-0.5.0.dist-info/METADATA,sha256=yMVu_bg-pjIrhuHDjeTAmKEa082V2pq5NroKIeo9poI,33133
15
- crossplane_function_pythonic-0.5.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
16
- crossplane_function_pythonic-0.5.0.dist-info/entry_points.txt,sha256=jJ4baywFDviB9WyAhyhNYF2VOCb6XtbRSjKf7bnBwhg,68
17
- crossplane_function_pythonic-0.5.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
18
- crossplane_function_pythonic-0.5.0.dist-info/RECORD,,