Skip to content
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

fix(ui): Use proper podname for containersets. Fixes #13038 #13039

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

instauro
Copy link

@instauro instauro commented May 12, 2024

Fixes #13038

Motivation

Containerset nodes currently do not retrieve their logs in the UI. This is due to the podname calculation failing, which makes the request to the backend incorrect. This fix will hopefully become obsolete when #12528 is fixed, but until then this should do the trick.

Modifications

Uses a better podname when the node type is Container.
image
image

Verification

Tried a few different containerset templates to verify the fix, and a few none-containetset templates to verify that there is no regression.

@instauro instauro marked this pull request as ready for review May 12, 2024 12:13
@agilgur5 agilgur5 changed the title fix: Use proper podname for containersets. Fixes #13038 fix(ui): Use proper podname for containersets. Fixes #13038 May 12, 2024
@@ -19,7 +19,8 @@ export function getPodName(workflow: Workflow, node: NodeStatus): string {
}

const workflowName = workflow.metadata.name;
if (workflowName === node.name) {
const podNodeName = node.type == 'Container' ? node.name.replace(/\.[^/.]+$/, '') : node.name;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm this doesn't seem to match the back-end. these two functions should be equivalent per the comment on line 14 in this file

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, reverted the change and moved it outside the function call. Maybe there are still better ways to do this

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great if you could locate where in the back-end this gets set, that way we can keep them equivalent, whether in this function or elsewhere.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the pod is created based on the pod node name.
https://github.com/argoproj/argo-workflows/blob/main/workflow/controller/container_set_template.go#L20-L24

Then the containerset nodes are created
https://github.com/argoproj/argo-workflows/blob/main/workflow/controller/container_set_template.go#L31-L46
Where the container node names are just their pod node name concatenated with the container name.

ctxNodeName := fmt.Sprintf("%s.%s", nodeName, c.Name)

So removing this postfix should map from containerset node name to pod node name, which can be used to calculate the pod name using the existing function.

@instauro instauro force-pushed the fix/containerset-podname branch 2 times, most recently from cd6e0fd to 495f907 Compare May 12, 2024 19:14
@agilgur5 agilgur5 self-assigned this May 14, 2024
@instauro instauro force-pushed the fix/containerset-podname branch 3 times, most recently from 8447e69 to 5bd55eb Compare May 14, 2024 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI: Containerset nodes receive the wrong podname
2 participants