Skip to content

fix(cli): devops argo workflows logs finds no pod and names no container on a real argo install #988

Description

@dan-petty

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 wait container and a main container, and argo.py:454 names 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) and v2 (<workflow>-<templateName>-<hash of the node ID>), from the node's templateName and ID in the workflow status. Pods that were never created (skipped or omitted nodes) are left out.
  • Container. The read names the main container by default. --container selects 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 ci passes.

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 includes container="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 logs prints 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 ci command 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.

Activity

  1. added
    type/bug
    scope/k8s
    priority/p2-medium
    on Oct 2, 2026
  2. added this to the milestone on Oct 20, 2026
  3. dan-petty commented on Oct 20, 2026

    @dan-petty
    OwnerAuthor

    Status set to Ready at 2954109 (see proposed design in issue body).

  4. removed this from the milestone on Oct 23, 2026
  5. added a commit that references this issue on Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p2-mediumscope/k8stype/bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions