Package: cli.kyverno.io/v1alpha1

Resource Types:

Context

Values declares values to be loaded by the Kyverno CLI

Field Description
apiVersion
string
cli.kyverno.io/v1alpha1
kind
string
Context
metadata *
meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of the metadata field.
spec *
ContextSpec


resources *
[]meta/v1/unstructured.Unstructured
images *
[]ImageData

Test

Test declares a test

Field Description
apiVersion
string
cli.kyverno.io/v1alpha1
kind
string
Test
metadata *
meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of the metadata field.
name *
string

Name is the name of the test. This field is deprecated, use metadata.name instead

policies *
[]string

Policies are the policies to be used in the test

resources *
[]string

Resources are the resource to be used in the test

jsonPayload *
string

JSONPayload is the JSON payload to be used in the test

targetResources *
[]string

Target Resources are for policies that have mutate existing

variables *
string

Variables is the values to be used in the test

userinfo *
string

UserInfo is the user info to be used in the test

results *
[]TestResult

Results are the results to be checked in the test

checks *
[]CheckResult

Checks are the verifications to be checked in the test

values *
ValuesSpec

Values are the values to be used in the test

exceptions *
[]string

PolicyExceptions are the policy exceptions to be used in the test

context *
string

Context file containing context data for CEL policies

UserInfo

UserInfo declares user infos to be loaded by the Kyverno CLI

Field Description
apiVersion
string
cli.kyverno.io/v1alpha1
kind
string
UserInfo
metadata *
meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of the metadata field.
RequestInfo *
github.com/kyverno/kyverno/api/kyverno/v2.RequestInfo

(Members of RequestInfo are embedded into this type.)

RequestInfo declares user infos

Values

Values declares values to be loaded by the Kyverno CLI

Field Description
apiVersion
string
cli.kyverno.io/v1alpha1
kind
string
Values
metadata *
meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of the metadata field.
ValuesSpec *
ValuesSpec

(Members of ValuesSpec are embedded into this type.)

ValuesSpec declares values

CheckMatch

(Appears in: CheckResult)

Field Description
resource *
github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1.Any

Resource filters engine responses

policy *
github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1.Any

Policy filters engine responses

rule *
github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1.Any

Rule filters rule responses

CheckResult

(Appears in: Test)

Field Description
match *
CheckMatch

Match tells how to match relevant rule responses

assert *
github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1.Any

Assert contains assertion to be performed on the relevant rule responses

error *
github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1.Any

Error contains negative assertion to be performed on the relevant rule responses

ContextSpec

(Appears in: Context)

Field Description
resources *
[]meta/v1/unstructured.Unstructured
images *
[]ImageData

ImageData

(Appears in: ContextSpec)

Field Description
image *
string
resolvedImage *
string
registry *
string
repository *
string
tag *
string
digest *
string
imageIndex *
github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1.Any
manifest *
github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1.Any
config *
github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1.Any

NamespaceSelector

(Appears in: ValuesSpec)

NamespaceSelector declares labels for a given namespace

Field Description
name *
string

Name is the namespace name

labels *
map[string]string

Labels are the labels for the given namespace

Policy

(Appears in: ValuesSpec)

Policy declares values for a given policy

Field Description
name *
string

Name is the policy name

resources *
[]Resource

Resources are values for specific resources

rules *
[]Rule

Rules are values for specific policy rules

Resource

(Appears in: Policy)

Resource declares values for a given resource

Field Description
name *
string

Name is the name of the resource

values *
map[string]interface{}

Values are the values for the given resource

Rule

(Appears in: Policy)

Rule declares values for a given policy rule

Field Description
name *
string

Name is the name of the ppolicy rule

values *
map[string]interface{}

Values are the values for the given policy rule

foreachValues *
map[string][]interface{}

ForeachValues are the foreach values for the given policy rule

Subresource

(Appears in: ValuesSpec)

Subresource declares subresource/parent resource mapping

Field Description
subresource *
meta/v1.APIResource

Subresource declares the subresource api

parentResource *
meta/v1.APIResource

ParentResource declares the parent resource api

TestResourceSpec

(Appears in: TestResultData)

Field Description
group *
string
version *
string
kind *
string
namespace *
string
subresource *
string
name *
string

TestResult

(Appears in: Test)

TestResult declares a test result

Field Description
TestResultBase *
TestResultBase

(Members of TestResultBase are embedded into this type.)

TestResultData *
TestResultData

(Members of TestResultData are embedded into this type.)

TestResultBase

(Appears in: TestResult)

TestResultBase declares a test result base fields

Field Description
policy *
string

Policy mentions the name of the policy.

rule
string

Rule mentions the name of the rule in the policy. It's required in case policy is a kyverno policy.

isValidatingAdmissionPolicy
bool

IsValidatingAdmissionPolicy indicates if the policy is a validating admission policy. It's required in case the policy is a validating admission policy.

isMutatingAdmissionPolicy
bool

IsMutatingAdmissionPolicy indicates if the policy is a mutating admission policy.

isValidatingPolicy
bool

IsValidatingPolicy indicates if the policy is a validating policy. It's required in case the policy is a validating policy.

isDeletingPolicy
bool

IsDeletingPolicy indicates if the policy is a deleting policy. It's required in case the policy is a deleting policy.

isImageValidatingPolicy
bool

IsImageValidatingPolicy indicates if the policy is an image validating policy. It's required in case the policy is an image validating policy.

isGeneratingPolicy
bool

IsGeneratingPolicy indicates if the policy is a generating policy. It's required in case the policy is a generating policy.

isMutatingPolicy
bool

IsMutatingPolicy indicates if the policy is a mutating policy. It's required in case the policy is a mutating policy.

result *
openreports.io/apis/openreports.io/v1alpha1.Result

Result mentions the result that the user is expecting. Possible values are pass, fail and skip.

kind *
string

Kind mentions the kind of the resource on which the policy is to be applied.

patchedResources *
string

PatchedResource takes a resource configuration file in yaml format from the user to compare it against the Kyverno mutated resource configuration. Multiple resources can be passed in the same file

generatedResource *
string

GeneratedResource takes a resource configuration file in yaml format from the user to compare it against the Kyverno generated resource configuration.

cloneSourceResource *
string

CloneSourceResource takes the resource configuration file in yaml format from the user which is meant to be cloned by the generate rule.

TestResultData

(Appears in: TestResult)

TestResultData declares a test result data

Field Description
resources *
[]string

Resources gives us the list of resources on which the policy is going to be applied.

resourceSpecs *
[]TestResourceSpec

Resources gives us the list of resources on which the policy is going to be applied.

ValuesSpec

(Appears in: Test, Values)

ValuesSpec declares values to be loaded by the Kyverno CLI

Field Description
globalValues *
map[string]interface{}

GlobalValues are the global values

policies *
[]Policy

Policies are the policy values

namespaceSelector *
[]NamespaceSelector

NamespaceSelectors are the namespace labels

namespaces *
[]core/v1.Namespace

Namespaces are the namespaces

subresources *
[]Subresource

Subresources are the subresource/parent resource mappings