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

Events output go-template fails if a builtin function is used #1644

Closed
zerodayace opened this issue Oct 20, 2024 · 0 comments · Fixed by #1645
Closed

Events output go-template fails if a builtin function is used #1644

zerodayace opened this issue Oct 20, 2024 · 0 comments · Fixed by #1645
Labels
kind/bug Categorizes issue or PR as related to a bug. sig/node Categorizes an issue or PR as relevant to SIG Node.

Comments

@zerodayace
Copy link
Contributor

What happened:

Validation of events monitoring failed with output set to go-template and a template that contains a builtin function.

What you expected to happen:

Output formatted with the template.

How to reproduce it (as minimally and precisely as possible):

crictl events -o go-template "{{ . | json }}"

Anything else we need to know?:

The reason for the issue is that the validation function does not include the builtin template functions in the validation step, but the final render function does.

I fixed it and provide a PR

Environment:

Version: v1.31.1

@zerodayace zerodayace added kind/bug Categorizes issue or PR as related to a bug. sig/node Categorizes an issue or PR as relevant to SIG Node. labels Oct 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. sig/node Categorizes an issue or PR as relevant to SIG Node.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant