Skip to content

Argo-Workflows UI does not show initContainers in logs dropdown menu, if defined in Workflow Templates #14371

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 of 4 tasks
encigem opened this issue Apr 10, 2025 · 1 comment · May be fixed by #14476
Open
3 of 4 tasks
Labels

Comments

@encigem
Copy link

encigem commented Apr 10, 2025

Pre-requisites

  • I have double-checked my configuration
  • I have tested with the :latest image tag (i.e. quay.io/argoproj/workflow-controller:latest) and can confirm the issue still exists on :latest. If not, I have explained why, in detail, in my description below.
  • I have searched existing issues and could not find a match for this bug
  • I'd like to contribute the fix myself (see contributing guide)

What happened? What did you expect to happen?

I expected the same behavior as when initContainers are defined directly in Workflow YAML files: any containers relating to a particular node/step should be available to select from the dropdown menu as part of the Logs tab.
This is not the case when the initContainer is defined in a Workflow Template, in which case no initContainer options are shown in the dropdown menu.

This issue does not present when initContainers are defined directly as part of a Workflow, but does occur when initContainers are defined in a Workflow Template, instead.

Version(s)

v3.6.5, latest

Paste a minimal workflow that reproduces the issue. We must be able to run the workflow; don't enter a workflow that uses private images.

worflow template:

apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
  name: init-container
spec:
  templates:
    - name: test-init-wft
      container:
        name: alpine
        image: "alpine:latest"
        command:
          - sh
          - -xc
        args:
          - |
            echo "Logs from main container, defined in the WF template YAML."
      initContainers:
        - name: test-init-container
          image: "alpine:latest"
          command:
            - sh
            - -c
          args:
            - |
              echo "Logs from InitContainer, defined directly in WF template YAML."

workflow (utilizes the template):

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: workflow-using-template-
spec:
  entrypoint: call-template
  templates:
  - name: call-template # testing with workflow template
    steps:
    - - name: use-wf-template
        templateRef:
          name: init-container
          template: test-init-wft

Logs from the workflow controller

