mirror of
https://github.com/outbackdingo/cozystack.git
synced 2026-01-27 18:18:41 +00:00
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>
28 lines
1.3 KiB
Bash
Executable File
28 lines
1.3 KiB
Bash
Executable File
#!/bin/sh
|
|
# Migration 20 --> 21
|
|
|
|
set -euo pipefail
|
|
|
|
kubectl delete ingresses.networking.k8s.io --all -n cozy-dashboard --ignore-not-found
|
|
kubectl delete cozystackresourcedefinitions --all-namespaces --all --ignore-not-found
|
|
kubectl delete crd cozystackresourcedefinitions.cozystack.io --ignore-not-found
|
|
|
|
timestamp=$(date --rfc-3339=ns)
|
|
# Make sure webhook is upgraded first, then run migration
|
|
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
|
|
(set -x; \
|
|
kubectl annotate \
|
|
pods,services,pvc,secrets,ingresses.networking.k8s.io,workloadmonitors.cozystack.io \
|
|
-n "$namespace" --all \
|
|
migration.cozystack.io="$timestamp" --overwrite)
|
|
done
|
|
# Stamp version
|
|
kubectl create configmap -n cozy-system cozystack-version \
|
|
--from-literal=version=21 --dry-run=client -o yaml | kubectl apply -f-
|