kyverno
No long description provided.
Installation
dagger install github.com/stuttgart-things/dagger/kyverno@v0.131.0Entrypoint
Return Type
Kyverno Example
dagger -m github.com/stuttgart-things/dagger/kyverno@13be045b822d23b5c6335452a4f4dc3c0b2283e7 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@13be045b822d23b5c6335452a4f4dc3c0b2283e7 call \
base-imagefunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| src | Directory ! | - | Directory holding kyverno-test.yaml files and the files they name |
| path | String | "." | Path inside src to search for kyverno-test.yaml files |
| kyvernoVersion | String | "1.19.1" | Kyverno CLI release; match it to the Kyverno running on the cluster |
| warningsAsErrors | Boolean | 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@13be045b822d23b5c6335452a4f4dc3c0b2283e7 call \
test --src DIR_PATHfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| policy | Directory ! | - | No description provided |
| resource | Directory ! | - | No description provided |
| kyvernoVersion | String | "1.19.1" | Kyverno CLI release; match it to the Kyverno running on the cluster |
Example
dagger -m github.com/stuttgart-things/dagger/kyverno@13be045b822d23b5c6335452a4f4dc3c0b2283e7 call \
validate --policy DIR_PATH --resource DIR_PATHfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| kyvernoVersion | String | "1.19.1" | Kyverno CLI release |
Example
dagger -m github.com/stuttgart-things/dagger/kyverno@13be045b822d23b5c6335452a4f4dc3c0b2283e7 call \
versionfunc (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()
}