This section is empty.


This section is empty.


This section is empty.


type Context

type Context struct {
	// contains filtered or unexported fields

    Context stores the data resources as JSON

    func NewContext

    func NewContext(whiteListVars ...string) *Context

      NewContext returns a new context pass the list of variables to be white-listed

      func (*Context) AddJSON

      func (ctx *Context) AddJSON(dataRaw []byte) error

        AddJSON merges json data

        func (*Context) AddRequest

        func (ctx *Context) AddRequest(request *v1beta1.AdmissionRequest) error

        func (*Context) AddResource

        func (ctx *Context) AddResource(dataRaw []byte) error

          AddResource data at path: request.object

          func (*Context) AddSA

          func (ctx *Context) AddSA(userName string) error

            AddSA removes prefix 'system:serviceaccount:' and namespace, then loads only SA name and SA namespace

            func (*Context) AddUserInfo

            func (ctx *Context) AddUserInfo(userRequestInfo kyverno.RequestInfo) error

              AddUserInfo adds userInfo at path request.userInfo

              func (*Context) Query

              func (ctx *Context) Query(query string) (interface{}, error)

                Query the JSON context with JMESPATH search path

                type EvalInterface

                type EvalInterface interface {
                	Query(query string) (interface{}, error)

                  EvalInterface ... to evaluate

                  type Interface

                  type Interface interface {
                  	//AddJSON  merges the json with context
                  	AddJSON(dataRaw []byte) error
                  	//AddResource merges resource json under request.object
                  	AddResource(dataRaw []byte) error
                  	//AddUserInfo merges userInfo json under kyverno.userInfo
                  	AddUserInfo(userInfo kyverno.UserInfo) error
                  	//AddSA merges serrviceaccount
                  	AddSA(userName string) error

                    Interface to manage context operations