fluxcd / flux2

Open and extensible continuous delivery solution for Kubernetes. Powered by GitOps Toolkit.
https://fluxcd.io
Apache License 2.0
6.58k stars 609 forks source link

Pre/post-deployment jobs using dependsOn don't seem to work as documented #5076

Open georgek opened 1 week ago

georgek commented 1 week ago

Describe the bug

Following the docs here: https://fluxcd.io/flux/use-cases/running-jobs/

It seems that when these resources are updated it can happen that deploy gets run before pre-deploy, because pre-deploy was already ready from a previous run.

Steps to reproduce

  1. Follow the docs here: https://fluxcd.io/flux/use-cases/running-jobs/
  2. Upgrade the Kustomizations (e.g. to a new image version),
  3. Repeat until you observe the deploy being run before the pre-deploy.

Expected behavior

deploy waits for pre-deploy.

Screenshots and recordings

No response

OS / Distro

N/A

Flux version

2.4.0

Flux check

► checking prerequisites ✔ Kubernetes 1.30.6+k3s1 >=1.28.0-0 ► checking version in cluster ✔ distribution: flux-v2.4.0 ✔ bootstrapped: true ► checking controllers ✔ helm-controller: deployment ready ► ghcr.io/fluxcd/helm-controller:v1.1.0 ✔ kustomize-controller: deployment ready ► ghcr.io/fluxcd/kustomize-controller:v1.4.0 ✔ notification-controller: deployment ready ► ghcr.io/fluxcd/notification-controller:v1.4.0 ✔ source-controller: deployment ready ► ghcr.io/fluxcd/source-controller:v1.4.1 ► checking crds ✔ alerts.notification.toolkit.fluxcd.io/v1beta3 ✔ buckets.source.toolkit.fluxcd.io/v1 ✔ gitrepositories.source.toolkit.fluxcd.io/v1 ✔ helmcharts.source.toolkit.fluxcd.io/v1 ✔ helmreleases.helm.toolkit.fluxcd.io/v2 ✔ helmrepositories.source.toolkit.fluxcd.io/v1 ✔ kustomizations.kustomize.toolkit.fluxcd.io/v1 ✔ ocirepositories.source.toolkit.fluxcd.io/v1beta2 ✔ providers.notification.toolkit.fluxcd.io/v1beta3 ✔ receivers.notification.toolkit.fluxcd.io/v1 ✔ all checks passed

Git provider

No response

Container Registry provider

No response

Additional context

No response

Code of Conduct