fix: honor explicit pipeline config when no workloads exist in Kubernetes app#6551
Open
mihir-dixit2k27 wants to merge 1 commit intopipe-cd:masterfrom
Open
Conversation
…apps When a Kubernetes application contains only ConfigMaps (no Deployments or other workloads), decideStrategy() was immediately returning QUICK_SYNC because findWorkloadManifests() found nothing to inspect. This caused the pipeline defined in app.pipecd.yaml to be silently ignored. Fix: pass pipelineDefined bool to decideStrategy(). When the user has explicitly configured a pipeline and no workloads are found, use progressive sync instead of falling back to QUICK_SYNC. Also added unit tests covering: - ConfigMap-only app with pipeline defined -> progressive sync - ConfigMap-only app without pipeline defined -> QUICK_SYNC (no regression) Fixes: pipe-cd#4799 Signed-off-by: Mihir Dixit <dixitmihir1@gmail.com>
2d02121 to
d8a6188
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does:
Updates the
decideStrategyfunction in the Kubernetes planner to accept apipelineDefinedparameter. When a pipeline is explicitly configured inapp.pipecd.yaml, the planner now respects that configuration and triggers a progressive sync — even when the application contains no workload manifests (e.g., ConfigMap-only apps).Why we need it:
Previously, the planner determined sync strategy purely based on workload detection. If no workloads (Deployments, etc.) were found, it unconditionally fell through to QUICK_SYNC, silently ignoring any pipeline defined by the user in
app.pipecd.yaml. This made it impossible to use pipeline-based deployments for apps that only manage ConfigMaps or similar non-workload resources.Which issue(s) this PR fixes:
Fixes #4799
Does this PR introduce a user-facing change?:
Yes.
pipelinedefined inapp.pipecd.yamlwill now correctly trigger a progressive sync instead of always falling back to QUICK_SYNC.decideStrategylogic is preserved — thepipelineDefinedcheck only activates when the user has explicitly defined pipeline stages.