mirror of
https://github.com/outbackdingo/cozystack.git
synced 2026-01-27 18:18:41 +00:00
[platform] fix deleting bundles
Signed-off-by: kklinch0 <kklinch0@gmail.com>
This commit is contained in:
@@ -30,6 +30,7 @@ FROM alpine:3.21
|
||||
|
||||
RUN apk add --no-cache make
|
||||
RUN apk add helm kubectl --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
|
||||
RUN apk add yq
|
||||
|
||||
COPY scripts /cozystack/scripts
|
||||
COPY --from=builder /src/packages/core /cozystack/packages/core
|
||||
|
||||
@@ -7,7 +7,18 @@ show:
|
||||
helm template -n $(NAMESPACE) $(NAME) . --dry-run=server $(API_VERSIONS_FLAGS)
|
||||
|
||||
apply:
|
||||
helm template -n $(NAMESPACE) $(NAME) . --dry-run=server $(API_VERSIONS_FLAGS) | kubectl apply -f-
|
||||
@echo "Applying active HelmReleases..."
|
||||
helm template -n $(NAMESPACE) $(NAME) . --dry-run=server \
|
||||
| yq 'select(.metadata.annotations."cozystack.io/marked-for-deletion" != "true")' - \
|
||||
| kubectl apply -f-
|
||||
|
||||
delete:
|
||||
@echo "Deleting marked-for-deletion HelmReleases..."
|
||||
helm template -n $(NAMESPACE) $(NAME) . --dry-run=server \
|
||||
| yq 'select(.metadata.annotations."cozystack.io/marked-for-deletion" == "true")' - \
|
||||
| kubectl delete -f - --ignore-not-found=true
|
||||
|
||||
reconcile: apply delete
|
||||
|
||||
namespaces-show:
|
||||
helm template -n $(NAMESPACE) $(NAME) . --dry-run=server $(API_VERSIONS_FLAGS) -s templates/namespaces.yaml
|
||||
|
||||
@@ -80,3 +80,21 @@ spec:
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- range $name := $disabledComponents }}
|
||||
{{- if ne $name "" }}
|
||||
---
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: {{ $name }}
|
||||
namespace: {{ index $dependencyNamespaces $name | default "cozy-system" }}
|
||||
annotations:
|
||||
cozystack.io/marked-for-deletion: "true"
|
||||
labels:
|
||||
cozystack.io/repository: system
|
||||
cozystack.io/system-app: "true"
|
||||
spec:
|
||||
suspend: true
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
@@ -70,7 +70,7 @@ make -C packages/core/platform namespaces-apply
|
||||
ensure_fluxcd
|
||||
|
||||
# Install platform chart
|
||||
make -C packages/core/platform apply
|
||||
make -C packages/core/platform reconcile
|
||||
|
||||
# Install basic charts
|
||||
if ! flux_is_ok; then
|
||||
@@ -93,5 +93,5 @@ done
|
||||
trap 'exit' INT TERM
|
||||
while true; do
|
||||
sleep 60 & wait
|
||||
make -C packages/core/platform apply
|
||||
make -C packages/core/platform reconcile
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user