>>> kubectl logs -n argo deployments/argo-workflow-controller | grep workflow-using-template-6jpzh
time="2025-04-10T12:31:56.289Z" level=info msg="Processing workflow" Phase= ResourceVersion=802423638 namespace=project-il workflow=workflow-using-template-6jpzh
time="2025-04-10T12:31:56.308Z" level=info msg="Task-result reconciliation" namespace=project-il numObjs=0 workflow=workflow-using-template-6jpzh
time="2025-04-10T12:31:56.308Z" level=info msg="Updated phase  -> Running" namespace=project-il workflow=workflow-using-template-6jpzh
time="2025-04-10T12:31:56.308Z" level=warning msg="Node was nil, will be initialized as type Skipped" namespace=project-il workflow=workflow-using-template-6jpzh
time="2025-04-10T12:31:56.309Z" level=info msg="was unable to obtain node for , letting display name to be nodeName" namespace=project-il workflow=workflow-using-template-6jpzh
time="2025-04-10T12:31:56.309Z" level=info msg="Steps node workflow-using-template-6jpzh initialized Running" namespace=project-il workflow=workflow-using-template-6jpzh
time="2025-04-10T12:31:56.309Z" level=info msg="StepGroup node workflow-using-template-6jpzh-2279684265 initialized Running" namespace=project-il workflow=workflow-using-template-6jpzh
time="2025-04-10T12:31:56.309Z" level=warning msg="Node was nil, will be initialized as type Skipped" namespace=project-il workflow=workflow-using-template-6jpzh
time="2025-04-10T12:31:56.309Z" level=info msg="Pod node workflow-using-template-6jpzh-1165117175 initialized Pending" namespace=project-il workflow=workflow-using-template-6jpzh
time="2025-04-10T12:31:56Z" level=info msg="add pod event" pod=workflow-using-template-6jpzh-test-init-wft-1165117175
time="2025-04-10T12:31:56.346Z" level=info msg="Created pod: workflow-using-template-6jpzh[0].use-wf-template (workflow-using-template-6jpzh-test-init-wft-1165117175)" namespace=project-il workflow=workflow-using-template-6jpzh
time="2025-04-10T12:31:56.346Z" level=info msg="Workflow step group node workflow-using-template-6jpzh-2279684265 not yet completed" namespace=project-il workflow=workflow-using-template-6jpzh
time="2025-04-10T12:31:56.346Z" level=info msg="TaskSet Reconciliation" namespace=project-il workflow=workflow-using-template-6jpzh
time="2025-04-10T12:31:56.346Z" level=info msg=reconcileAgentPod namespace=project-il workflow=workflow-using-template-6jpzh
time="2025-04-10T12:31:56Z" level=info msg="update pod event" pod=workflow-using-template-6jpzh-test-init-wft-1165117175
time="2025-04-10T12:31:56.364Z" level=info msg="Workflow update successful" namespace=project-il phase=Running resourceVersion=802423642 workflow=workflow-using-template-6jpzh
time="2025-04-10T12:31:56.365Z" level=info msg="Processing workflow" Phase=Running ResourceVersion=802423642 namespace=project-il workflow=workflow-using-template-6jpzh
time="2025-04-10T12:31:56.366Z" level=info msg="Task-result reconciliation" namespace=project-il numObjs=0 workflow=workflow-using-template-6jpzh
time="2025-04-10T12:31:56.367Z" level=info msg="node changed" namespace=project-il new.message= new.phase=Pending new.progress=0/1 nodeID=workflow-using-template-6jpzh-1165117175 old.message= old.phase=Pending old.progress=0/1 workflow=workflow-using-template-6jpzh
time="2025-04-10T12:31:56.367Z" level=info msg="Workflow step group node workflow-using-template-6jpzh-2279684265 not yet completed" namespace=project-il workflow=workflow-using-template-6jpzh
time="2025-04-10T12:31:56.367Z" level=info msg="TaskSet Reconciliation" namespace=project-il workflow=workflow-using-template-6jpzh
time="2025-04-10T12:31:56.367Z" level=info msg=reconcileAgentPod namespace=project-il workflow=workflow-using-template-6jpzh
time="2025-04-10T12:31:56.389Z" level=info msg="Workflow update successful" namespace=project-il phase=Running resourceVersion=802423645 workflow=workflow-using-template-6jpzh
time="2025-04-10T12:31:56.390Z" level=info msg="Processing workflow" Phase=Running ResourceVersion=802423645 namespace=project-il workflow=workflow-using-template-6jpzh
time="2025-04-10T12:31:56.390Z" level=info msg="Task-result reconciliation" namespace=project-il numObjs=0 workflow=workflow-using-template-6jpzh
time="2025-04-10T12:31:56.391Z" level=info msg="node unchanged" namespace=project-il nodeID=workflow-using-template-6jpzh-1165117175 workflow=workflow-using-template-6jpzh
time="2025-04-10T12:31:56Z" level=info msg="update pod event" pod=workflow-using-template-6jpzh-test-init-wft-1165117175
time="2025-04-10T12:31:56.393Z" level=info msg="Workflow step group node workflow-using-template-6jpzh-2279684265 not yet completed" namespace=project-il workflow=workflow-using-template-6jpzh
time="2025-04-10T12:31:56.393Z" level=info msg="TaskSet Reconciliation" namespace=project-il workflow=workflow-using-template-6jpzh
time="2025-04-10T12:31:56.393Z" level=info msg=reconcileAgentPod namespace=project-il workflow=workflow-using-template-6jpzh
time="2025-04-10T12:31:57Z" level=info msg="update pod event" pod=workflow-using-template-6jpzh-test-init-wft-1165117175
time="2025-04-10T12:31:57Z" level=info msg="update pod event" pod=workflow-using-template-6jpzh-test-init-wft-1165117175
time="2025-04-10T12:31:58Z" level=info msg="update pod event" pod=workflow-using-template-6jpzh-test-init-wft-1165117175
time="2025-04-10T12:31:59Z" level=info msg="update pod event" pod=workflow-using-template-6jpzh-test-init-wft-1165117175
time="2025-04-10T12:32:00Z" level=info msg="update pod event" pod=workflow-using-template-6jpzh-test-init-wft-1165117175
time="2025-04-10T12:32:01Z" level=info msg="update pod event" pod=workflow-using-template-6jpzh-test-init-wft-1165117175
time="2025-04-10T12:32:02Z" level=info msg="update pod event" pod=workflow-using-template-6jpzh-test-init-wft-1165117175
time="2025-04-10T12:32:03Z" level=info msg="update pod event" pod=workflow-using-template-6jpzh-test-init-wft-1165117175
time="2025-04-10T12:32:04Z" level=info msg="update pod event" pod=workflow-using-template-6jpzh-test-init-wft-1165117175
time="2025-04-10T12:32:06.346Z" level=info msg="Processing workflow" Phase=Running ResourceVersion=802423645 namespace=project-il workflow=workflow-using-template-6jpzh
time="2025-04-10T12:32:06.347Z" level=info msg="Task-result reconciliation" namespace=project-il numObjs=1 workflow=workflow-using-template-6jpzh
time="2025-04-10T12:32:06.347Z" level=info msg="task-result changed" namespace=project-il nodeID=workflow-using-template-6jpzh-1165117175 workflow=workflow-using-template-6jpzh
time="2025-04-10T12:32:06.347Z" level=info msg="node changed" namespace=project-il new.message= new.phase=Succeeded new.progress=0/1 nodeID=workflow-using-template-6jpzh-1165117175 old.message= old.phase=Pending old.progress=0/1 workflow=workflow-using-template-6jpzh
time="2025-04-10T12:32:06.347Z" level=info msg="Step group node workflow-using-template-6jpzh-2279684265 successful" namespace=project-il workflow=workflow-using-template-6jpzh
time="2025-04-10T12:32:06.347Z" level=info msg="node workflow-using-template-6jpzh-2279684265 phase Running -> Succeeded" namespace=project-il workflow=workflow-using-template-6jpzh
time="2025-04-10T12:32:06.347Z" level=info msg="node workflow-using-template-6jpzh-2279684265 finished: 2025-04-10 12:32:06.34789352 +0000 UTC" namespace=project-il workflow=workflow-using-template-6jpzh
time="2025-04-10T12:32:06.347Z" level=info msg="Outbound nodes of workflow-using-template-6jpzh-1165117175 is [workflow-using-template-6jpzh-1165117175]" namespace=project-il workflow=workflow-using-template-6jpzh
time="2025-04-10T12:32:06.347Z" level=info msg="Outbound nodes of workflow-using-template-6jpzh is [workflow-using-template-6jpzh-1165117175]" namespace=project-il workflow=workflow-using-template-6jpzh
time="2025-04-10T12:32:06.348Z" level=info msg="node workflow-using-template-6jpzh phase Running -> Succeeded" namespace=project-il workflow=workflow-using-template-6jpzh
time="2025-04-10T12:32:06.348Z" level=info msg="node workflow-using-template-6jpzh finished: 2025-04-10 12:32:06.348013455 +0000 UTC" namespace=project-il workflow=workflow-using-template-6jpzh
time="2025-04-10T12:32:06.348Z" level=info msg="TaskSet Reconciliation" namespace=project-il workflow=workflow-using-template-6jpzh
time="2025-04-10T12:32:06.348Z" level=info msg=reconcileAgentPod namespace=project-il workflow=workflow-using-template-6jpzh
time="2025-04-10T12:32:06.348Z" level=info msg="Updated phase Running -> Succeeded" namespace=project-il workflow=workflow-using-template-6jpzh
time="2025-04-10T12:32:06.348Z" level=info msg="Marking workflow completed" namespace=project-il workflow=workflow-using-template-6jpzh
time="2025-04-10T12:32:06.370Z" level=info msg="Workflow update successful" namespace=project-il phase=Succeeded resourceVersion=802423758 workflow=workflow-using-template-6jpzh
time="2025-04-10T12:32:06.371Z" level=info msg="Queueing Succeeded workflow project-il/workflow-using-template-6jpzh for delete in 240h0m0s due to TTL"
time="2025-04-10T12:32:06Z" level=info msg="queueing pod for cleanup after" action=deletePod after=1h0m0s namespace=project-il podName=workflow-using-template-6jpzh-test-init-wft-1165117175
time="2025-04-10T12:32:06Z" level=info msg="queueing pod for cleanup" action=removeFinalizer namespace=project-il podName=workflow-using-template-6jpzh-test-init-wft-1165117175
time="2025-04-10T12:32:06Z" level=info msg="cleaning up pod" action=removeFinalizer key=project-il/workflow-using-template-6jpzh-test-init-wft-1165117175/removeFinalizer namespace=project-il podName=workflow-using-template-6jpzh-test-init-wft-1165117175
time="2025-04-10T12:32:06Z" level=info msg="insignificant pod change" key=project-il/workflow-using-template-6jpzh-test-init-wft-1165117175
time="2025-04-10T12:52:41.344Z" level=info msg="Queueing Succeeded workflow project-il/workflow-using-template-6jpzh for delete in 239h39m25s due to TTL"
time="2025-04-10T13:12:41.339Z" level=info msg="Queueing Succeeded workflow project-il/workflow-using-template-6jpzh for delete in 239h19m25s due to TTL"

Logs from in your workflow's wait container

>>> kubectl logs -n project-il -c wait -l workflows.argoproj.io/workflow=workflow-using-template-6jpzh
time="2025-04-10T12:32:01.469Z" level=info msg="No Script output reference in workflow. Capturing script output ignored"
time="2025-04-10T12:32:01.469Z" level=info msg="No output parameters"
time="2025-04-10T12:32:01.469Z" level=info msg="No output artifacts"
time="2025-04-10T12:32:01.469Z" level=info msg="S3 Save path: /tmp/argo/outputs/logs/main.log, key: artifacts/2025/04/10/workflow-using-template-6jpzh/workflow-using-template-6jpzh-test-init-wft-1165117175/main.log"
time="2025-04-10T12:32:01.470Z" level=info msg="Creating minio client using static credentials" endpoint="aws3obj.company.com:10444"
time="2025-04-10T12:32:01.470Z" level=info msg="Saving file to s3" bucket=projectdev-moore030 endpoint="aws3obj.company.com:10444" key=artifacts/2025/04/10/workflow-using-template-6jpzh/workflow-using-template-6jpzh-test-init-wft-1165117175/main.log path=/tmp/argo/outputs/logs/main.log
time="2025-04-10T12:32:01.547Z" level=info msg="Save artifact" artifactName=main-logs duration=77.471494ms error="<nil>" key=artifacts/2025/04/10/workflow-using-template-6jpzh/workflow-using-template-6jpzh-test-init-wft-1165117175/main.log
time="2025-04-10T12:32:01.547Z" level=info msg="not deleting local artifact" localArtPath=/tmp/argo/outputs/logs/main.log
time="2025-04-10T12:32:01.547Z" level=info msg="Successfully saved file: /tmp/argo/outputs/logs/main.log"
time="2025-04-10T12:32:01.592Z" level=info msg="Alloc=10159 TotalAlloc=17482 Sys=22613 NumGC=4 Goroutines=10"
@encigem
Copy link
Author

encigem commented Apr 10, 2025

UI when defining initContainers directly in Workflow:

Image

UI when defining initContainers in Workflow Template:

Image
The init containers are missing from the dropdown list in Logs tab. (but as a workaround, i can manually type a hidden container name into the box to retrieve the logs for that container)

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 a pull request may close this issue.

1 participant