Skip to content

fix: honor explicit pipeline config when no workloads exist in Kubernetes app#6551

Open
mihir-dixit2k27 wants to merge 1 commit intopipe-cd:masterfrom
mihir-dixit2k27:fix/k8s-configmap-pipeline-strategy
Open

fix: honor explicit pipeline config when no workloads exist in Kubernetes app#6551
mihir-dixit2k27 wants to merge 1 commit intopipe-cd:masterfrom
mihir-dixit2k27:fix/k8s-configmap-pipeline-strategy

Conversation

@mihir-dixit2k27
Copy link

What this PR does:

Updates the decideStrategy function in the Kubernetes planner to accept a pipelineDefined parameter. When a pipeline is explicitly configured in app.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.

  • How are users affected by this change: Kubernetes applications that contain only ConfigMaps (or other non-workload resources) and have a pipeline defined in app.pipecd.yaml will now correctly trigger a progressive sync instead of always falling back to QUICK_SYNC.
  • Is this breaking change: No. Existing apps without a pipeline configured retain identical behavior. All prior decideStrategy logic is preserved — the pipelineDefined check only activates when the user has explicitly defined pipeline stages.
  • How to migrate (if breaking change): N/A

…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>
@mihir-dixit2k27 mihir-dixit2k27 requested a review from a team as a code owner February 28, 2026 09:15
@mihir-dixit2k27 mihir-dixit2k27 changed the title fix: respect pipeline config in Kubernetes planner for workload-less fix: honor explicit pipeline config when no workloads exist in Kubernetes app Feb 28, 2026
@mihir-dixit2k27 mihir-dixit2k27 force-pushed the fix/k8s-configmap-pipeline-strategy branch from 2d02121 to d8a6188 Compare March 3, 2026 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

K8s App kind with only ConfigMap can only trigger QUICK_SYNC

1 participant