context

package
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 16, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	// contains filtered or unexported fields
}

Context stores the data resources as JSON

func NewContext

func NewContext() *Context

NewContext returns a new context

func (*Context) AddJSON

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

AddJSON merges json data

func (*Context) AddResource

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

Add data at path: request.object

func (*Context) AddSA

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

removes prefix 'system:serviceaccount:' and namespace, then loads only username

func (*Context) AddUserInfo

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

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 {
	// merges the json with context
	AddJSON(dataRaw []byte) error
	// merges resource json under request.object
	AddResource(dataRaw []byte) error
	// merges userInfo json under kyverno.userInfo
	AddUserInfo(userInfo kyverno.UserInfo) error
	// merges serrviceaccount
	AddSA(userName string) error
	EvalInterface
}

Interface ... normal functions

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL