-
Notifications
You must be signed in to change notification settings - Fork 26
Description
Version
werf 1.2.296+
Issue
werf converge suddenly starts producing errors like this:
Error: error building deploy plan: error connecting internal dependencies: error adding dependency: error adding edge from "update/default::ConfigMap:mycm" to "recreate/default:batch:Job:myjob": edge would create a cycle
Reason
New deployment engine (Nelm), activated by default since v1.2.296, cannot ignore mistakes made in your charts that result in the wrong deployment order of your resources. For example, if you have a Job with helm.sh/hook: pre-upgrade that mounts a ConfigMap, but the ConfigMap is a non-hook resource, then your deployment order will be Job > ConfigMap, but it must be vice versa. In the old deployment engine the resources will still be applied in this (wrong) order, but in the new deployment engine this would create a cycle in the underlying graph.
Mitigation
These errors indicate resource ordering mistakes made in resource manifests in your chart. Fixing the order of resources in your chart is the correct solution. Just make sure, that the resource that you depend on (e.g. ConfigMap) is deployed at the same "stage" as the resource with a dependency (e.g. Job), or at an earlier stage. helm.sh/hook and helm.sh/weight or werf.io/weight annotations will help you with that.
Alternatively, you can temporarily revert back to the old engine by export WERF_NELM=0.