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.
Files changed (126) hide show
  1. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/PKG-INFO +5 -5
  2. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/README.md +4 -4
  3. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/crossplane/pythonic/composite.py +20 -3
  4. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/crossplane/pythonic/function.py +6 -7
  5. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/.dev/functions.yaml +1 -1
  6. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/aks-cluster/cluster-function-pythonic.yaml +1 -1
  7. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/aks-cluster/functions.yaml +1 -1
  8. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/eks-cluster/functions.yaml +1 -1
  9. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/filing-system/function.yaml +1 -1
  10. {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
  11. {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
  12. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/extra-resources/functions.yaml +1 -1
  13. {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
  14. {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
  15. {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
  16. crossplane_function_pythonic-0.1.3/examples/function-go-templating/functions/getResourceCondition/functions.yaml +9 -0
  17. crossplane_function_pythonic-0.1.3/examples/function-go-templating/functions/include/functions.yaml +9 -0
  18. crossplane_function_pythonic-0.1.3/examples/function-go-templating/functions/toYaml/functions.yaml +9 -0
  19. crossplane_function_pythonic-0.1.3/examples/function-go-templating/inline/functions.yaml +9 -0
  20. crossplane_function_pythonic-0.1.3/examples/function-go-templating/recursive/functions.yaml +9 -0
  21. {crossplane_function_pythonic-0.1.2/examples/single-purpose → crossplane_function_pythonic-0.1.3/examples/get-started-app}/functions.yaml +1 -1
  22. {crossplane_function_pythonic-0.1.2/examples/get-started-app → crossplane_function_pythonic-0.1.3/examples/helm-copy-secret}/functions.yaml +1 -1
  23. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/import-existing-vpc/composition.yaml +1 -6
  24. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/import-existing-vpc/functions.yaml +1 -1
  25. {crossplane_function_pythonic-0.1.2/examples/helm-copy-secret → crossplane_function_pythonic-0.1.3/examples/single-purpose}/functions.yaml +1 -1
  26. crossplane_function_pythonic-0.1.3/examples/usages-extra/functions.yaml +9 -0
  27. crossplane_function_pythonic-0.1.2/examples/function-go-templating/functions/getResourceCondition/functions.yaml +0 -9
  28. crossplane_function_pythonic-0.1.2/examples/function-go-templating/functions/include/functions.yaml +0 -9
  29. crossplane_function_pythonic-0.1.2/examples/function-go-templating/functions/toYaml/functions.yaml +0 -9
  30. crossplane_function_pythonic-0.1.2/examples/function-go-templating/inline/functions.yaml +0 -9
  31. crossplane_function_pythonic-0.1.2/examples/function-go-templating/recursive/functions.yaml +0 -9
  32. crossplane_function_pythonic-0.1.2/examples/usages-extra/functions.yaml +0 -9
  33. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/.gitignore +0 -0
  34. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/LICENSE +0 -0
  35. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/crossplane/pythonic/__init__.py +0 -0
  36. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/crossplane/pythonic/main.py +0 -0
  37. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/crossplane/pythonic/packages.py +0 -0
  38. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/crossplane/pythonic/protobuf.py +0 -0
  39. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/aks-cluster/README.md +0 -0
  40. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/aks-cluster/aks/kubernetescluster.py +0 -0
  41. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/aks-cluster/aks/resourcegroup.py +0 -0
  42. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/aks-cluster/composition.yaml +0 -0
  43. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/aks-cluster/definition.yaml +0 -0
  44. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/aks-cluster/install.sh +0 -0
  45. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/aks-cluster/kustomization.yaml +0 -0
  46. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/aks-cluster/providers.yaml +0 -0
  47. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/aks-cluster/render.sh +0 -0
  48. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/aks-cluster/xr.yaml +0 -0
  49. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/eks-cluster/composition-v2.yaml +0 -0
  50. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/eks-cluster/composition.yaml +0 -0
  51. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/eks-cluster/definition.yaml +0 -0
  52. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/eks-cluster/render-v2.sh +0 -0
  53. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/eks-cluster/render.sh +0 -0
  54. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/eks-cluster/xr.yaml +0 -0
  55. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/filing-system/README.md +0 -0
  56. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/filing-system/composition.yaml +0 -0
  57. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/filing-system/definition.yaml +0 -0
  58. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/filing-system/kustomization.yaml +0 -0
  59. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/filing-system/runtime.yaml +0 -0
  60. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/filing-system/vcluster.py +0 -0
  61. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/filing-system/vcluster.yaml +0 -0
  62. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/conditions/composition.yaml +0 -0
  63. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/conditions/render.sh +0 -0
  64. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/conditions/xr.yaml +0 -0
  65. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/conditions/xrd.yaml +0 -0
  66. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/context/composition.yaml +0 -0
  67. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/context/environmentConfigs.yaml +0 -0
  68. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/context/render.sh +0 -0
  69. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/context/xr.yaml +0 -0
  70. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/context/xrd.yaml +0 -0
  71. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/extra-resources/composition.yaml +0 -0
  72. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/extra-resources/extraResources.yaml +0 -0
  73. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/extra-resources/render.sh +0 -0
  74. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/extra-resources/xr.yaml +0 -0
  75. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/fromYaml/composition.yaml +0 -0
  76. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/fromYaml/render.sh +0 -0
  77. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/fromYaml/xr.yaml +0 -0
  78. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/getComposedResource/composition.yaml +0 -0
  79. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/getComposedResource/observed.yaml +0 -0
  80. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/getComposedResource/render.sh +0 -0
  81. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/getComposedResource/xr.yaml +0 -0
  82. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/getCompositeResource/composition.yaml +0 -0
  83. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/getCompositeResource/render.sh +0 -0
  84. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/getCompositeResource/xr.yaml +0 -0
  85. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/getResourceCondition/composition.yaml +0 -0
  86. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/getResourceCondition/observed.yaml +0 -0
  87. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/getResourceCondition/render.sh +0 -0
  88. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/getResourceCondition/xr.yaml +0 -0
  89. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/include/composition.yaml +0 -0
  90. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/include/render.sh +0 -0
  91. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/include/xr.yaml +0 -0
  92. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/toYaml/composition.yaml +0 -0
  93. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/toYaml/render.sh +0 -0
  94. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/functions/toYaml/xr.yaml +0 -0
  95. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/inline/composition.yaml +0 -0
  96. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/inline/render.sh +0 -0
  97. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/inline/xr.yaml +0 -0
  98. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/recursive/composition-real.yaml +0 -0
  99. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/recursive/composition-wrapper.yaml +0 -0
  100. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/recursive/render.sh +0 -0
  101. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/function-go-templating/recursive/xr.yaml +0 -0
  102. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/get-started-app/composition.yaml +0 -0
  103. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/get-started-app/definition.yaml +0 -0
  104. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/get-started-app/render.sh +0 -0
  105. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/get-started-app/xr.yaml +0 -0
  106. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/helm-copy-secret/composition.yaml +0 -0
  107. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/helm-copy-secret/kustomization.yaml +0 -0
  108. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/helm-copy-secret/render.sh +0 -0
  109. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/helm-copy-secret/run-function.sh +0 -0
  110. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/helm-copy-secret/vcluster.py +0 -0
  111. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/helm-copy-secret/xr.yaml +0 -0
  112. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/helm-copy-secret/xrd.yaml +0 -0
  113. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/import-existing-vpc/README.md +0 -0
  114. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/import-existing-vpc/definition.yaml +0 -0
  115. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/import-existing-vpc/observed.yaml +0 -0
  116. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/import-existing-vpc/provider-ec2.yaml +0 -0
  117. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/import-existing-vpc/render.sh +0 -0
  118. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/import-existing-vpc/xr.yaml +0 -0
  119. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/single-purpose/render.sh +0 -0
  120. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/single-purpose/xr.yaml +0 -0
  121. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/usages-extra/composition.yaml +0 -0
  122. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/usages-extra/extraResources.yaml +0 -0
  123. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/usages-extra/observedResources.yaml +0 -0
  124. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/usages-extra/render.sh +0 -0
  125. {crossplane_function_pythonic-0.1.2 → crossplane_function_pythonic-0.1.3}/examples/usages-extra/xr.yaml +0 -0
  126. {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.2
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.crossplane.io/v1beta1
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.2
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.2
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.2
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.crossplane.io/v1beta1
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.2
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.2
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.2
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
- return Resource(self._composite, key)
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
- return RequiredResources(self._composite, key)
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
- return RequiredResource(self.name, ix, self._resources.items[ix])
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 += ' exceptiion'
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] == 'request' and
178
- name[1] == 'observed' and
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)]('apiextensions.crossplane.io/v1beta1', 'Usage')
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)]('apiextensions.crossplane.io/v1beta1', 'Usage')
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)
@@ -10,4 +10,4 @@ metadata:
10
10
  render.crossplane.io/runtime: Development
