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: correct pod names for inline templates. Fixes #12895 #12928

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AlbeeSo
Copy link
Contributor

@AlbeeSo AlbeeSo commented Apr 11, 2024

Fixes #12895

Motivation

if !strings.Contains(nodeName, ".inline") {

inline-cant-show-errors-9ptb9--3016472844   0/2     Error       0               25h
inline-cant-show-errors-9ptb9--3942528235   0/2     Completed   0               25h

Incorrect pod names of inline templates will lead to empty UI logs problem.

Modifications

Verification

Test with the workflow mentioned in issue, got result like image post below:
image

@shuangkun shuangkun closed this Apr 12, 2024
@shuangkun shuangkun reopened this Apr 12, 2024
Copy link
Member

@terrytangyuan terrytangyuan left a comment

Choose a reason for hiding this comment

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

Can you add a test?

@shuangkun shuangkun self-assigned this Apr 15, 2024
@shuangkun shuangkun added the area/controller Controller issues, panics label Apr 15, 2024
@agilgur5 agilgur5 linked an issue Apr 18, 2024 that may be closed by this pull request
4 tasks
@agilgur5 agilgur5 changed the title fix: incorrect pod names of inline templates leading to empty UI logs. Fixes #12895 fix: correct pod names for inline templates. Fixes #12895 Apr 22, 2024
@agilgur5
Copy link
Member

agilgur5 commented Apr 22, 2024

I see the UI logic for pod names has diverged a bit -- #7605 added a templateName !== '' check to the UI but not the back-end (and the conditional was subtly changed in #11016 too). This looks vaguely correct based on that, but the UI seems to have no check for inline templates? Conversely, #10921 added the inline check to the back-end but not the UI?

This logic could perhaps be simplified to just templateName != "" and the inline check removed?

Comment on lines +60 to 61
if !strings.Contains(nodeName, ".inline") && templateName != "" {
prefix = fmt.Sprintf("%s-%s", workflowName, templateName)
Copy link
Member

@agilgur5 agilgur5 Apr 22, 2024

Choose a reason for hiding this comment

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

Suggested change
if !strings.Contains(nodeName, ".inline") && templateName != "" {
prefix = fmt.Sprintf("%s-%s", workflowName, templateName)
if templateName != "" {
prefix = fmt.Sprintf("%s-%s", prefix, templateName)

confirmed that this works and will match the UI as well -- see also #12964 .
an inline template will have no templateName, so it is equivalent to the previous logic.

also changed the prefix assignment a bit to simplify it

Screenshot using the Workflow from the issue:
Screenshot 2024-04-22 at 12 17 24 PM

@agilgur5 agilgur5 added the problem/more information needed Not enough information has been provide to diagnose this issue. label May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/controller Controller issues, panics area/server problem/more information needed Not enough information has been provide to diagnose this issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inline templates still do not create the pod name correctly Inline Workflows logs in UI always empty
4 participants