crossplane-function-pythonic 0.1.1__tar.gz → 0.1.2__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.1.1 → crossplane_function_pythonic-0.1.2}/PKG-INFO +4 -4
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/README.md +3 -3
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/crossplane/pythonic/composite.py +4 -26
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/crossplane/pythonic/main.py +8 -8
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/.dev/functions.yaml +1 -1
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/aks-cluster/cluster-function-pythonic.yaml +1 -1
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/aks-cluster/functions.yaml +1 -1
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/eks-cluster/functions.yaml +1 -1
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/filing-system/function.yaml +1 -1
- {crossplane_function_pythonic-0.1.1/examples/function-go-templating/context → crossplane_function_pythonic-0.1.2/examples/function-go-templating/conditions}/functions.yaml +1 -1
- {crossplane_function_pythonic-0.1.1/examples/function-go-templating/conditions → crossplane_function_pythonic-0.1.2/examples/function-go-templating/context}/functions.yaml +1 -1
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/extra-resources/functions.yaml +1 -1
- {crossplane_function_pythonic-0.1.1/examples/function-go-templating/functions/getComposedResource → crossplane_function_pythonic-0.1.2/examples/function-go-templating/functions/fromYaml}/functions.yaml +1 -1
- {crossplane_function_pythonic-0.1.1/examples/function-go-templating/functions/getCompositeResource → crossplane_function_pythonic-0.1.2/examples/function-go-templating/functions/getComposedResource}/functions.yaml +1 -1
- {crossplane_function_pythonic-0.1.1/examples/function-go-templating/functions/fromYaml → crossplane_function_pythonic-0.1.2/examples/function-go-templating/functions/getCompositeResource}/functions.yaml +1 -1
- crossplane_function_pythonic-0.1.2/examples/function-go-templating/functions/getResourceCondition/functions.yaml +9 -0
- crossplane_function_pythonic-0.1.2/examples/function-go-templating/functions/include/functions.yaml +9 -0
- crossplane_function_pythonic-0.1.2/examples/function-go-templating/functions/toYaml/functions.yaml +9 -0
- crossplane_function_pythonic-0.1.2/examples/function-go-templating/inline/functions.yaml +9 -0
- crossplane_function_pythonic-0.1.2/examples/function-go-templating/recursive/functions.yaml +9 -0
- {crossplane_function_pythonic-0.1.1/examples/single-purpose → crossplane_function_pythonic-0.1.2/examples/get-started-app}/functions.yaml +1 -1
- {crossplane_function_pythonic-0.1.1/examples/get-started-app → crossplane_function_pythonic-0.1.2/examples/helm-copy-secret}/functions.yaml +1 -1
- crossplane_function_pythonic-0.1.2/examples/import-existing-vpc/README.md +35 -0
- crossplane_function_pythonic-0.1.2/examples/import-existing-vpc/composition.yaml +73 -0
- crossplane_function_pythonic-0.1.2/examples/import-existing-vpc/definition.yaml +39 -0
- crossplane_function_pythonic-0.1.2/examples/import-existing-vpc/functions.yaml +8 -0
- crossplane_function_pythonic-0.1.2/examples/import-existing-vpc/observed.yaml +6 -0
- crossplane_function_pythonic-0.1.2/examples/import-existing-vpc/provider-ec2.yaml +20 -0
- crossplane_function_pythonic-0.1.2/examples/import-existing-vpc/render.sh +4 -0
- crossplane_function_pythonic-0.1.2/examples/import-existing-vpc/xr.yaml +10 -0
- {crossplane_function_pythonic-0.1.1/examples/helm-copy-secret → crossplane_function_pythonic-0.1.2/examples/single-purpose}/functions.yaml +1 -1
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/single-purpose/xr.yaml +1 -0
- crossplane_function_pythonic-0.1.2/examples/usages-extra/functions.yaml +9 -0
- crossplane_function_pythonic-0.1.1/examples/function-go-templating/functions/getResourceCondition/functions.yaml +0 -9
- crossplane_function_pythonic-0.1.1/examples/function-go-templating/functions/include/functions.yaml +0 -9
- crossplane_function_pythonic-0.1.1/examples/function-go-templating/functions/toYaml/functions.yaml +0 -9
- crossplane_function_pythonic-0.1.1/examples/function-go-templating/inline/functions.yaml +0 -9
- crossplane_function_pythonic-0.1.1/examples/function-go-templating/recursive/functions.yaml +0 -9
- crossplane_function_pythonic-0.1.1/examples/usages-extra/functions.yaml +0 -9
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/.gitignore +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/LICENSE +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/crossplane/pythonic/__init__.py +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/crossplane/pythonic/function.py +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/crossplane/pythonic/packages.py +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/crossplane/pythonic/protobuf.py +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/aks-cluster/README.md +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/aks-cluster/aks/kubernetescluster.py +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/aks-cluster/aks/resourcegroup.py +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/aks-cluster/composition.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/aks-cluster/definition.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/aks-cluster/install.sh +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/aks-cluster/kustomization.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/aks-cluster/providers.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/aks-cluster/render.sh +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/aks-cluster/xr.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/eks-cluster/composition-v2.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/eks-cluster/composition.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/eks-cluster/definition.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/eks-cluster/render-v2.sh +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/eks-cluster/render.sh +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/eks-cluster/xr.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/filing-system/README.md +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/filing-system/composition.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/filing-system/definition.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/filing-system/kustomization.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/filing-system/runtime.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/filing-system/vcluster.py +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/filing-system/vcluster.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/conditions/composition.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/conditions/render.sh +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/conditions/xr.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/conditions/xrd.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/context/composition.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/context/environmentConfigs.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/context/render.sh +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/context/xr.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/context/xrd.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/extra-resources/composition.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/extra-resources/extraResources.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/extra-resources/render.sh +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/extra-resources/xr.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/functions/fromYaml/composition.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/functions/fromYaml/render.sh +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/functions/fromYaml/xr.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/functions/getComposedResource/composition.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/functions/getComposedResource/observed.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/functions/getComposedResource/render.sh +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/functions/getComposedResource/xr.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/functions/getCompositeResource/composition.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/functions/getCompositeResource/render.sh +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/functions/getCompositeResource/xr.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/functions/getResourceCondition/composition.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/functions/getResourceCondition/observed.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/functions/getResourceCondition/render.sh +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/functions/getResourceCondition/xr.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/functions/include/composition.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/functions/include/render.sh +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/functions/include/xr.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/functions/toYaml/composition.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/functions/toYaml/render.sh +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/functions/toYaml/xr.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/inline/composition.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/inline/render.sh +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/inline/xr.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/recursive/composition-real.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/recursive/composition-wrapper.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/recursive/render.sh +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/function-go-templating/recursive/xr.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/get-started-app/composition.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/get-started-app/definition.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/get-started-app/render.sh +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/get-started-app/xr.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/helm-copy-secret/composition.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/helm-copy-secret/kustomization.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/helm-copy-secret/render.sh +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/helm-copy-secret/run-function.sh +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/helm-copy-secret/vcluster.py +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/helm-copy-secret/xr.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/helm-copy-secret/xrd.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/single-purpose/render.sh +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/usages-extra/composition.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/usages-extra/extraResources.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/usages-extra/observedResources.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/usages-extra/render.sh +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/examples/usages-extra/xr.yaml +0 -0
- {crossplane_function_pythonic-0.1.1 → crossplane_function_pythonic-0.1.2}/pyproject.toml +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: crossplane-function-pythonic
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.2
|
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
|
@@ -81,7 +81,7 @@ kind: Function
|
|
81
81
|
metadata:
|
82
82
|
name: function-pythonic
|
83
83
|
spec:
|
84
|
-
package: ghcr.io/fortra/function-pythonic:v0.1.
|
84
|
+
package: ghcr.io/fortra/function-pythonic:v0.1.2
|
85
85
|
```
|
86
86
|
## Composed Resource Dependencies
|
87
87
|
|
@@ -408,7 +408,7 @@ metadata:
|
|
408
408
|
annotations:
|
409
409
|
render.crossplane.io/runtime: Development
|
410
410
|
spec:
|
411
|
-
package: ghcr.io/fortra/function-pythonic:v0.1.
|
411
|
+
package: ghcr.io/fortra/function-pythonic:v0.1.2
|
412
412
|
```
|
413
413
|
In one terminal session, run function-pythonic:
|
414
414
|
```shell
|
@@ -510,7 +510,7 @@ kind: Function
|
|
510
510
|
metadata:
|
511
511
|
name: function-pythonic
|
512
512
|
spec:
|
513
|
-
package: ghcr.io/fortra/function-pythonic:v0.1.
|
513
|
+
package: ghcr.io/fortra/function-pythonic:v0.1.2
|
514
514
|
runtimeConfigRef:
|
515
515
|
name: function-pythonic
|
516
516
|
---
|
@@ -57,7 +57,7 @@ kind: Function
|
|
57
57
|
metadata:
|
58
58
|
name: function-pythonic
|
59
59
|
spec:
|
60
|
-
package: ghcr.io/fortra/function-pythonic:v0.1.
|
60
|
+
package: ghcr.io/fortra/function-pythonic:v0.1.2
|
61
61
|
```
|
62
62
|
## Composed Resource Dependencies
|
63
63
|
|
@@ -384,7 +384,7 @@ metadata:
|
|
384
384
|
annotations:
|
385
385
|
render.crossplane.io/runtime: Development
|
386
386
|
spec:
|
387
|
-
package: ghcr.io/fortra/function-pythonic:v0.1.
|
387
|
+
package: ghcr.io/fortra/function-pythonic:v0.1.2
|
388
388
|
```
|
389
389
|
In one terminal session, run function-pythonic:
|
390
390
|
```shell
|
@@ -486,7 +486,7 @@ kind: Function
|
|
486
486
|
metadata:
|
487
487
|
name: function-pythonic
|
488
488
|
spec:
|
489
|
-
package: ghcr.io/fortra/function-pythonic:v0.1.
|
489
|
+
package: ghcr.io/fortra/function-pythonic:v0.1.2
|
490
490
|
runtimeConfigRef:
|
491
491
|
name: function-pythonic
|
492
492
|
---
|
@@ -41,7 +41,7 @@ class BaseComposite:
|
|
41
41
|
self.kind = self.observed.kind
|
42
42
|
self.metadata = self.observed.metadata
|
43
43
|
self.spec = self.observed.spec
|
44
|
-
self.status =
|
44
|
+
self.status = self.desired.status
|
45
45
|
self.conditions = Conditions(observed, self.response)
|
46
46
|
self.connection = Connection(observed, desired)
|
47
47
|
self.events = Events(self.response)
|
@@ -217,10 +217,9 @@ class Resource:
|
|
217
217
|
|
218
218
|
@property
|
219
219
|
def externalName(self):
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
return name
|
220
|
+
if 'crossplane.io/external-name' in self.metadata.annotations:
|
221
|
+
return self.metadata.annotations['crossplane.io/external-name']
|
222
|
+
return self.observed.metadata.annotations['crossplane.io/external-name']
|
224
223
|
|
225
224
|
@externalName.setter
|
226
225
|
def externalName(self, name):
|
@@ -409,27 +408,6 @@ class RequiredResource:
|
|
409
408
|
return bool(self.observed)
|
410
409
|
|
411
410
|
|
412
|
-
class Status:
|
413
|
-
def __init__(self, observed, desired):
|
414
|
-
self.__dict__['_observed'] = observed
|
415
|
-
self.__dict__['_desired'] = desired
|
416
|
-
|
417
|
-
def __getattr__(self, key):
|
418
|
-
return self[key]
|
419
|
-
|
420
|
-
def __getitem__(self, key):
|
421
|
-
value = self._desired[key]
|
422
|
-
if value is None:
|
423
|
-
value = self._observed[key]
|
424
|
-
return value
|
425
|
-
|
426
|
-
def __setattr__(self, key, value):
|
427
|
-
self[key] = value
|
428
|
-
|
429
|
-
def __setitem__(self, key, value):
|
430
|
-
self._desired[key] = value
|
431
|
-
|
432
|
-
|
433
411
|
class Conditions:
|
434
412
|
def __init__(self, observed, response=None):
|
435
413
|
self._observed = observed
|
@@ -102,13 +102,6 @@ class Main:
|
|
102
102
|
print('Either --tls-certs-dir or --insecure must be specified', file=sys.stderr)
|
103
103
|
sys.exit(1)
|
104
104
|
|
105
|
-
self.configure_logging(args)
|
106
|
-
# enables read only volumes or mismatched uid volumes
|
107
|
-
sys.dont_write_bytecode = True
|
108
|
-
await self.run(args)
|
109
|
-
|
110
|
-
# Allow for independent running of function-pythonic
|
111
|
-
async def run(self, args):
|
112
105
|
if args.pip_install:
|
113
106
|
import pip._internal.cli.main
|
114
107
|
pip._internal.cli.main.main(['install', '--user', *shlex.split(args.pip_install)])
|
@@ -116,6 +109,13 @@ class Main:
|
|
116
109
|
for path in reversed(args.python_path):
|
117
110
|
sys.path.insert(0, str(pathlib.Path(path).expanduser().resolve()))
|
118
111
|
|
112
|
+
self.configure_logging(args)
|
113
|
+
# enables read only volumes or mismatched uid volumes
|
114
|
+
sys.dont_write_bytecode = True
|
115
|
+
await self.run(args)
|
116
|
+
|
117
|
+
# Allow for independent running of function-pythonic
|
118
|
+
async def run(self, args):
|
119
119
|
if args.allow_oversize_protos:
|
120
120
|
from google.protobuf.internal import api_implementation
|
121
121
|
if api_implementation._c_module:
|
@@ -166,7 +166,7 @@ class Main:
|
|
166
166
|
handler = logging.StreamHandler()
|
167
167
|
handler.setFormatter(formatter)
|
168
168
|
logger = logging.getLogger()
|
169
|
-
logger.
|
169
|
+
logger.handlers = [handler]
|
170
170
|
logger.setLevel(logging.DEBUG if args.debug else logging.INFO)
|
171
171
|
|
172
172
|
|
@@ -15,7 +15,7 @@ metadata:
|
|
15
15
|
# This tells crossplane beta render to connect to the function locally.
|
16
16
|
render.crossplane.io/runtime: Development
|
17
17
|
spec:
|
18
|
-
package: ghcr.io/fortra/function-pythonic:v0.1.
|
18
|
+
package: ghcr.io/fortra/function-pythonic:v0.1.2
|
19
19
|
---
|
20
20
|
apiVersion: pkg.crossplane.io/v1beta1
|
21
21
|
kind: Function
|
@@ -15,7 +15,7 @@ metadata:
|
|
15
15
|
# This tells crossplane beta render to connect to the function locally.
|
16
16
|
render.crossplane.io/runtime: Development
|
17
17
|
spec:
|
18
|
-
package: ghcr.io/fortra/function-pythonic:v0.1.
|
18
|
+
package: ghcr.io/fortra/function-pythonic:v0.1.2
|
19
19
|
---
|
20
20
|
apiVersion: pkg.crossplane.io/v1beta1
|
21
21
|
kind: Function
|
@@ -0,0 +1,9 @@
|
|
1
|
+
apiVersion: pkg.crossplane.io/v1beta1
|
2
|
+
kind: Function
|
3
|
+
metadata:
|
4
|
+
name: function-pythonic
|
5
|
+
annotations:
|
6
|
+
# This tells crossplane beta render to connect to the function locally.
|
7
|
+
render.crossplane.io/runtime: Development
|
8
|
+
spec:
|
9
|
+
package: ghcr.io/fortra/function-pythonic:v0.1.2
|
crossplane_function_pythonic-0.1.2/examples/function-go-templating/functions/include/functions.yaml
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
apiVersion: pkg.crossplane.io/v1beta1
|
2
|
+
kind: Function
|
3
|
+
metadata:
|
4
|
+
name: function-pythonic
|
5
|
+
annotations:
|
6
|
+
# This tells crossplane beta render to connect to the function locally.
|
7
|
+
render.crossplane.io/runtime: Development
|
8
|
+
spec:
|
9
|
+
package: ghcr.io/fortra/function-pythonic:v0.1.2
|
crossplane_function_pythonic-0.1.2/examples/function-go-templating/functions/toYaml/functions.yaml
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
apiVersion: pkg.crossplane.io/v1beta1
|
2
|
+
kind: Function
|
3
|
+
metadata:
|
4
|
+
name: function-pythonic
|
5
|
+
annotations:
|
6
|
+
# This tells crossplane beta render to connect to the function locally.
|
7
|
+
render.crossplane.io/runtime: Development
|
8
|
+
spec:
|
9
|
+
package: ghcr.io/fortra/function-pythonic:v0.1.2
|
@@ -0,0 +1,9 @@
|
|
1
|
+
apiVersion: pkg.crossplane.io/v1beta1
|
2
|
+
kind: Function
|
3
|
+
metadata:
|
4
|
+
name: function-pythonic
|
5
|
+
annotations:
|
6
|
+
# This tells crossplane beta render to connect to the function locally.
|
7
|
+
render.crossplane.io/runtime: Development
|
8
|
+
spec:
|
9
|
+
package: ghcr.io/fortra/function-pythonic:v0.1.2
|
@@ -0,0 +1,9 @@
|
|
1
|
+
apiVersion: pkg.crossplane.io/v1beta1
|
2
|
+
kind: Function
|
3
|
+
metadata:
|
4
|
+
name: function-pythonic
|
5
|
+
annotations:
|
6
|
+
# This tells crossplane beta render to connect to the function locally.
|
7
|
+
render.crossplane.io/runtime: Development
|
8
|
+
spec:
|
9
|
+
package: ghcr.io/fortra/function-pythonic:v0.1.2
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# Import Existing VPC
|
2
|
+
|
3
|
+
This example demonstrates how to dynamically detect and importing
|
4
|
+
existing external resources when the external name of that resource
|
5
|
+
is a name generated by the external backend.
|
6
|
+
|
7
|
+
function-pythonic is deployed using `--pip-install` command line
|
8
|
+
option to install the AWS python client and must be configured
|
9
|
+
with the needed AWS permissions.
|
10
|
+
|
11
|
+
Here is an example of a DeploymentRuntimeConfig that uses the
|
12
|
+
`function-pythonic` ServiceAccount name which is configured
|
13
|
+
with needed EKS Pod Identity AWS permissions:
|
14
|
+
```yaml
|
15
|
+
apiVersion: pkg.crossplane.io/v1beta1
|
16
|
+
kind: DeploymentRuntimeConfig
|
17
|
+
metadata:
|
18
|
+
name: function-pythonic
|
19
|
+
spec:
|
20
|
+
deploymentTemplate:
|
21
|
+
spec:
|
22
|
+
template:
|
23
|
+
spec:
|
24
|
+
containers:
|
25
|
+
- name: package-runtime
|
26
|
+
args:
|
27
|
+
- --debug
|
28
|
+
- --pip-install
|
29
|
+
- --quiet aiobotocore==2.23.2
|
30
|
+
serviceAccountName: function-pythonic
|
31
|
+
```
|
32
|
+
To run the `render.sh` script, ensure that aiobotocore is installed
|
33
|
+
in the python environment used. The default AWS profile will be used
|
34
|
+
unless the AWS_PROFILE environment variable is set, or other
|
35
|
+
appropriate AWS environment variables.
|
@@ -0,0 +1,73 @@
|
|
1
|
+
apiVersion: apiextensions.crossplane.io/v1
|
2
|
+
kind: Composition
|
3
|
+
metadata:
|
4
|
+
name: networks.caleb.pythonic.com
|
5
|
+
spec:
|
6
|
+
compositeTypeRef:
|
7
|
+
apiVersion: caleb.pythonic.com/v1alpha1
|
8
|
+
kind: Network
|
9
|
+
mode: Pipeline
|
10
|
+
pipeline:
|
11
|
+
|
12
|
+
- step: render-templates
|
13
|
+
functionRef:
|
14
|
+
name: function-pythonic
|
15
|
+
input:
|
16
|
+
apiVersion: pythonic.fn.fortra.com/v1alpha1
|
17
|
+
kind: Composite
|
18
|
+
composite: |
|
19
|
+
from crossplane.pythonic import BaseComposite
|
20
|
+
from aiobotocore.session import get_session
|
21
|
+
|
22
|
+
class NetworkComposite(BaseComposite):
|
23
|
+
async def compose(self):
|
24
|
+
# Only create the AWS Session if needed
|
25
|
+
self._aws_session = None
|
26
|
+
# Create/Get VPC
|
27
|
+
vpc = await self.compose_vpc()
|
28
|
+
|
29
|
+
async def compose_vpc(self):
|
30
|
+
vpc = self.resources.VPC('ec2.aws.m.upbound.io/v1beta1', 'VPC')
|
31
|
+
vpc.spec.forProvider(
|
32
|
+
region = self.spec.region,
|
33
|
+
cidrBlock = self.spec.cidr,
|
34
|
+
enableDnsHostnames = True,
|
35
|
+
enableDnsSupport = True,
|
36
|
+
tags = self.tags(Name=self.metadata.name),
|
37
|
+
)
|
38
|
+
if not vpc.externalName:
|
39
|
+
async with self.aws_client('ec2') as ec2:
|
40
|
+
vpcs = (await ec2.describe_vpcs(
|
41
|
+
Filters=[{
|
42
|
+
'Name': 'tag:Name',
|
43
|
+
'Values': [str(self.metadata.name)],
|
44
|
+
}],
|
45
|
+
))['Vpcs']
|
46
|
+
if vpcs:
|
47
|
+
if len(vpcs) == 1:
|
48
|
+
vpc.externalName = vpcs[0]['VpcId']
|
49
|
+
else:
|
50
|
+
self.events.fatal('MultipleResources', f"More than one vpc found for: {self.metadata.name}")
|
51
|
+
self.status.vpcId = vpc.status.atProvider.id
|
52
|
+
return vpc
|
53
|
+
|
54
|
+
def aws_client(self, service):
|
55
|
+
if not self._aws_session:
|
56
|
+
self._aws_session = get_session()
|
57
|
+
self._aws_clients = {}
|
58
|
+
client = self._aws_clients.get(service)
|
59
|
+
if not client:
|
60
|
+
client = self._aws_session.create_client(service, str(self.spec.region))
|
61
|
+
self._aws_clients[service] = client
|
62
|
+
return client
|
63
|
+
|
64
|
+
def tags(self, *args, **kwargs):
|
65
|
+
tags = {}
|
66
|
+
for arg in args:
|
67
|
+
arg = arg.split('=', 1)
|
68
|
+
tags[arg[0].strip()] = arg[1].lstrip()
|
69
|
+
tags.update(kwargs)
|
70
|
+
if self.spec.tags:
|
71
|
+
for key, value in self.spec.tags:
|
72
|
+
tags[key] = value
|
73
|
+
return tags
|
@@ -0,0 +1,39 @@
|
|
1
|
+
apiVersion: apiextensions.crossplane.io/v2
|
2
|
+
kind: CompositeResourceDefinition
|
3
|
+
metadata:
|
4
|
+
name: networks.caleb.pythonic.com
|
5
|
+
spec:
|
6
|
+
group: caleb.pythonic.com
|
7
|
+
names:
|
8
|
+
kind: Network
|
9
|
+
plural: networks
|
10
|
+
defaultCompositionRef:
|
11
|
+
name: networks.caleb.pythonic.com
|
12
|
+
versions:
|
13
|
+
- name: v1alpha1
|
14
|
+
served: true
|
15
|
+
referenceable: true
|
16
|
+
schema:
|
17
|
+
openAPIV3Schema:
|
18
|
+
type: object
|
19
|
+
properties:
|
20
|
+
spec:
|
21
|
+
type: object
|
22
|
+
properties:
|
23
|
+
region:
|
24
|
+
type: string
|
25
|
+
cidr:
|
26
|
+
type: string
|
27
|
+
tags:
|
28
|
+
type: object
|
29
|
+
additionalProperties:
|
30
|
+
type: string
|
31
|
+
default: {}
|
32
|
+
required:
|
33
|
+
- region
|
34
|
+
- cidr
|
35
|
+
status:
|
36
|
+
type: object
|
37
|
+
properties:
|
38
|
+
vpcId:
|
39
|
+
type: string
|
@@ -0,0 +1,20 @@
|
|
1
|
+
apiVersion: pkg.crossplane.io/v1
|
2
|
+
kind: Provider
|
3
|
+
metadata:
|
4
|
+
name: aws-upbound-provider-ec2
|
5
|
+
spec:
|
6
|
+
package: xpkg.upbound.io/upbound/provider-aws-ec2:v2.1.0
|
7
|
+
runtimeConfigRef:
|
8
|
+
name: provider-aws-upbound
|
9
|
+
---
|
10
|
+
apiVersion: aws.m.upbound.io/v1beta1
|
11
|
+
kind: ClusterProviderConfig
|
12
|
+
metadata:
|
13
|
+
name: default
|
14
|
+
spec:
|
15
|
+
credentials:
|
16
|
+
secretRef:
|
17
|
+
key: credentials
|
18
|
+
name: aws-credentials
|
19
|
+
namespace: crossplane-system
|
20
|
+
source: Secret
|
@@ -0,0 +1,9 @@
|
|
1
|
+
apiVersion: pkg.crossplane.io/v1beta1
|
2
|
+
kind: Function
|
3
|
+
metadata:
|
4
|
+
name: function-pythonic
|
5
|
+
annotations:
|
6
|
+
# This tells crossplane beta render to connect to the function locally.
|
7
|
+
render.crossplane.io/runtime: Development
|
8
|
+
spec:
|
9
|
+
package: ghcr.io/fortra/function-pythonic:v0.1.2
|
@@ -1,9 +0,0 @@
|
|
1
|
-
apiVersion: pkg.crossplane.io/v1beta1
|
2
|
-
kind: Function
|
3
|
-
metadata:
|
4
|
-
name: function-pythonic
|
5
|
-
annotations:
|
6
|
-
# This tells crossplane beta render to connect to the function locally.
|
7
|
-
render.crossplane.io/runtime: Development
|
8
|
-
spec:
|
9
|
-
package: ghcr.io/fortra/function-pythonic:v0.1.1
|
crossplane_function_pythonic-0.1.1/examples/function-go-templating/functions/include/functions.yaml
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
apiVersion: pkg.crossplane.io/v1beta1
|
2
|
-
kind: Function
|
3
|
-
metadata:
|
4
|
-
name: function-pythonic
|
5
|
-
annotations:
|
6
|
-
# This tells crossplane beta render to connect to the function locally.
|
7
|
-
render.crossplane.io/runtime: Development
|
8
|
-
spec:
|
9
|
-
package: ghcr.io/fortra/function-pythonic:v0.1.1
|
crossplane_function_pythonic-0.1.1/examples/function-go-templating/functions/toYaml/functions.yaml
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
apiVersion: pkg.crossplane.io/v1beta1
|
2
|
-
kind: Function
|
3
|
-
metadata:
|
4
|
-
name: function-pythonic
|
5
|
-
annotations:
|
6
|
-
# This tells crossplane beta render to connect to the function locally.
|
7
|
-
render.crossplane.io/runtime: Development
|
8
|
-
spec:
|
9
|
-
package: ghcr.io/fortra/function-pythonic:v0.1.1
|
@@ -1,9 +0,0 @@
|
|
1
|
-
apiVersion: pkg.crossplane.io/v1beta1
|
2
|
-
kind: Function
|
3
|
-
metadata:
|
4
|
-
name: function-pythonic
|
5
|
-
annotations:
|
6
|
-
# This tells crossplane beta render to connect to the function locally.
|
7
|
-
render.crossplane.io/runtime: Development
|
8
|
-
spec:
|
9
|
-
package: ghcr.io/fortra/function-pythonic:v0.1.1
|
@@ -1,9 +0,0 @@
|
|
1
|
-
apiVersion: pkg.crossplane.io/v1beta1
|
2
|
-
kind: Function
|
3
|
-
metadata:
|
4
|
-
name: function-pythonic
|
5
|
-
annotations:
|
6
|
-
# This tells crossplane beta render to connect to the function locally.
|
7
|
-
render.crossplane.io/runtime: Development
|
8
|
-
spec:
|
9
|
-
package: xpkg.upbound.io/crossplane-contrib/function-pythonicv0.1.0
|
@@ -1,9 +0,0 @@
|
|
1
|
-
apiVersion: pkg.crossplane.io/v1beta1
|
2
|
-
kind: Function
|
3
|
-
metadata:
|
4
|
-
name: function-pythonic
|
5
|
-
annotations:
|
6
|
-
# This tells crossplane beta render to connect to the function locally.
|
7
|
-
render.crossplane.io/runtime: Development
|
8
|
-
spec:
|
9
|
-
package: ghcr.io/fortra/function-pythonic:v0.1.1
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|