Repository navigation
Closed
Labels
scope/k8sKubernetes commands, Helm charts, pods, services, and policiessource/agentFiled by an agenttype/bugType bug: the code does not do what it must
Description
Problem
Lines cited at 05e9388 (release/v0.2.29).
- Sync drops its options.
- Three callers POST
{"sync": {"prune": ..., "force": ...}}to/api/v1/applications/{name}/sync:devops argo sync(commands/argo.py:256-262), the fleet sync (argo/fleet.py:57) and the GitOps trigger (argo/gitops.py:311). - Argo CD's
ApplicationSyncRequesthas nosyncfield. Prune is a top-level field and force isstrategy.apply.force, so neither option reaches the sync.
- Three callers POST
- Promote and abort change nothing.
promote_rolloutandabort_rollout(argo/crd.py:215-240) send a{"status": ...}merge patch throughpatch_namespaced_custom_object(:128).- The Rollout CRD declares a status subresource, so the API server ignores
.statuson the main resource. _mutate_rolloutstill returnsTrue(argo/rollouts.py:70-75), and the metric gate then reportsaborted(:167-169).
- Teardown's safety check fails open.
_is_cluster_argo_managed(commands/k8s/stack_lifecycle.py:536-545) runskubectl -n argocd get application clusterwithout-oand tests"cluster" in stdout.- It returns
Falseon any non-zero exit. A timeout, an RBAC denial or an API error therefore letsteardownproceed (:1209).
Proposed remedy
- Sync body. One request-body builder for the three sync callers:
{"prune": prune, "strategy": {"apply": {"force": force}}}, plusappNamespacewhere it is sent today. - Rollouts. Promote and abort patch through
patch_namespaced_custom_object_status. Promote also clearsspec.pausedwhen it is set, askubectl argo rollouts promotedoes. - Teardown check. It reads the Application through
ArgoCRDService(CustomObjectsApi).- 404 means the cluster is not managed by Argo CD.
- Any other error refuses teardown and states the reason.
Acceptance criteria
- For each of the three sync paths, the body recorded at the HTTP fake has a top-level
pruneandstrategy.apply.force, and nosynckey. - Promote and abort reach the status subresource in refactor(k8s): KubernetesService is the Kubernetes API seam, with a shared fake cluster and its contract suite #1315's fake cluster.
- A refused patch makes
_mutate_rolloutreport failure, and the gate reportsabort_failed. - A 404 for the
clusterApplication allows teardown. - A 403, a timeout or a 500 stops teardown with an error.
- Tests run offline with fakes only at process and HTTP edges; each new test runs under 1 s.
-
uv run devops cipasses.
Related: #1327 and #1335 (these clients move onto the egress factory), #1315, #1323, #755.
Found by the 2026-10-08 client-library audit.
Opened as a borrow (#1153, budget/borrowed): the agent filing quota is spent for this cycle, and this is a defect or security finding of the owner-requested 2026-10-08 client-library audit.
Metadata
Metadata
Assignees
Labels
scope/k8sKubernetes commands, Helm charts, pods, services, and policiessource/agentFiled by an agenttype/bugType bug: the code does not do what it must
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty-bot commentedon Oct 8, 2026
Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.
The teardown fail-open could allow unintended cluster teardown on transient errors, and sync/rollout options silently no-op, but each requires a specific error path or user action to manifest.Three core Argo CD operations (sync with prune/force, rollout promote/abort, and teardown safety) are broken, directly undermining the reliability of the cluster management workflow.Three distinct fixes across five-plus files with a clear proposed remedy for each, plus tests at process and HTTP edges, but no architectural change.fix(k8s): argo cd sync honours --prune and --force, rollout promote a…