1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-23 00:01:55 +00:00

fix: add missing context type and http type in ivpols (#12393)

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
This commit is contained in:
Vishal Choudhary 2025-03-12 20:17:21 +05:30 committed by GitHub
parent 91e6ae14fe
commit 98ecf30a62
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -26,6 +26,8 @@ const (
ImagesKey = "images"
AttestorKey = "attestors"
AttestationKey = "attestations"
ContextKey = "context"
HttpKey = "http"
)
type Compiler interface {
@ -55,6 +57,8 @@ func (c *compiler) Compile(logger logr.Logger, ivpolicy *policiesv1alpha1.ImageV
var declTypes []*apiservercel.DeclType
declTypes = append(declTypes, imageverifierfunctions.Types()...)
options := []cel.EnvOption{
cel.Variable(ContextKey, context.ContextType),
cel.Variable(HttpKey, http.HTTPType),
cel.Variable(ImagesKey, cel.MapType(cel.StringType, cel.ListType(cel.StringType))),
cel.Variable(AttestorKey, cel.MapType(cel.StringType, cel.StringType)),
cel.Variable(AttestationKey, cel.MapType(cel.StringType, cel.StringType)),