Skip to content

Releases in the Helm deployer should be cleaned up in reverse order #9837

@BabisK

Description

@BabisK

Expected behavior

skaffold dev removes helm releases in the reverse order compared to installing them.

Actual behavior

skaffold dev removes helm releases in the same order as istalling them.

Information

  • Skaffold version: v2.16.1
  • Operating system: Ubuntu 22.04
  • Installed via: github releases
  • Contents of skaffold.yaml:
apiVersion: skaffold/v4beta13
kind: Config
metadata:
  name: postgresql
deploy:
  helm:
    releases:
      - name: postgres-operator
        chartPath: ../../deploy/helm-charts/infrastructure/postgres-operator
        wait: true
      - name: postgres #Contains a postgresql CR
        chartPath: ../../deploy/helm-charts/infrastructure/postgres
        wait: true
        dependsOn:
          - postgres-operator

Steps to reproduce the behavior

I expect the operator to be installed first and then the custom resource that creates the database instance. On cleanup, the custom resource should be removed first so that the operator can clean up the pods and other resources it created.

❯ skaffold dev
No tags generated
Starting deploy...
Loading images into kind cluster nodes...
Images loaded in 369ns
Helm release postgres-operator not installed. Installing...
NAME: postgres-operator
LAST DEPLOYED: Fri Jun 27 20:21:10 2025
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
To verify that postgres-operator has started, run:

  kubectl --namespace=default get pods -l "app.kubernetes.io/name=postgres-operator"
Helm release postgres not installed. Installing...
NAME: postgres
LAST DEPLOYED: Fri Jun 27 20:21:23 2025
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
PostgreSQL RDBMS installed.
Waiting for deployments to stabilize...
 - deployment/postgres-operator is ready.
Deployments stabilized in 1.136 second
No artifacts found to watch
Press Ctrl+C to exit
Watching for changes...
^CCleaning up...
release "postgres-operator" uninstalled
release "postgres" uninstalled

As the logs indicate, the operator is removed before the CR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions