Skip to content

feat: adds http put support to cel expressions#53

Open
gaganhr94 wants to merge 1 commit intokyverno:mainfrom
gaganhr94:feat/http-put-support
Open

feat: adds http put support to cel expressions#53
gaganhr94 wants to merge 1 commit intokyverno:mainfrom
gaganhr94:feat/http-put-support

Conversation

@gaganhr94
Copy link
Copy Markdown
Contributor

Explanation

This PR adds HTTP PUT method support to the Kyverno SDK CEL HTTP library. Currently, the library only supports GET and POST operations. The PUT method is essential for updating existing resources on remote HTTP endpoints and is a fundamental part of RESTful API interactions. This enhancement allows users to make PUT requests with custom headers and request bodies from within CEL expressions, enabling full resource update capabilities in policy expressions.

Related issue

Fixes kyverno/kyverno#15470

Proposed Changes

The PUT implementation mirrors the existing POST method pattern to maintain consistency across the codebase. These changes will add support to the put method (say, for example http.Put() being used in the CEL expressions)

Checklist

  • I have read the contributing guidelines.
  • I have read the PR documentation guide and followed the process including adding proof manifests to this PR.
  • This is a bug fix and I have added unit tests that prove my fix is effective.

Further Comments

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 79.54545% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.68%. Comparing base (e8b7d31) to head (a3235fd).

Files with missing lines Patch % Lines
cel/libs/http/impl.go 75.00% 2 Missing and 3 partials ⚠️
cel/libs/http/http.go 60.00% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #53      +/-   ##
==========================================
+ Coverage   71.52%   71.68%   +0.15%     
==========================================
  Files          77       77              
  Lines        2255     2299      +44     
==========================================
+ Hits         1613     1648      +35     
- Misses        526      530       +4     
- Partials      116      121       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gaganhr94
Copy link
Copy Markdown
Contributor Author

Hi @eddycharly @fjogeleit can you please review this PR when you get a chance. The issue attached with the PR has more details about why I thought about this particular feature. Thanks !

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.

[Feature] Add HTTP PUT method support to CEL HTTP library

3 participants