[installer] Update cozypkg and improve migration 20

This patch makes sure that migration #20 really uses the very latest
chart versions by forcing a reconcile with cozypkg, instead of
annotating the underlying HelmRelease.

```release-note
[installer] Update cozypkg in installer and use it to bulletproof the
20th migration script by reconciling the HelmReleases with the
--with-source flag.
```

Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
This commit is contained in:
Timofei Larkin
2025-09-25 11:10:13 +03:00
parent 21ca1349c4
commit 0f8a9ac9ef
2 changed files with 5 additions and 8 deletions

View File

@@ -32,7 +32,7 @@ RUN make repos
FROM alpine:3.22
RUN wget -O- https://github.com/cozystack/cozypkg/raw/refs/heads/main/hack/install.sh | sh -s -- -v 1.1.0
RUN wget -O- https://github.com/cozystack/cozypkg/raw/refs/heads/main/hack/install.sh | sh -s -- -v 1.2.0
RUN apk add --no-cache make kubectl coreutils git jq

View File

@@ -9,13 +9,10 @@ kubectl delete crd cozystackresourcedefinitions.cozystack.io --ignore-not-found
timestamp=$(date --rfc-3339=ns)
# Make sure webhook is upgraded first, then run migration
if kubectl get helmrelease cozystack-controller -n cozy-system; then
kubectl annotate helmrelease cozystack-controller -n cozy-system \
reconcile.fluxcd.io/forceAt="$timestamp" \
reconcile.fluxcd.io/requestedAt="$timestamp" \
--overwrite
kubectl wait hr/cozystack-controller -n cozy-system --timeout=4m --for=condition=ready || exit 1
fi
cozypkg -C packages/system/cozystack-controller -n cozy-system reconcile cozystack-controller --force --with-source
kubectl wait hr/cozystack-controller -n cozy-system --timeout=4m --for=condition=ready || exit 1
cozypkg -C packages/system/cozystack-api -n cozy-system reconcile cozystack-api --force --with-source
kubectl wait hr/cozystack-api -n cozy-system --timeout=4m --for=condition=ready || exit 1
kubectl get namespace -o custom-columns=NAME:.metadata.name --no-headers |
grep '^tenant-' |
while read namespace ; do