Skip to content

Conversation

manno
Copy link
Member

@manno manno commented Aug 22, 2025

Also allows atomic flag for install, not just update.

Notes

Get a chart into pending install:

fleet apply -o timeout-frab-bundle.yaml test ../../frab/helm/frab
fleet target -b timeout-frab-bundle.yaml > timeout-frab-bundledeployment.yaml
fleet deploy -i timeout-frab-bundledeployment.yaml
# hit ctrl-c while the helm hooks run

If the timing is right, this results in a helm chart that is in pending-install:

apiVersion: v1
data:
  release: [...blob...]
kind: Secret
metadata:
  labels:
    name: frab-helm-frab-02710957
    owner: helm
    status: pending-install
    version: "1"
  name: sh.helm.release.v1.frab-helm-frab-02710957.v1
  namespace: default
type: helm.sh/release.v1

Another deploy results in:

% fleet deploy  -i timeout-frab-bundledeployment.yaml                                                                                                                                                                    
2025-08-22T14:34:59+02:00	INFO	helm-deployer.install	Installing helm release	{"commit": "", "dryRun": false}
FATA[0000] cannot re-use a name that is still in use

Now we can try this PR:

% go run ./cmd/fleetcli/main.go  deploy  -i timeout-frab-bundledeployment.yaml                                                                                                                                           
2025-08-22T14:36:00+02:00	INFO	helm-deployer.install	Uninstalling helm release first	{"commit": "", "dryRun": true}
2025-08-22T14:36:00+02:00	INFO	helm-deployer.install	Uninstalling helm release first	{"commit": "", "dryRun": false}
2025-08-22T14:36:00+02:00	INFO	helm-deployer.delete	Helm: Uninstalling	{"dryRun": false}
2025-08-22T14:36:00+02:00	DEBUG	helmSDK	uninstall: Deleting frab-helm-frab-02710957
2025-08-22T14:36:00+02:00	DEBUG	helmSDK	uninstall: given cascade value: , defaulting to delete propagation background
2025-08-22T14:36:00+02:00	DEBUG	helmSDK	purge requested for frab-helm-frab-02710957
2025-08-22T14:36:01+02:00	INFO	helm-deployer.install	Installing helm release	{"commit": "", "dryRun": false}
2025-08-22T14:36:01+02:00	DEBUG	helmSDK	API Version list given outside of client only mode, this list will be ignored
FATA[0000] failed pre-install: context deadline exceeded
exit status 1
go run ./cmd/fleetcli/main.go deploy -i   115,26s user 24,96s system 528% cpu 26,542 total

Still fails, because the chart is missing arm64 images, but we can see the uninstall.

@manno manno changed the title Stuck helm release in pending-install are replaced Stuck helm release in pending-install are replaced (SURE-10627) Aug 22, 2025
@weyfonk weyfonk force-pushed the install-replaces-pending-install branch 2 times, most recently from 5e3860d to a598fe2 Compare August 26, 2025 08:10
@kkaempf kkaempf added this to Fleet Aug 26, 2025
@kkaempf kkaempf moved this to 👀 In review in Fleet Aug 26, 2025
@kkaempf
Copy link
Collaborator

kkaempf commented Aug 26, 2025

See #4049

@weyfonk weyfonk marked this pull request as ready for review August 27, 2025 14:22
@weyfonk weyfonk requested a review from a team as a code owner August 27, 2025 14:22
manno and others added 3 commits August 27, 2025 16:24
Also allows atomic flag for install, not just update.
A new integration test case simulates an existing release with
`pending-install` status, by creating the corresponding Helm secret, as
Fleet uses Helm's secret storage back-end, then validates that Fleet can
install a release with the same name on top of it.
Creating a Helm release secret to simulate a release in
`pending-install` state may fail if the secret has already been created
by another test case installing an actual bundle deployment.
Therefore, the new test case checking for overwrites of
`pending-install` releases deletes that secret if it exists before
creating a new one.
@weyfonk weyfonk merged commit 3c79abb into main Aug 27, 2025
22 checks passed
@weyfonk weyfonk deleted the install-replaces-pending-install branch August 27, 2025 15:11
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Fleet Aug 27, 2025
@kkaempf kkaempf added this to the v2.13.0 milestone Aug 28, 2025
manno added a commit that referenced this pull request Sep 19, 2025
The Helm deployer now honours Helm's `atomic` flag for installs, not just
updates.
It also supports overwriting releases in `pending-install` state, which can
unblock deployments.

A new integration test case simulates an existing release with
`pending-install` status, by creating the corresponding Helm secret, as
Fleet uses Helm's secret storage back-end, then validates that Fleet can
install a release with the same name on top of it.

---------

Co-authored-by: Mario Manno <mario.manno@suse.com>
Co-authored-by: Corentin Néau <tan.neau@suse.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants