crossplane-function-pythonic 0.0.7.post3__py3-none-any.whl → 0.0.8__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.
- crossplane/pythonic/main.py +11 -10
- crossplane/pythonic/packages.py +4 -5
- {crossplane_function_pythonic-0.0.7.post3.dist-info → crossplane_function_pythonic-0.0.8.dist-info}/METADATA +39 -27
- crossplane_function_pythonic-0.0.8.dist-info/RECORD +11 -0
- crossplane_function_pythonic-0.0.7.post3.dist-info/RECORD +0 -11
- {crossplane_function_pythonic-0.0.7.post3.dist-info → crossplane_function_pythonic-0.0.8.dist-info}/WHEEL +0 -0
- {crossplane_function_pythonic-0.0.7.post3.dist-info → crossplane_function_pythonic-0.0.8.dist-info}/entry_points.txt +0 -0
- {crossplane_function_pythonic-0.0.7.post3.dist-info → crossplane_function_pythonic-0.0.8.dist-info}/licenses/LICENSE +0 -0
crossplane/pythonic/main.py
CHANGED
@@ -19,11 +19,7 @@ from . import function
|
|
19
19
|
|
20
20
|
|
21
21
|
def main():
|
22
|
-
|
23
|
-
asyncio.run(Main().main())
|
24
|
-
except:
|
25
|
-
traceback.print_exc()
|
26
|
-
sys.exit(1)
|
22
|
+
asyncio.run(Main().main())
|
27
23
|
|
28
24
|
|
29
25
|
class Main:
|
@@ -38,6 +34,7 @@ class Main:
|
|
38
34
|
'--log-name-width',
|
39
35
|
type=int,
|
40
36
|
default=40,
|
37
|
+
metavar='WIDTH',
|
41
38
|
help='Width of the logger name in the log output, default 40',
|
42
39
|
)
|
43
40
|
parser.add_argument(
|
@@ -48,6 +45,7 @@ class Main:
|
|
48
45
|
parser.add_argument(
|
49
46
|
'--tls-certs-dir',
|
50
47
|
default=os.getenv('TLS_SERVER_CERTS_DIR'),
|
48
|
+
metavar='DIRECTORY',
|
51
49
|
help='Serve using mTLS certificates.',
|
52
50
|
)
|
53
51
|
parser.add_argument(
|
@@ -69,21 +67,25 @@ class Main:
|
|
69
67
|
'--packages-namespace',
|
70
68
|
action='append',
|
71
69
|
default=[],
|
72
|
-
|
70
|
+
metavar='NAMESPACE',
|
71
|
+
help='Namespaces to discover function-pythonic ConfigMaps in, default is cluster wide.',
|
73
72
|
)
|
74
73
|
parser.add_argument(
|
75
74
|
'--packages-dir',
|
76
75
|
default='./pythonic-packages',
|
77
|
-
|
76
|
+
metavar='DIRECTORY',
|
77
|
+
help='Directory to store discovered function-pythonic ConfigMaps to, defaults "<cwd>/pythonic-packages"'
|
78
78
|
)
|
79
79
|
parser.add_argument(
|
80
80
|
'--pip-install',
|
81
|
+
metavar='COMMAND',
|
81
82
|
help='Pip install command to install additional Python packages.'
|
82
83
|
)
|
83
84
|
parser.add_argument(
|
84
85
|
'--python-path',
|
85
86
|
action='append',
|
86
87
|
default=[],
|
88
|
+
metavar='DIRECTORY',
|
87
89
|
help='Filing system directories to add to the python path',
|
88
90
|
)
|
89
91
|
parser.add_argument(
|
@@ -92,7 +94,6 @@ class Main:
|
|
92
94
|
help='Allow oversized protobuf messages'
|
93
95
|
)
|
94
96
|
args = parser.parse_args()
|
95
|
-
|
96
97
|
self.configure_logging(args)
|
97
98
|
|
98
99
|
if args.pip_install:
|
@@ -136,11 +137,11 @@ class Main:
|
|
136
137
|
async with asyncio.TaskGroup() as tasks:
|
137
138
|
tasks.create_task(grpc_server.wait_for_termination())
|
138
139
|
tasks.create_task(packages.operator(
|
140
|
+
grpc_server,
|
141
|
+
grpc_runner,
|
139
142
|
args.packages_secrets,
|
140
143
|
args.packages_namespace,
|
141
144
|
args.packages_dir,
|
142
|
-
grpc_server,
|
143
|
-
grpc_runner,
|
144
145
|
))
|
145
146
|
else:
|
146
147
|
def stop():
|
crossplane/pythonic/packages.py
CHANGED
@@ -8,16 +8,15 @@ import sys
|
|
8
8
|
import kopf
|
9
9
|
|
10
10
|
|
11
|
-
PACKAGE_LABEL = {'function-pythonic.package': kopf.PRESENT}
|
12
|
-
PACKAGES_DIR = None
|
13
11
|
GRPC_SERVER = None
|
14
12
|
GRPC_RUNNER = None
|
13
|
+
PACKAGE_LABEL = {'function-pythonic.package': kopf.PRESENT}
|
14
|
+
PACKAGES_DIR = None
|
15
15
|
|
16
16
|
|
17
|
-
def operator(
|
17
|
+
def operator(grpc_server, grpc_runner, packages_secrets, packages_namespace, packages_dir):
|
18
18
|
logging.getLogger('kopf.objects').setLevel(logging.INFO)
|
19
|
-
global
|
20
|
-
PACKAGES_DIR = packages_dir
|
19
|
+
global GRPC_SERVER, GRPC_RUNNER, PACKAGES_DIR
|
21
20
|
GRPC_SERVER = grpc_server
|
22
21
|
GRPC_RUNNER = grpc_runner
|
23
22
|
PACKAGES_DIR = pathlib.Path(packages_dir).expanduser().resolve()
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: crossplane-function-pythonic
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.8
|
4
4
|
Summary: A Python centric Crossplane Function
|
5
5
|
Project-URL: Documentation, https://github.com/fortra/function-pythonic#readme
|
6
6
|
Project-URL: Issues, https://github.com/fortra/function-pythonic/issues
|
@@ -273,34 +273,46 @@ selection. For now, use matchLabels and filter the results if required.
|
|
273
273
|
RequiredResources acts like a Python list to provide access to the found required resources.
|
274
274
|
Each resource in the list is the following RequiredResource class:
|
275
275
|
|
276
|
-
| Field | Description |
|
277
|
-
| ----- | ----------- |
|
278
|
-
| RequiredResource.name | The required resource name |
|
279
|
-
| RequiredResource.observed | Low level direct access to the observed required resource |
|
280
|
-
| RequiredResource.apiVersion | The required resource apiVersion |
|
281
|
-
| RequiredResource.kind | The required resource kind |
|
282
|
-
| RequiredResource.metadata | The required resource metadata |
|
283
|
-
| RequiredResource.spec | The required resource spec |
|
284
|
-
| RequiredResource.data | The required resource data |
|
285
|
-
| RequiredResource.status | The required resource status |
|
286
|
-
| RequiredResource.conditions | The required resource conditions |
|
276
|
+
| Field | Type | Description |
|
277
|
+
| ----- | ---- | ----------- |
|
278
|
+
| RequiredResource.name | String | The required resource name |
|
279
|
+
| RequiredResource.observed | Map | Low level direct access to the observed required resource |
|
280
|
+
| RequiredResource.apiVersion | String | The required resource apiVersion |
|
281
|
+
| RequiredResource.kind | String | The required resource kind |
|
282
|
+
| RequiredResource.metadata | Map | The required resource metadata |
|
283
|
+
| RequiredResource.spec | Map | The required resource spec |
|
284
|
+
| RequiredResource.data | Map | The required resource data |
|
285
|
+
| RequiredResource.status | Map | The required resource status |
|
286
|
+
| RequiredResource.conditions | Map | The required resource conditions |
|
287
287
|
|
288
288
|
### Conditions
|
289
289
|
|
290
|
-
The `conditions`
|
291
|
-
the map key being the condition type.
|
290
|
+
The `BaseCompsite.conditions`, `Resource.conditions`, and `RequiredResource.conditions` fields
|
291
|
+
are maps of that entity's status conditions array, with the map key being the condition type.
|
292
|
+
The fields are read only for `Resource.conditions` and `RequiredResource.conditions`.
|
292
293
|
|
293
|
-
| Field | Description |
|
294
|
-
| ----- | ----------- |
|
295
|
-
| Condition.type | The condtion type |
|
296
|
-
| Condition.status |
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
302
|
-
|
303
|
-
|
294
|
+
| Field | Type | Description |
|
295
|
+
| ----- | ---- | ----------- |
|
296
|
+
| Condition.type | String | The condtion type, or name |
|
297
|
+
| Condition.status | Boolean | The condition status |
|
298
|
+
| Condition.reason | String | PascalCase, machine-readable reason for this condition |
|
299
|
+
| Condition.message | String | Human-readable details about the condition |
|
300
|
+
| Condition.lastTransitionTime | Timestamp | Last transition time, read only |
|
301
|
+
| Condition.claim | Boolean | Also apply the condition the claim |
|
302
|
+
|
303
|
+
### Events
|
304
|
+
|
305
|
+
The `BaseComposite.events` field is a list of events to apply to the Composite and
|
306
|
+
optionally to the Claim.
|
307
|
+
|
308
|
+
| Field | Type | Description |
|
309
|
+
| ----- | ---- | ----------- |
|
310
|
+
| Event.info | Boolean | Normal informational event |
|
311
|
+
| Event.warning | Boolean | Warning level event |
|
312
|
+
| Event.fatal | Boolean | Fatal events also terminate composing the Composite |
|
313
|
+
| Event.reason | String | PascalCase, machine-readable reason for this event |
|
314
|
+
| Event.message | String | Human-readable details about the event |
|
315
|
+
| Event.claim | Boolean | Also apply the event to the claim |
|
304
316
|
|
305
317
|
## Single use Composites
|
306
318
|
|
@@ -329,7 +341,7 @@ package into the python environment:
|
|
329
341
|
```shell
|
330
342
|
$ pip install crossplane-function-pythonic
|
331
343
|
```
|
332
|
-
|
344
|
+
Next, create the following files:
|
333
345
|
#### xr.yaml
|
334
346
|
```yaml
|
335
347
|
apiVersion: pythonic.fortra.com/v1alpha1
|
@@ -378,7 +390,7 @@ In one terminal session, run function-pythonic:
|
|
378
390
|
$ function-pythonic --insecure --debug
|
379
391
|
[2025-08-21 15:32:37.966] grpc._cython.cygrpc [DEBUG ] Using AsyncIOEngine.POLLER as I/O engine
|
380
392
|
```
|
381
|
-
In
|
393
|
+
In another terminal session, render the Composite:
|
382
394
|
```shell
|
383
395
|
$ crossplane render xr.yaml composition.yaml functions.yaml
|
384
396
|
---
|
@@ -0,0 +1,11 @@
|
|
1
|
+
crossplane/pythonic/__init__.py,sha256=9Oz3mvFO-8GXb75iEfybSHgVr3p8INdqA201tCusuSo,408
|
2
|
+
crossplane/pythonic/composite.py,sha256=CK_3ejKZ29zWnAZ94r5ycNduf_cmDeH8-AL5QcJL1Mo,19937
|
3
|
+
crossplane/pythonic/function.py,sha256=4kfyR0U6UaAQAhVbFrhFPwOOsHjeNEktuTuswLrm0G4,10535
|
4
|
+
crossplane/pythonic/main.py,sha256=W6SG6o6vYCl75tdvWnTmPyYhcs6FeI5YaniCOK1s4TE,6491
|
5
|
+
crossplane/pythonic/packages.py,sha256=LVC-MUlptLjnMPdxcFu7LrcyJgLuHU8IIag2YLQfzSs,6105
|
6
|
+
crossplane/pythonic/protobuf.py,sha256=9wvKMXavrHxD1n1TufFQs_6If9m4gRZA36p_pmrlU7I,34633
|
7
|
+
crossplane_function_pythonic-0.0.8.dist-info/METADATA,sha256=iXgH80gmev0loJC3jMCous6Cav5fLhS9Yh3QBJMfBkw,23291
|
8
|
+
crossplane_function_pythonic-0.0.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
9
|
+
crossplane_function_pythonic-0.0.8.dist-info/entry_points.txt,sha256=jJ4baywFDviB9WyAhyhNYF2VOCb6XtbRSjKf7bnBwhg,68
|
10
|
+
crossplane_function_pythonic-0.0.8.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
11
|
+
crossplane_function_pythonic-0.0.8.dist-info/RECORD,,
|
@@ -1,11 +0,0 @@
|
|
1
|
-
crossplane/pythonic/__init__.py,sha256=9Oz3mvFO-8GXb75iEfybSHgVr3p8INdqA201tCusuSo,408
|
2
|
-
crossplane/pythonic/composite.py,sha256=CK_3ejKZ29zWnAZ94r5ycNduf_cmDeH8-AL5QcJL1Mo,19937
|
3
|
-
crossplane/pythonic/function.py,sha256=4kfyR0U6UaAQAhVbFrhFPwOOsHjeNEktuTuswLrm0G4,10535
|
4
|
-
crossplane/pythonic/main.py,sha256=8nbPyTzRg2-Vrjp0MKxdp6Fc5uiFjLfIHXVmbG_dGIw,6399
|
5
|
-
crossplane/pythonic/packages.py,sha256=5GyUmd6BnDyDnT9Y0-yCW6z8ncuqas28N5slRhJYYpA,6137
|
6
|
-
crossplane/pythonic/protobuf.py,sha256=9wvKMXavrHxD1n1TufFQs_6If9m4gRZA36p_pmrlU7I,34633
|
7
|
-
crossplane_function_pythonic-0.0.7.post3.dist-info/METADATA,sha256=aTjHx145GiKZHTr0Tmma3PkzkWKLUJYdF1eDN3Uee04,22618
|
8
|
-
crossplane_function_pythonic-0.0.7.post3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
9
|
-
crossplane_function_pythonic-0.0.7.post3.dist-info/entry_points.txt,sha256=jJ4baywFDviB9WyAhyhNYF2VOCb6XtbRSjKf7bnBwhg,68
|
10
|
-
crossplane_function_pythonic-0.0.7.post3.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
11
|
-
crossplane_function_pythonic-0.0.7.post3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|