Repository navigation
Description
Problem
devops argo workflows logs <workflow> cannot read logs from a real Argo Workflows install. Two problems stop it before any log is read. Both were found while refining #864 on 2026-10-02.
- Node IDs are not pod names.
workflow_pod_names(src/devops_cli/argo/crd.py:286-296) returns the workflow's node IDs. Since v3.4, Argo's default pod naming (POD_NAMES=v2) is<workflow>-<template>-<hash>, so the pod read returns 404. - No container is named. Argo workflow pods run a
waitcontainer and amaincontainer, andargo.py:454names neither. The API server answers 400 ("a container name must be specified").
Both argo log tests mock a workflow with "nodes": {} (tests/test_argo.py:192, 297), so neither reaches the log loop. #864 fixes how the loop writes lines and stays on mocks.
Acceptance criteria
- Pod names. They are derived the way Argo does under both
POD_NAMES=v1(the node ID) andv2(<workflow>-<templateName>-<hash of the node ID>), from the node'stemplateNameand ID in the workflow status. Pods that were never created (skipped or omitted nodes) are left out. - Container. The read names the
maincontainer by default.--containerselects another one. - Tests. Offline: a recorded workflow status with Pod nodes under each naming mode gives the expected pod names, and the log read is called with
container="main". A Steps or DAG workflow with skipped nodes reads only the pods that ran. - Person-run check. On the homelab cluster,
devops argo workflows logs <a finished workflow>prints its main container's log. uv run devops cipasses.
Key questions
- Can the CLI tell which naming mode the controller uses? From the workflow-controller ConfigMap, or by trying v2 then v1 on a 404 (proposed: try v2, then v1; it needs no extra RBAC).
Related: #864 (line handling of the same command).
Proposed design
Problem statement
The devops argo workflows logs command fails to retrieve logs from a real Argo Workflows installation due to two issues: 1) pod names are incorrectly derived from node IDs instead of following Argo's actual naming conventions (POD_NAMES=v1 or v2), and 2) the command does not specify a container name, causing the API server to reject requests with a 400 error.
Acceptance criteria
- Criterion 1: Pod names are correctly derived based on Argo's naming mode (v1 or v2) from the workflow status.
Verification: Run tests that mock workflows with different pod naming modes and verify expected pod names are returned. - Criterion 2: The log reading function names the 'main' container by default, or another specified container when --container is used.
Verification: Verify that the log read call includescontainer="main"by default and allows override via --container flag. - Criterion 3: Offline tests with recorded workflow statuses validate correct pod name derivation and container usage.
Verification: Execute offline test cases using recorded workflow data to confirm pod names match Argo's behavior under both naming modes and that logs are read with the correct container. - Criterion 4: On a real cluster,
devops argo workflows logsprints the main container's log.
Verification: Execute the command on a finished workflow in a homelab cluster and confirm it outputs the expected log content. - Criterion 5: The
uv run devops cicommand passes after implementing the fix.
Verification: Run the full CI suite and ensure all checks pass without failures related to this issue.
Key questions
- Can the CLI tell which naming mode the controller uses?: Yes, by trying v2 naming first, then falling back to v1 on a 404 error. This approach requires no additional RBAC permissions. (proposed)
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsIn Review
Activity
dan-petty commentedon Oct 20, 2026
Status set to Ready at 2954109 (see proposed design in issue body).
chore(main): release 0.4.0 (#1960)