crossplane-function-pythonic 0.1.2__tar.gz → 0.1.3__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.2 → crossplane_function_pythonic-0.1.3}/PKG-INFO +5 -5
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/README.md +4 -4
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/crossplane/pythonic/composite.py +20 -3
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/crossplane/pythonic/function.py +6 -7
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/.dev/functions.yaml +1 -1
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/aks-cluster/cluster-function-pythonic.yaml +1 -1
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/aks-cluster/functions.yaml +1 -1
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/eks-cluster/functions.yaml +1 -1
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/filing-system/function.yaml +1 -1
- {crossplane_function_pythonic-0.1.2/examples/function-go-templating/context → crossplane_function_pythonic-0.1.3/examples/function-go-templating/conditions}/functions.yaml +1 -1
- {crossplane_function_pythonic-0.1.2/examples/function-go-templating/conditions → crossplane_function_pythonic-0.1.3/examples/function-go-templating/context}/functions.yaml +1 -1
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/extra-resources/functions.yaml +1 -1
- {crossplane_function_pythonic-0.1.2/examples/function-go-templating/functions/getComposedResource → crossplane_function_pythonic-0.1.3/examples/function-go-templating/functions/fromYaml}/functions.yaml +1 -1
- {crossplane_function_pythonic-0.1.2/examples/function-go-templating/functions/getCompositeResource → crossplane_function_pythonic-0.1.3/examples/function-go-templating/functions/getComposedResource}/functions.yaml +1 -1
- {crossplane_function_pythonic-0.1.2/examples/function-go-templating/functions/fromYaml → crossplane_function_pythonic-0.1.3/examples/function-go-templating/functions/getCompositeResource}/functions.yaml +1 -1
- crossplane_function_pythonic-0.1.3/examples/function-go-templating/functions/getResourceCondition/functions.yaml +9 -0
- crossplane_function_pythonic-0.1.3/examples/function-go-templating/functions/include/functions.yaml +9 -0
- crossplane_function_pythonic-0.1.3/examples/function-go-templating/functions/toYaml/functions.yaml +9 -0
- crossplane_function_pythonic-0.1.3/examples/function-go-templating/inline/functions.yaml +9 -0
- crossplane_function_pythonic-0.1.3/examples/function-go-templating/recursive/functions.yaml +9 -0
- {crossplane_function_pythonic-0.1.2/examples/single-purpose → crossplane_function_pythonic-0.1.3/examples/get-started-app}/functions.yaml +1 -1
- {crossplane_function_pythonic-0.1.2/examples/get-started-app → crossplane_function_pythonic-0.1.3/examples/helm-copy-secret}/functions.yaml +1 -1
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/import-existing-vpc/composition.yaml +1 -6
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/import-existing-vpc/functions.yaml +1 -1
- {crossplane_function_pythonic-0.1.2/examples/helm-copy-secret → crossplane_function_pythonic-0.1.3/examples/single-purpose}/functions.yaml +1 -1
- crossplane_function_pythonic-0.1.3/examples/usages-extra/functions.yaml +9 -0
- crossplane_function_pythonic-0.1.2/examples/function-go-templating/functions/getResourceCondition/functions.yaml +0 -9
- crossplane_function_pythonic-0.1.2/examples/function-go-templating/functions/include/functions.yaml +0 -9
- crossplane_function_pythonic-0.1.2/examples/function-go-templating/functions/toYaml/functions.yaml +0 -9
- crossplane_function_pythonic-0.1.2/examples/function-go-templating/inline/functions.yaml +0 -9
- crossplane_function_pythonic-0.1.2/examples/function-go-templating/recursive/functions.yaml +0 -9
- crossplane_function_pythonic-0.1.2/examples/usages-extra/functions.yaml +0 -9
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/.gitignore +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/LICENSE +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/crossplane/pythonic/__init__.py +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/crossplane/pythonic/main.py +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/crossplane/pythonic/packages.py +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/crossplane/pythonic/protobuf.py +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/aks-cluster/README.md +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/aks-cluster/aks/kubernetescluster.py +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/aks-cluster/aks/resourcegroup.py +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/aks-cluster/composition.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/aks-cluster/definition.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/aks-cluster/install.sh +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/aks-cluster/kustomization.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/aks-cluster/providers.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/aks-cluster/render.sh +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/aks-cluster/xr.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/eks-cluster/composition-v2.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/eks-cluster/composition.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/eks-cluster/definition.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/eks-cluster/render-v2.sh +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/eks-cluster/render.sh +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/eks-cluster/xr.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/filing-system/README.md +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/filing-system/composition.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/filing-system/definition.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/filing-system/kustomization.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/filing-system/runtime.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/filing-system/vcluster.py +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/filing-system/vcluster.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/conditions/composition.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/conditions/render.sh +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/conditions/xr.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/conditions/xrd.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/context/composition.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/context/environmentConfigs.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/context/render.sh +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/context/xr.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/context/xrd.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/extra-resources/composition.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/extra-resources/extraResources.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/extra-resources/render.sh +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/extra-resources/xr.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/fromYaml/composition.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/fromYaml/render.sh +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/fromYaml/xr.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/getComposedResource/composition.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/getComposedResource/observed.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/getComposedResource/render.sh +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/getComposedResource/xr.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/getCompositeResource/composition.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/getCompositeResource/render.sh +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/getCompositeResource/xr.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/getResourceCondition/composition.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/getResourceCondition/observed.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/getResourceCondition/render.sh +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/getResourceCondition/xr.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/include/composition.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/include/render.sh +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/include/xr.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/toYaml/composition.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/toYaml/render.sh +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/toYaml/xr.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/inline/composition.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/inline/render.sh +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/inline/xr.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/recursive/composition-real.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/recursive/composition-wrapper.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/recursive/render.sh +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/recursive/xr.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/get-started-app/composition.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/get-started-app/definition.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/get-started-app/render.sh +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/get-started-app/xr.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/helm-copy-secret/composition.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/helm-copy-secret/kustomization.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/helm-copy-secret/render.sh +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/helm-copy-secret/run-function.sh +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/helm-copy-secret/vcluster.py +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/helm-copy-secret/xr.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/helm-copy-secret/xrd.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/import-existing-vpc/README.md +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/import-existing-vpc/definition.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/import-existing-vpc/observed.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/import-existing-vpc/provider-ec2.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/import-existing-vpc/render.sh +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/import-existing-vpc/xr.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/single-purpose/render.sh +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/single-purpose/xr.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/usages-extra/composition.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/usages-extra/extraResources.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/usages-extra/observedResources.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/usages-extra/render.sh +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/usages-extra/xr.yaml +0 -0
- {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/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.3
|
|
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
|
|
@@ -49,7 +49,7 @@ spec:
|
|
|
49
49
|
functionRef:
|
|
50
50
|
name: function-pythonic
|
|
51
51
|
input:
|
|
52
|
-
apiVersion: pythonic.fn.
|
|
52
|
+
apiVersion: pythonic.fn.fortra.com/v1alpha1
|
|
53
53
|
kind: Composite
|
|
54
54
|
composite: |
|
|
55
55
|
class VpcComposite(BaseComposite):
|
|
@@ -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.3
|
|
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.3
|
|
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.3
|
|
514
514
|
runtimeConfigRef:
|
|
515
515
|
name: function-pythonic
|
|
516
516
|
---
|
|
@@ -25,7 +25,7 @@ spec:
|
|
|
25
25
|
functionRef:
|
|
26
26
|
name: function-pythonic
|
|
27
27
|
input:
|
|
28
|
-
apiVersion: pythonic.fn.
|
|
28
|
+
apiVersion: pythonic.fn.fortra.com/v1alpha1
|
|
29
29
|
kind: Composite
|
|
30
30
|
composite: |
|
|
31
31
|
class VpcComposite(BaseComposite):
|
|
@@ -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.3
|
|
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.3
|
|
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.3
|
|
490
490
|
runtimeConfigRef:
|
|
491
491
|
name: function-pythonic
|
|
492
492
|
---
|
|
@@ -140,12 +140,17 @@ class Credential:
|
|
|
140
140
|
class Resources:
|
|
141
141
|
def __init__(self, composite):
|
|
142
142
|
self.__dict__['_composite'] = composite
|
|
143
|
+
self.__dict__['_cache'] = {}
|
|
143
144
|
|
|
144
145
|
def __getattr__(self, key):
|
|
145
146
|
return self[key]
|
|
146
147
|
|
|
147
148
|
def __getitem__(self, key):
|
|
148
|
-
|
|
149
|
+
resource = self._cache.get(key)
|
|
150
|
+
if not resource:
|
|
151
|
+
resource = Resource(self._composite, key)
|
|
152
|
+
self._cache[key] = resource
|
|
153
|
+
return resource
|
|
149
154
|
|
|
150
155
|
def __bool__(self):
|
|
151
156
|
return bool(self._composite.response.desired.resources)
|
|
@@ -165,6 +170,7 @@ class Resources:
|
|
|
165
170
|
|
|
166
171
|
def __setitem__(self, key, resource):
|
|
167
172
|
self._composite.response.desired.resources[key].resource = resource
|
|
173
|
+
self._cache.pop(key, None)
|
|
168
174
|
|
|
169
175
|
def __delattr__(self, key):
|
|
170
176
|
del self[key]
|
|
@@ -172,6 +178,7 @@ class Resources:
|
|
|
172
178
|
def __delitem__(self, key):
|
|
173
179
|
if key in self._composite.response.desired.resources:
|
|
174
180
|
del self._composite.response.desired.resources[key]
|
|
181
|
+
self._cache.pop(key, None)
|
|
175
182
|
|
|
176
183
|
|
|
177
184
|
class Resource:
|
|
@@ -276,12 +283,17 @@ class Resource:
|
|
|
276
283
|
class Requireds:
|
|
277
284
|
def __init__(self, composite):
|
|
278
285
|
self._composite = composite
|
|
286
|
+
self._cache = {}
|
|
279
287
|
|
|
280
288
|
def __getattr__(self, key):
|
|
281
289
|
return self[key]
|
|
282
290
|
|
|
283
291
|
def __getitem__(self, key):
|
|
284
|
-
|
|
292
|
+
required = self._cache.get(key)
|
|
293
|
+
if not required:
|
|
294
|
+
required = RequiredResources(self._composite, key)
|
|
295
|
+
self._cache[key] = required
|
|
296
|
+
return required
|
|
285
297
|
|
|
286
298
|
def __bool__(self):
|
|
287
299
|
return bool(len(self))
|
|
@@ -316,6 +328,7 @@ class RequiredResources:
|
|
|
316
328
|
self.name = name
|
|
317
329
|
self._selector = composite.response.requirements.extra_resources[name]
|
|
318
330
|
self._resources = composite.request.extra_resources[name]
|
|
331
|
+
self._cache = {}
|
|
319
332
|
|
|
320
333
|
def __call__(self, apiVersion=_notset, kind=_notset, namespace=_notset, name=_notset, labels=_notset):
|
|
321
334
|
self._selector()
|
|
@@ -378,7 +391,11 @@ class RequiredResources:
|
|
|
378
391
|
self._selector.match_labels.labels[entry[0]] = entry[1]
|
|
379
392
|
|
|
380
393
|
def __getitem__(self, ix):
|
|
381
|
-
|
|
394
|
+
resource = self._cache.get(ix)
|
|
395
|
+
if not resource:
|
|
396
|
+
resource = RequiredResource(self.name, ix, self._resources.items[ix])
|
|
397
|
+
self._cache[ix] = resource
|
|
398
|
+
return resource
|
|
382
399
|
|
|
383
400
|
def __bool__(self):
|
|
384
401
|
return bool(self._resources.items)
|
|
@@ -123,7 +123,7 @@ class FunctionRunner(grpcv1.FunctionRunnerService):
|
|
|
123
123
|
|
|
124
124
|
def fatal(self, request, logger, message, exception=None):
|
|
125
125
|
if exception:
|
|
126
|
-
message += '
|
|
126
|
+
message += ' exception'
|
|
127
127
|
logger.exception(message)
|
|
128
128
|
m = str(exception)
|
|
129
129
|
if not m:
|
|
@@ -169,13 +169,14 @@ class FunctionRunner(grpcv1.FunctionRunnerService):
|
|
|
169
169
|
source = self.trimFullName(source)
|
|
170
170
|
composite.logger.debug(f"Dependency: {destination} = {source}")
|
|
171
171
|
if resource.usages or (resource.usages is None and composite.usages):
|
|
172
|
+
apiVersion = 'protection.crossplane.io/v1beta1' if composite.metadata.namespace else 'apiextensions.crossplane.io/v1beta1'
|
|
172
173
|
resources = {}
|
|
173
174
|
requireds = {}
|
|
174
175
|
for destination, source in sorted(dependencies.items()):
|
|
175
176
|
name = source.split('.')
|
|
176
177
|
if (len(name) > 5 and
|
|
177
|
-
name[0]
|
|
178
|
-
name[1]
|
|
178
|
+
name[0] in ('request', 'response') and
|
|
179
|
+
name[1] in ('observed', 'desired') and
|
|
179
180
|
name[2] == 'resources' and
|
|
180
181
|
name[4] == 'resource'
|
|
181
182
|
):
|
|
@@ -198,8 +199,7 @@ class FunctionRunner(grpcv1.FunctionRunnerService):
|
|
|
198
199
|
if source.metadata.namespace:
|
|
199
200
|
name.append(str(source.metadata.namespace))
|
|
200
201
|
name.append(str(source.observed.metadata.name))
|
|
201
|
-
usage = composite.resources['_'.join(name)](
|
|
202
|
-
#usage = composite.resources['_'.join(name)]('protection.crossplane.io/v1beta1', 'Usage')
|
|
202
|
+
usage = composite.resources['_'.join(name)](apiVersion, 'Usage')
|
|
203
203
|
if resource.metadata.namespace:
|
|
204
204
|
usage.metadata.namespace = resource.metadata.namespace
|
|
205
205
|
usage.spec.reason = '\n'.join(dependencies)
|
|
@@ -218,8 +218,7 @@ class FunctionRunner(grpcv1.FunctionRunnerService):
|
|
|
218
218
|
if source.metadata.namespace:
|
|
219
219
|
name.append(str(source.metadata.namespace))
|
|
220
220
|
name.append(str(source.metadata.name))
|
|
221
|
-
usage = composite.resources['_'.join(name)](
|
|
222
|
-
#usage = composite.resources['_'.join(name)]('protection.crossplane.io/v1beta1', 'Usage')
|
|
221
|
+
usage = composite.resources['_'.join(name)](apiVersion, 'Usage')
|
|
223
222
|
if resource.metadata.namespace:
|
|
224
223
|
usage.metadata.namespace = resource.metadata.namespace
|
|
225
224
|
usage.spec.reason = '\n'.join(dependencies)
|
|
@@ -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.3
|
|
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.3
|
|
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.3
|
crossplane_function_pythonic-0.1.3/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.3
|
crossplane_function_pythonic-0.1.3/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.3
|
|
@@ -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.3
|
|
@@ -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.3
|
|
@@ -54,12 +54,7 @@ spec:
|
|
|
54
54
|
def aws_client(self, service):
|
|
55
55
|
if not self._aws_session:
|
|
56
56
|
self._aws_session = get_session()
|
|
57
|
-
|
|
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
|
|
57
|
+
return self._aws_session.create_client(service, str(self.spec.region))
|
|
63
58
|
|
|
64
59
|
def tags(self, *args, **kwargs):
|
|
65
60
|
tags = {}
|
|
@@ -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.3
|
|
@@ -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.2
|
crossplane_function_pythonic-0.1.2/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.2
|
crossplane_function_pythonic-0.1.2/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.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.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.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.2
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|