From 98ecf30a62d0bbf2432be32806230947439877a0 Mon Sep 17 00:00:00 2001 From: Vishal Choudhary Date: Wed, 12 Mar 2025 20:17:21 +0530 Subject: [PATCH] fix: add missing context type and http type in ivpols (#12393) Signed-off-by: Vishal Choudhary --- pkg/imageverification/evaluator/compiler.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/imageverification/evaluator/compiler.go b/pkg/imageverification/evaluator/compiler.go index 5f89bba77f..a98440e8f6 100644 --- a/pkg/imageverification/evaluator/compiler.go +++ b/pkg/imageverification/evaluator/compiler.go @@ -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)),