mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-24 16:48:20 +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:
parent
91e6ae14fe
commit
98ecf30a62
1 changed files with 4 additions and 0 deletions
|
@ -26,6 +26,8 @@ const (
|
||||||
ImagesKey = "images"
|
ImagesKey = "images"
|
||||||
AttestorKey = "attestors"
|
AttestorKey = "attestors"
|
||||||
AttestationKey = "attestations"
|
AttestationKey = "attestations"
|
||||||
|
ContextKey = "context"
|
||||||
|
HttpKey = "http"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Compiler interface {
|
type Compiler interface {
|
||||||
|
@ -55,6 +57,8 @@ func (c *compiler) Compile(logger logr.Logger, ivpolicy *policiesv1alpha1.ImageV
|
||||||
var declTypes []*apiservercel.DeclType
|
var declTypes []*apiservercel.DeclType
|
||||||
declTypes = append(declTypes, imageverifierfunctions.Types()...)
|
declTypes = append(declTypes, imageverifierfunctions.Types()...)
|
||||||
options := []cel.EnvOption{
|
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(ImagesKey, cel.MapType(cel.StringType, cel.ListType(cel.StringType))),
|
||||||
cel.Variable(AttestorKey, cel.MapType(cel.StringType, cel.StringType)),
|
cel.Variable(AttestorKey, cel.MapType(cel.StringType, cel.StringType)),
|
||||||
cel.Variable(AttestationKey, cel.MapType(cel.StringType, cel.StringType)),
|
cel.Variable(AttestationKey, cel.MapType(cel.StringType, cel.StringType)),
|
||||||
|
|
Loading…
Add table
Reference in a new issue