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

#1291 Updated sum function docs to mention array should not be empty #1454

Merged
merged 4 commits into from
Feb 6, 2025

Conversation

cerebro1
Copy link
Contributor

@cerebro1 cerebro1 commented Dec 25, 2024

Related issue

Closes #1291.

Proposed Changes

The page does not mention the caveat that the sum function in Kyverno requires at least 1 element in the array, while the JMESPath specification says that the result should be 0 when the array is empty.

##Verify

sonali@SONALI-SRIVASTAVA:~/github/website$ echo '{"input":[]}' | kyverno jp query "sum(input)"
Reading from terminal input.
Enter input object and hit Ctrl+D.
Error: error evaluating JMESPath expression: JMESPath function 'sum': at least one element in the array is required

Checklist

  • I have read the contributing guidelines.
  • I have inspected the website preview for accuracy.
  • I have signed off my issue.

Attached the preview:
issue-3

Signed-off-by: Sonali Srivastava <srivastava.sonali1@gmail.com>
@cerebro1
Copy link
Contributor Author

@realshuting @vishal-chdhry Could you review this, please?

Copy link
Member

@realshuting realshuting left a comment

Choose a reason for hiding this comment

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

/lgtm

Thanks @cerebro1 !

@realshuting realshuting merged commit 78dbd0a into kyverno:main Feb 6, 2025
4 of 6 checks passed
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.

[Bug] Kyverno's sum function requires at least 1 element in the array
2 participants