Skip to content

Commit 71caf67

Browse files
committed
Ensure all parent packages are reloaded after new ConfigMap modules are installed.
1 parent db565d0 commit 71caf67

File tree

3 files changed

+26
-18
lines changed

3 files changed

+26
-18
lines changed

.github/workflows/ci.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -248,17 +248,17 @@ jobs:
248248
if: env.XPKG_VERSION == ''
249249
run: echo "XPKG_VERSION=v0.0.0-$(date -d@$(git show -s --format=%ct) +%Y%m%d%H%M%S)-$(git rev-parse --short=12 HEAD)" >> $GITHUB_ENV
250250

251-
# - name: Login to Upbound
252-
# uses: docker/login-action@v3
253-
# if: env.XPKG_ACCESS_ID != ''
254-
# with:
255-
# registry: xpkg.upbound.io
256-
# username: ${{ secrets.XPKG_ACCESS_ID }}
257-
# password: ${{ secrets.XPKG_TOKEN }}
258-
259-
# - name: Push Multi-Platform Package to Upbound
260-
# if: env.XPKG_ACCESS_ID != ''
261-
# run: "bin/crossplane --verbose xpkg push --package-files $(echo *.xpkg|tr ' ' ,) ${{ env.XPKG }}:${{ env.XPKG_VERSION }}"
251+
- name: Login to Upbound
252+
uses: docker/login-action@v3
253+
if: env.XPKG_ACCESS_ID != ''
254+
with:
255+
registry: xpkg.upbound.io
256+
username: ${{ secrets.XPKG_ACCESS_ID }}
257+
password: ${{ secrets.XPKG_TOKEN }}
258+
259+
- name: Push Multi-Platform Package to Upbound
260+
if: env.XPKG_ACCESS_ID != ''
261+
run: "bin/crossplane --verbose xpkg push --package-files $(echo *.xpkg|tr ' ' ,) ${{ env.XPKG }}:${{ env.XPKG_VERSION }}"
262262

263263
- name: Login to GHCR
264264
uses: docker/login-action@v3

crossplane/pythonic/function.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,14 @@ def __init__(self, debug=False, renderUnknowns=False):
2424
self.clazzes = {}
2525

2626
def invalidate_module(self, module):
27-
self.clazzes.clear()
28-
if module in sys.modules:
29-
del sys.modules[module]
27+
ix = len(module)
28+
while ix > 0:
29+
module = module[:ix]
30+
if module in sys.modules:
31+
del sys.modules[module]
32+
ix = module.rfind('.')
3033
importlib.invalidate_caches()
34+
self.clazzes.clear()
3135

3236
async def RunFunction(
3337
self, request: fnv1.RunFunctionRequest, _: grpc.aio.ServicerContext

scripts/setup-local.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#!/usr/bin/env bash
22

3-
helm upgrade --install crossplane --namespace crossplane-system --create-namespace crossplane-stable/crossplane --version v2.0.2
3+
helm upgrade --install crossplane \
4+
--namespace crossplane-system \
5+
--create-namespace crossplane-stable/crossplane \
6+
--version v2.0.2 \
7+
--set 'args={--enable-realtime-compositions=false,--debug}'
48

59
kubectl apply -f - <<EOF
610
apiVersion: pkg.crossplane.io/v1beta1
@@ -192,17 +196,17 @@ spec:
192196
name: function-pythonic
193197
EOF
194198

195-
# package: ghcr.io/iciclespider/function-pythonic:v0.0.0-20251106175531-78a5b0cd1b50
199+
# package: ghcr.io/iciclespider/function-pythonic:v0.0.0-20251204014512-08165a015bbf
196200
# package: ghcr.io/fortra/function-pythonic:v0.0.0-20250819201108-49cfb066579f
197-
# package: ghcr.io/fortra/function-pythonic:v0.1.3
201+
# package: ghcr.io/fortra/function-pythonic:v0.1.4
198202

199203
kubectl apply -f - <<EOF
200204
apiVersion: pkg.crossplane.io/v1
201205
kind: Function
202206
metadata:
203207
name: function-pythonic
204208
spec:
205-
package: ghcr.io/fortra/function-pythonic:v0.1.3
209+
package: ghcr.io/fortra/function-pythonic:v0.1.4
206210
runtimeConfigRef:
207211
apiVersion: pkg.crossplane.io/v1beta1
208212
kind: DeploymentRuntimeConfig

0 commit comments

Comments
 (0)