11
11
  render.crossplane.io/runtime-development-target: localhost:9443
12
12
  spec:
13
- package: ghcr.io/fortra/function-pythonic:v0.1.2
13
+ package: ghcr.io/fortra/function-pythonic:v0.1.3
@@ -3,7 +3,7 @@ kind: Function
3
3
  metadata:
4
4
  name: function-pythonic
5
5
  spec:
6
- package: ghcr.io/fortra/function-pythonic:v0.1.2
6
+ package: ghcr.io/fortra/function-pythonic:v0.1.3
7
7
  runtimeConfigRef:
8
8
  name: function-pythonic
9
9
  ---
@@ -5,6 +5,6 @@ metadata:
5
5
  annotations:
6
6
  render.crossplane.io/runtime: Development
7
7
  spec:
8
- package: ghcr.io/fortra/function-pythonic:v0.1.2
8
+ package: ghcr.io/fortra/function-pythonic:v0.1.3
9
9
  runtimeConfigRef:
10
10
  name: function-pythonic
@@ -5,4 +5,4 @@ metadata:
5
5
  annotations:
6
6
  render.crossplane.io/runtime: Development
7
7
  spec:
8
- package: ghcr.io/fortra/function-pythonic:v0.1.2
8
+ package: ghcr.io/fortra/function-pythonic:v0.1.3
@@ -3,7 +3,7 @@ kind: Function
3
3
  metadata:
4
4
  name: function-pythonic
5
5
  spec:
6
- package: ghcr.io/fortra/function-pythonic:v0.1.2
6
+ package: ghcr.io/fortra/function-pythonic:v0.1.3
7
7
  runtimeConfigRef:
8
8
  apiVersion: pkg.crossplane.io/v1beta1
9
9
  kind: DeploymentRuntimeConfig
@@ -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.2
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.2
18
+ package: ghcr.io/fortra/function-pythonic:v0.1.3
19
19
  ---
20
20
  apiVersion: pkg.crossplane.io/v1beta1
21
21
  kind: Function
@@ -6,4 +6,4 @@ metadata:
6
6
  # This tells crossplane beta render to connect to the function locally.
7
7
  render.crossplane.io/runtime: Development
8
8
  spec:
9
- package: ghcr.io/fortra/function-pythonic:v0.1.2
9
+ package: ghcr.io/fortra/function-pythonic:v0.1.3
@@ -6,4 +6,4 @@ metadata:
6
6
  # This tells crossplane beta render to connect to the function locally.
7
7
  render.crossplane.io/runtime: Development
8
8
  spec:
9
- package: ghcr.io/fortra/function-pythonic:v0.1.2
9
+ package: ghcr.io/fortra/function-pythonic:v0.1.3
@@ -6,4 +6,4 @@ metadata:
6
6
  # This tells crossplane beta render to connect to the function locally.
7
7
  render.crossplane.io/runtime: Development
8
8
  spec:
9
- package: ghcr.io/fortra/function-pythonic:v0.1.2
9
+ package: ghcr.io/fortra/function-pythonic:v0.1.3
@@ -6,4 +6,4 @@ metadata:
6
6
  # This tells crossplane beta render to connect to the function locally.
7
7
  render.crossplane.io/runtime: Development
8
8
  spec:
9
- package: ghcr.io/fortra/function-pythonic:v0.1.2
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
@@ -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
@@ -5,4 +5,4 @@ metadata:
5
5
  annotations:
6
6
  render.crossplane.io/runtime: Development
7
7
  spec:
8
- package: ghcr.io/fortra/function-pythonic:v0.1.2
8
+ package: ghcr.io/fortra/function-pythonic:v0.1.3
@@ -5,4 +5,4 @@ metadata:
5
5
  annotations:
6
6
  render.crossplane.io/runtime: Development
7
7
  spec:
8
- package: ghcr.io/fortra/function-pythonic:v0.1.2
8
+ 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
- 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
57
+ return self._aws_session.create_client(service, str(self.spec.region))
63
58
 
64
59
  def tags(self, *args, **kwargs):
65
60
  tags = {}
@@ -5,4 +5,4 @@ metadata:
5
5
  annotations:
6
6
  render.crossplane.io/runtime: Development
7
7
  spec:
8
- package: ghcr.io/fortra/function-pythonic:v0.1.2
8
+ package: ghcr.io/fortra/function-pythonic:v0.1.3
@@ -5,4 +5,4 @@ metadata:
5
5
  annotations:
6
6
  render.crossplane.io/runtime: Development
7
7
  spec:
8
- package: ghcr.io/fortra/function-pythonic:v0.1.2
8
+ 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
@@ -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
@@ -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