Skip to content

[Feature] Add HTTP DELETE method support to CEL HTTP library #15472

Description

@gaganhr94

Problem Statement

The Kyverno SDK CEL HTTP library does not support DELETE operations, which are essential for completing CRUD (Create, Read, Update, Delete) functionality. DELETE is a fundamental HTTP method used to remove resources from REST APIs. Without DELETE support, users cannot use the HTTP library to perform resource deletion operations, limiting the library's usefulness for comprehensive API interactions and resource lifecycle management.

Solution Description

  • Add Delete(url string, headers map[string]string) (any, error) method to the ContextInterface in types.go
  • Implement the Delete method in contextImpl in http.go that creates a DELETE request with the provided headers
  • Register two CEL function overloads in lib.go:
    http_delete_string: Basic DELETE with URL only
    http_delete_string_headers: DELETE with URL and custom headers

Alternatives

No response

Additional Context

No response

Slack discussion

No response

Research

  • I have read and followed the documentation AND the troubleshooting guide.
  • I have searched other issues in this repository and mine is not recorded.

Metadata

Metadata

Assignees

Labels

API CallUse case for API Server calls to fetch JSON dataenhancementNew feature or requestneeds design (KDP)A design proposal is recommended (https://github.com/kyverno/KDP)triageDefault label assigned to all new issues indicating label curation is needed to fully organize.

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions