Dagger
Search

kyverno

No long description provided.

Installation

dagger install github.com/stuttgart-things/dagger/kyverno@v0.130.0

Entrypoint

Return Type
Kyverno
Example
dagger -m github.com/stuttgart-things/dagger/kyverno@f0694938a41392634c2acb9d6efc6842d5f6866d call \
func (m *MyModule) Example() *dagger.Kyverno  {
	return dag.
			Kyverno()
}
@function
def example() -> dagger.Kyverno:
	return (
		dag.kyverno()
	)
@func()
example(): Kyverno {
	return dag
		.kyverno()
}

Types

Kyverno 🔗

baseImage() 🔗

Return Type
String !
Example
dagger -m github.com/stuttgart-things/dagger/kyverno@f0694938a41392634c2acb9d6efc6842d5f6866d call \
 base-image
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			Kyverno().
			Baseimage(ctx)
}
@function
async def example() -> str:
	return await (
		dag.kyverno()
		.baseimage()
	)
@func()
async example(): Promise<string> {
	return dag
		.kyverno()
		.baseImage()
}

test() 🔗

Test runs kyverno test over a directory holding kyverno-test.yaml files and the policies and resources they name, and returns the result table.

Validate answers “do these resources pass these policies?”. Test answers the question every policy change raises: does the policy still refuse what it must refuse, and still admit what it must admit? A policy that admits everything passes Validate against good resources forever; it fails a test that expects a refusal.

Any result that does not match its expectation is an error, and so is a path without a single kyverno-test.yaml (–require-tests): a run over the wrong directory must not pass by testing nothing. The error carries the table.

Policies that verify image signatures reach the registry and Rekor during the test, so their results depend on what is published at the time: a signed fixture image has to stay in its registry. For the same reason the test is never answered from cache.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
srcDirectory !-

Directory holding kyverno-test.yaml files and the files they name

pathString "."

Path inside src to search for kyverno-test.yaml files

kyvernoVersionString "1.19.1"

Kyverno CLI release; match it to the Kyverno running on the cluster

warningsAsErrorsBoolean false

Fail on deprecation warnings, such as the one every kyverno.io/v1 ClusterPolicy draws from 1.19 on. Needs a CLI of 1.19 or later.

Example
dagger -m github.com/stuttgart-things/dagger/kyverno@f0694938a41392634c2acb9d6efc6842d5f6866d call \
 test --src DIR_PATH
func (m *MyModule) Example(ctx context.Context, src *dagger.Directory) string  {
	return dag.
			Kyverno().
			Test(ctx, src)
}
@function
async def example(src: dagger.Directory) -> str:
	return await (
		dag.kyverno()
		.test(src)
	)
@func()
async example(src: Directory): Promise<string> {
	return dag
		.kyverno()
		.test(src)
}

validate() 🔗

Return Type
Void !
Arguments
NameTypeDefault ValueDescription
policyDirectory !-No description provided
resourceDirectory !-No description provided
kyvernoVersionString "1.19.1"

Kyverno CLI release; match it to the Kyverno running on the cluster

Example
dagger -m github.com/stuttgart-things/dagger/kyverno@f0694938a41392634c2acb9d6efc6842d5f6866d call \
 validate --policy DIR_PATH --resource DIR_PATH
func (m *MyModule) Example(ctx context.Context, policy *dagger.Directory, resource *dagger.Directory)   {
	return dag.
			Kyverno().
			Validate(ctx, policy, resource)
}
@function
async def example(policy: dagger.Directory, resource: dagger.Directory) -> None:
	return await (
		dag.kyverno()
		.validate(policy, resource)
	)
@func()
async example(policy: Directory, resource: Directory): Promise<void> {
	return dag
		.kyverno()
		.validate(policy, resource)
}

version() 🔗

Return Type
String !
Arguments
NameTypeDefault ValueDescription
kyvernoVersionString "1.19.1"

Kyverno CLI release

Example
dagger -m github.com/stuttgart-things/dagger/kyverno@f0694938a41392634c2acb9d6efc6842d5f6866d call \
 version
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			Kyverno().
			Version(ctx)
}
@function
async def example() -> str:
	return await (
		dag.kyverno()
		.version()
	)
@func()
async example(): Promise<string> {
	return dag
		.kyverno()
		.version()
}