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

feat(ui): Ignore missing vars in custom links #11164

Merged

Conversation

ehellmann-nydig
Copy link
Contributor

@ehellmann-nydig ehellmann-nydig commented Jun 2, 2023

Motivation

Some workflows have specific context which can help greatly in the logs. This would allow the custom link created to optionally contain values from the workflow. As it stands now, null is returned which messes up the url.

ex: The link can have a url
https://app.datadoghq.com/logs?query=pod_name:${metadata.name}-*&from_ts=${status.startedAtEpoch}&to_ts=${status.finishedAtEpoch}&live=false${workflow.metadta.annotations.additionalLogParams}.
For the workflows that have defined metadata.annotations.additionalLogParams: '&col=service,@client_id' the link will be something like
https://app.datadoghq.com/logs?query=pod_name:mypod-*&from_ts=874654846548764464&to_ts=null&live=false&col=service,12345
and for those that don't have it defined the url will be
https://app.datadoghq.com/logs?query=pod_name:mypod-*&from_ts=874654846548764464&to_ts=null&live=false

Modifications

Updated the UI code responsible for generating the links to return empty strings if the object is source off of workflow during the url interpolation process.
Documentation updated to reflect this.

No visual changes, so no screenshots.

Verification

Added tests

…then the link generated will ignore that field.

Signed-off-by: Eli Hellmann <eli.hellmann@nydig.com>
@ehellmann-nydig ehellmann-nydig marked this pull request as ready for review June 2, 2023 21:58
@ehellmann-nydig
Copy link
Contributor Author

ehellmann-nydig commented Jun 2, 2023

Flaky tests are failing which I don't expect have anything to do with this change

@terrytangyuan terrytangyuan merged commit 15d8463 into argoproj:master Jun 5, 2023
JPZ13 pushed a commit to pipekit/argo-workflows that referenced this pull request Jul 4, 2023
Signed-off-by: Eli Hellmann <eli.hellmann@nydig.com>
jeremyhager pushed a commit to jeremyhager/argo-workflows that referenced this pull request Jul 7, 2023
Signed-off-by: Eli Hellmann <eli.hellmann@nydig.com>
Signed-off-by: Jeremy Hager <47301461+jeremyhager@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants