1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-10 18:06:55 +00:00
kyverno/docs/user/cli/crd/kyverno_kubectl.v1alpha1.html

2455 lines
38 KiB
HTML
Raw Normal View History

<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<style>
.bg-blue {
color: #ffffff;
background-color: #1589dd;
}
</style>
</head>
<body>
<div class="container">
<h2 id="cli-kyverno-io-v1alpha1">Package: <span style="font-family: monospace">cli.kyverno.io/v1alpha1</span></h2>
<p></p>
<h3>Resource Types:</h3>
<ul><li>
<a href="#cli-kyverno-io-v1alpha1-Test">Test</a>
</li><li>
<a href="#cli-kyverno-io-v1alpha1-UserInfo">UserInfo</a>
</li><li>
<a href="#cli-kyverno-io-v1alpha1-Values">Values</a>
</li></ul>
<H3 id="cli-kyverno-io-v1alpha1-Test">Test
</H3>
<p><p>Test declares a test</p>
</p>
<table class="table table-striped">
<thead class="thead-dark">
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>apiVersion</code></br>string</td>
<td><code>cli.kyverno.io/v1alpha1</code></td>
</tr>
<tr>
<td><code>kind</code></br>string</td>
<td><code>Test</code></td>
</tr>
<tr>
<td><code>metadata</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">meta/v1.ObjectMeta</span>
</td>
<td>
Refer to the Kubernetes API documentation for the fields of the
<code>metadata</code> field.
</td>
</tr>
<tr>
<td><code>name</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">string</span>
</td>
<td>
<p>Name is the name of the test.
This field is deprecated, use <code>metadata.name</code> instead</p>
</td>
</tr>
<tr>
<td><code>policies</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">[]string</span>
</td>
<td>
<p>Policies are the policies to be used in the test</p>
</td>
</tr>
<tr>
<td><code>resources</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">[]string</span>
</td>
<td>
<p>Resources are the resource to be used in the test</p>
</td>
</tr>
Mutate existing CLI support (#11453) * feat: Add flags for target resources and add fake client initialization Signed-off-by: aerosouund <aerosound161@gmail.com> * feat: Add fake discovery client and cluster bool in the policy processor Signed-off-by: aerosouund <aerosound161@gmail.com> * refactor: Use the full mutation engine policy response in the engine response Signed-off-by: aerosouund <aerosound161@gmail.com> * feat: Extract mutated targets from the policy responses and print them out Signed-off-by: aerosouund <aerosound161@gmail.com> * feat: Add TargetResources field in the cli test schema Signed-off-by: aerosouund <aerosound161@gmail.com> * chore: Generate CLI crds Signed-off-by: aerosouund <aerosound161@gmail.com> * refactor: modify checkResult to take an arbitrary actual resource and resource name Signed-off-by: aerosouund <aerosound161@gmail.com> * refactor: change getAndCompareResource to take a resource name and cascade it to GetResourceFromPath Signed-off-by: aerosouund <aerosound161@gmail.com> * test: Create a simple test to test mutate existing in the CLI Signed-off-by: aerosouund <aerosound161@gmail.com> * refactor: Allow GetResourceFromPath to select a resource with a name from a multi resource yaml Signed-off-by: aerosouund <aerosound161@gmail.com> * refactor: Modify the runTest command to return the TestResponse type - Create a fake client, load the target resources in it and use it in the PolicyProcessor. - Create the TestResponse which contains Trigger and Target fields, each is a map of gvk/name to the responses corresponding to that resource. Signed-off-by: aerosouund <aerosound161@gmail.com> * refactor: Rewrite output.go to use the TestResponse type - Check for both target and trigger - Create logic for appending the resource array in case no resources are passed - Move row creation logic into a separate method to avoid code duplication - Extract the proper target resource based on rule type - Create a function to extract mutated target from the engine response Signed-off-by: aerosouund <aerosound161@gmail.com> * chore: Move tests to the correct folder Signed-off-by: aerosouund <aerosound161@gmail.com> * refactor: Use apiVersion/Kind/Name as the key in the test responses Signed-off-by: aerosouund <aerosound161@gmail.com> * refactor: Use the apiVersion/Kind/name key schema in checking results and fix invalid resource name checking for generate policies Signed-off-by: aerosouund <aerosound161@gmail.com> * fix: Use better variable names for rows Signed-off-by: aerosouund <aerosound161@gmail.com> * refactor: Account for Generate resources being an array Signed-off-by: aerosouund <aerosound161@gmail.com> * fix: Use generated resource name in checking the results and printing output Signed-off-by: aerosouund <aerosound161@gmail.com> * chore: Uncomment checks printing Signed-off-by: aerosouund <aerosound161@gmail.com> * fix: Remove bug in engine response creation Signed-off-by: aerosouund <aerosound161@gmail.com> * fix: Move the generate logic into an else block Signed-off-by: aerosouund <aerosound161@gmail.com> * fix: Fix namespace fetching bug in cel validator Signed-off-by: aerosouund <aerosound161@gmail.com> * fix: Use pointer to int in the test counter Signed-off-by: aerosouund <aerosound161@gmail.com> * chore: Remove redundant method Signed-off-by: aerosouund <aerosound161@gmail.com> * fix: Skip resources not being found in the manifests Signed-off-by: aerosouund <aerosound161@gmail.com> * fix: Create another field in the engine to denote if this is a cluster engine or an offline engine Simply checking for the client being nil is no longer enough because for cli operations the client will be a fake client A pointer to bool is chosen because callers who don't necessarily know what to pass should be able to pass nil Signed-off-by: ammar <ammar.yasser@vodafone.com> * fix: Add extra argument in fake client initiation Signed-off-by: ammar <ammar.yasser@vodafone.com> * fix: add extra argument in fuzz test Signed-off-by: ammar <ammar.yasser@vodafone.com> * fix: Add extra arg Signed-off-by: ammar <ammar.yasser@vodafone.com> * fix: Handle resources specified as ns/name as this schema will be deprecated in favor of apiVersion/Kind/Name Signed-off-by: ammar <ammar.yasser@vodafone.com> * fix: Fix linter complaints Signed-off-by: ammar <ammar.yasser@vodafone.com> * fix: Use comma separation as array separators as kubernetes names don't support commas To avoid undefined array length on splitting on / using commas will result in a fixed length since all resources will have an apiVersion, kind, namespace and name Signed-off-by: aerosouund <aerosound161@gmail.com> * refactor: Change resource array type to an array of any instead of array of string To support the use of a string or a TestResourceSpec Signed-off-by: aerosouund <aerosound161@gmail.com> * refactor: Expect the resource array to be an array of string or array of TestResourceSpec Assert that an array element is either of these types and match the resources in both cases according to the element type Expect that the key in responses is now separated by commas instead of slashes Signed-off-by: aerosouund <aerosound161@gmail.com> * refactor: Expect that the resource array is now of type array of any and modify tests that use it Signed-off-by: aerosouund <aerosound161@gmail.com> * fix: Skip response check if the policy name isnt whats in the result Signed-off-by: aerosouund <aerosound161@gmail.com> * fix: Match the name if its specified as ns/name Signed-off-by: aerosouund <aerosound161@gmail.com> * fix: Fix linter complaint Signed-off-by: aerosouund <aerosound161@gmail.com> * chore: Run codegen Signed-off-by: aerosouund <aerosound161@gmail.com> * chore: Create CLI CRDs Signed-off-by: aerosouund <aerosound161@gmail.com> * chore: Run codegen Signed-off-by: aerosouund <aerosound161@gmail.com> * fix: Fix linter complaints Signed-off-by: aerosouund <aerosound161@gmail.com> * fix: Cleanup invalid code used in FixTest to adapt it to the schema changes Signed-off-by: aerosouund <aerosound161@gmail.com> * fix: Check if resource is nil before extracting Signed-off-by: aerosouund <aerosound161@gmail.com> * fix: use the loadResources method to open targets in a directory Signed-off-by: aerosouund <aerosound161@gmail.com> * fix: Account for target resources with the same name but different namespaces Signed-off-by: aerosouund <aerosound161@gmail.com> * fix: Add CLI test for mutate existing with the same name Signed-off-by: aerosouund <aerosound161@gmail.com> * refactor: Infer resource name and namespace from the actual resource and account for resources with the same name and namespace but different kinds Signed-off-by: aerosouund <aerosound161@gmail.com> * chore: remove extra line Signed-off-by: aerosouund <aerosound161@gmail.com> * feat: Add printing mutate existing resources to the output or to a file Signed-off-by: aerosouund <aerosound161@gmail.com> * chore: Minor fixes Signed-off-by: aerosouund <aerosound161@gmail.com> * chore: fix linter complaint Signed-off-by: aerosouund <aerosound161@gmail.com> * chore: codegen Signed-off-by: aerosouund <aerosound161@gmail.com> * fix: Revert result back to error Signed-off-by: aerosouund <aerosound161@gmail.com> * fix: Use io discard to not print resources in the test command Signed-off-by: aerosouund <aerosound161@gmail.com> * chore: Update vague comments and remove outdated ones Signed-off-by: aerosouund <aerosound161@gmail.com> * refactor: Integrate mutate existing changes with diff generation Signed-off-by: aerosouund <aerosound161@gmail.com> * refactor: Move resource key generation into a function Signed-off-by: aerosouund <aerosound161@gmail.com> * chore: Add a mutate existing test that fails Signed-off-by: aerosouund <aerosound161@gmail.com> * chore: fix linter complaint Signed-off-by: aerosouund <aerosound161@gmail.com> * chore: Remove redundant comment Signed-off-by: aerosouund <aerosound161@gmail.com> * refactor: Fix array of any assignment in cli test Signed-off-by: aerosouund <aerosound161@gmail.com> * fix: Dont check duplicate strings for field that is an array of any Signed-off-by: aerosouund <aerosound161@gmail.com> * bug: Fix appending to the wrong array Signed-off-by: aerosouund <aerosound161@gmail.com> * chore: run fix tests Signed-off-by: aerosouund <aerosound161@gmail.com> * chore: Run fix tests Signed-off-by: aerosouund <aerosound161@gmail.com> --------- Signed-off-by: aerosouund <aerosound161@gmail.com> Signed-off-by: ammar <ammar.yasser@vodafone.com> Signed-off-by: Ammar Yasser <aerosound161@gmail.com> Co-authored-by: ammar <ammar.yasser@vodafone.com> Co-authored-by: shuting <shuting@nirmata.com>
2024-12-19 09:42:54 +02:00
<tr>
<td><code>targetResources</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">[]string</span>
</td>
<td>
<p>Target Resources are for policies that have mutate existing</p>
</td>
</tr>
<tr>
<td><code>variables</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">string</span>
</td>
<td>
<p>Variables is the values to be used in the test</p>
</td>
</tr>
<tr>
<td><code>userinfo</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">string</span>
</td>
<td>
<p>UserInfo is the user info to be used in the test</p>
</td>
</tr>
<tr>
<td><code>results</code>
<span style="color:blue;"> *</span>
</br>
<a href="#cli-kyverno-io-v1alpha1-TestResult">
<span style="font-family: monospace">[]TestResult</span>
</a>
</td>
<td>
<p>Results are the results to be checked in the test</p>
</td>
</tr>
<tr>
<td><code>checks</code>
<span style="color:blue;"> *</span>
</br>
<a href="#cli-kyverno-io-v1alpha1-CheckResult">
<span style="font-family: monospace">[]CheckResult</span>
</a>
</td>
<td>
<p>Checks are the verifications to be checked in the test</p>
</td>
</tr>
<tr>
<td><code>values</code>
<span style="color:blue;"> *</span>
</br>
<a href="#cli-kyverno-io-v1alpha1-ValuesSpec">
<span style="font-family: monospace">ValuesSpec</span>
</a>
</td>
<td>
<p>Values are the values to be used in the test</p>
</td>
</tr>
<tr>
<td><code>exceptions</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">[]string</span>
</td>
<td>
<p>Policy Exceptions are the policy exceptions to be used in the test</p>
</td>
</tr>
</tbody>
</table>
<H3 id="cli-kyverno-io-v1alpha1-UserInfo">UserInfo
</H3>
<p><p>UserInfo declares user infos to be loaded by the Kyverno CLI</p>
</p>
<table class="table table-striped">
<thead class="thead-dark">
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>apiVersion</code></br>string</td>
<td><code>cli.kyverno.io/v1alpha1</code></td>
</tr>
<tr>
<td><code>kind</code></br>string</td>
<td><code>UserInfo</code></td>
</tr>
<tr>
<td><code>metadata</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">meta/v1.ObjectMeta</span>
</td>
<td>
Refer to the Kubernetes API documentation for the fields of the
<code>metadata</code> field.
</td>
</tr>
<tr>
<td><code>RequestInfo</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">github.com/kyverno/kyverno/api/kyverno/v2.RequestInfo</span>
</td>
<td>
<p>(Members of <code>RequestInfo</code> are embedded into this type.)</p>
<p>RequestInfo declares user infos</p>
</td>
</tr>
</tbody>
</table>
<H3 id="cli-kyverno-io-v1alpha1-Values">Values
</H3>
<p><p>Values declares values to be loaded by the Kyverno CLI</p>
</p>
<table class="table table-striped">
<thead class="thead-dark">
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>apiVersion</code></br>string</td>
<td><code>cli.kyverno.io/v1alpha1</code></td>
</tr>
<tr>
<td><code>kind</code></br>string</td>
<td><code>Values</code></td>
</tr>
<tr>
<td><code>metadata</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">meta/v1.ObjectMeta</span>
</td>
<td>
Refer to the Kubernetes API documentation for the fields of the
<code>metadata</code> field.
</td>
</tr>
<tr>
<td><code>ValuesSpec</code>
<span style="color:blue;"> *</span>
</br>
<a href="#cli-kyverno-io-v1alpha1-ValuesSpec">
<span style="font-family: monospace">ValuesSpec</span>
</a>
</td>
<td>
<p>(Members of <code>ValuesSpec</code> are embedded into this type.)</p>
<p>ValuesSpec declares values</p>
</td>
</tr>
</tbody>
</table>
<H3 id="cli-kyverno-io-v1alpha1-CheckMatch">CheckMatch
</H3>
<p>
(<em>Appears in:</em>
<a href="#cli-kyverno-io-v1alpha1-CheckResult">CheckResult</a>)
</p>
<p></p>
<table class="table table-striped">
<thead class="thead-dark">
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>resource</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1.Any</span>
</td>
<td>
<p>Resource filters engine responses</p>
</td>
</tr>
<tr>
<td><code>policy</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1.Any</span>
</td>
<td>
<p>Policy filters engine responses</p>
</td>
</tr>
<tr>
<td><code>rule</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1.Any</span>
</td>
<td>
<p>Rule filters rule responses</p>
</td>
</tr>
</tbody>
</table>
<H3 id="cli-kyverno-io-v1alpha1-CheckResult">CheckResult
</H3>
<p>
(<em>Appears in:</em>
<a href="#cli-kyverno-io-v1alpha1-Test">Test</a>)
</p>
<p></p>
<table class="table table-striped">
<thead class="thead-dark">
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>match</code>
<span style="color:blue;"> *</span>
</br>
<a href="#cli-kyverno-io-v1alpha1-CheckMatch">
<span style="font-family: monospace">CheckMatch</span>
</a>
</td>
<td>
<p>Match tells how to match relevant rule responses</p>
</td>
</tr>
<tr>
<td><code>assert</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1.Any</span>
</td>
<td>
<p>Assert contains assertion to be performed on the relevant rule responses</p>
</td>
</tr>
<tr>
<td><code>error</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1.Any</span>
</td>
<td>
<p>Error contains negative assertion to be performed on the relevant rule responses</p>
</td>
</tr>
</tbody>
</table>
<H3 id="cli-kyverno-io-v1alpha1-NamespaceSelector">NamespaceSelector
</H3>
<p>
(<em>Appears in:</em>
<a href="#cli-kyverno-io-v1alpha1-ValuesSpec">ValuesSpec</a>)
</p>
<p><p>NamespaceSelector declares labels for a given namespace</p>
</p>
<table class="table table-striped">
<thead class="thead-dark">
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">string</span>
</td>
<td>
<p>Name is the namespace name</p>
</td>
</tr>
<tr>
<td><code>labels</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">map[string]string</span>
</td>
<td>
<p>Labels are the labels for the given namespace</p>
</td>
</tr>
</tbody>
</table>
<H3 id="cli-kyverno-io-v1alpha1-Policy">Policy
</H3>
<p>
(<em>Appears in:</em>
<a href="#cli-kyverno-io-v1alpha1-ValuesSpec">ValuesSpec</a>)
</p>
<p><p>Policy declares values for a given policy</p>
</p>
<table class="table table-striped">
<thead class="thead-dark">
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">string</span>
</td>
<td>
<p>Name is the policy name</p>
</td>
</tr>
<tr>
<td><code>resources</code>
<span style="color:blue;"> *</span>
</br>
<a href="#cli-kyverno-io-v1alpha1-Resource">
<span style="font-family: monospace">[]Resource</span>
</a>
</td>
<td>
<p>Resources are values for specific resources</p>
</td>
</tr>
<tr>
<td><code>rules</code>
<span style="color:blue;"> *</span>
</br>
<a href="#cli-kyverno-io-v1alpha1-Rule">
<span style="font-family: monospace">[]Rule</span>
</a>
</td>
<td>
<p>Rules are values for specific policy rules</p>
</td>
</tr>
</tbody>
</table>
<H3 id="cli-kyverno-io-v1alpha1-Resource">Resource
</H3>
<p>
(<em>Appears in:</em>
<a href="#cli-kyverno-io-v1alpha1-Policy">Policy</a>)
</p>
<p><p>Resource declares values for a given resource</p>
</p>
<table class="table table-striped">
<thead class="thead-dark">
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">string</span>
</td>
<td>
<p>Name is the name of the resource</p>
</td>
</tr>
<tr>
<td><code>values</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">map[string]interface{}</span>
</td>
<td>
<p>Values are the values for the given resource</p>
</td>
</tr>
</tbody>
</table>
<H3 id="cli-kyverno-io-v1alpha1-Rule">Rule
</H3>
<p>
(<em>Appears in:</em>
<a href="#cli-kyverno-io-v1alpha1-Policy">Policy</a>)
</p>
<p><p>Rule declares values for a given policy rule</p>
</p>
<table class="table table-striped">
<thead class="thead-dark">
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">string</span>
</td>
<td>
<p>Name is the name of the ppolicy rule</p>
</td>
</tr>
<tr>
<td><code>values</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">map[string]interface{}</span>
</td>
<td>
<p>Values are the values for the given policy rule</p>
</td>
</tr>
<tr>
<td><code>foreachValues</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">map[string][]interface{}</span>
</td>
<td>
<p>ForeachValues are the foreach values for the given policy rule</p>
</td>
</tr>
</tbody>
</table>
<H3 id="cli-kyverno-io-v1alpha1-Subresource">Subresource
</H3>
<p>
(<em>Appears in:</em>
<a href="#cli-kyverno-io-v1alpha1-ValuesSpec">ValuesSpec</a>)
</p>
<p><p>Subresource declares subresource/parent resource mapping</p>
</p>
<table class="table table-striped">
<thead class="thead-dark">
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>subresource</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">meta/v1.APIResource</span>
</td>
<td>
<p>Subresource declares the subresource api</p>
</td>
</tr>
<tr>
<td><code>parentResource</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">meta/v1.APIResource</span>
</td>
<td>
<p>ParentResource declares the parent resource api</p>
</td>
</tr>
</tbody>
</table>
<H3 id="cli-kyverno-io-v1alpha1-TestResourceSpec">TestResourceSpec
</H3>
<p>
(<em>Appears in:</em>
<a href="#cli-kyverno-io-v1alpha1-TestResultData">TestResultData</a>)
</p>
<p></p>
<table class="table table-striped">
<thead class="thead-dark">
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>group</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">string</span>
</td>
<td>
</td>
</tr>
<tr>
<td><code>version</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">string</span>
</td>
<td>
</td>
</tr>
<tr>
<td><code>kind</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">string</span>
</td>
<td>
</td>
</tr>
<tr>
<td><code>namespace</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">string</span>
</td>
<td>
</td>
</tr>
<tr>
<td><code>subresource</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">string</span>
</td>
<td>
</td>
</tr>
<tr>
<td><code>name</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">string</span>
</td>
<td>
</td>
</tr>
</tbody>
</table>
<H3 id="cli-kyverno-io-v1alpha1-TestResult">TestResult
</H3>
<p>
(<em>Appears in:</em>
<a href="#cli-kyverno-io-v1alpha1-Test">Test</a>)
</p>
<p><p>TestResult declares a test result</p>
</p>
<table class="table table-striped">
<thead class="thead-dark">
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>TestResultBase</code>
<span style="color:blue;"> *</span>
</br>
<a href="#cli-kyverno-io-v1alpha1-TestResultBase">
<span style="font-family: monospace">TestResultBase</span>
</a>
</td>
<td>
<p>(Members of <code>TestResultBase</code> are embedded into this type.)</p>
</td>
</tr>
<tr>
<td><code>TestResultDeprecated</code>
<span style="color:blue;"> *</span>
</br>
<a href="#cli-kyverno-io-v1alpha1-TestResultDeprecated">
<span style="font-family: monospace">TestResultDeprecated</span>
</a>
</td>
<td>
<p>(Members of <code>TestResultDeprecated</code> are embedded into this type.)</p>
</td>
</tr>
<tr>
<td><code>TestResultData</code>
<span style="color:blue;"> *</span>
</br>
<a href="#cli-kyverno-io-v1alpha1-TestResultData">
<span style="font-family: monospace">TestResultData</span>
</a>
</td>
<td>
<p>(Members of <code>TestResultData</code> are embedded into this type.)</p>
</td>
</tr>
</tbody>
</table>
<H3 id="cli-kyverno-io-v1alpha1-TestResultBase">TestResultBase
</H3>
<p>
(<em>Appears in:</em>
<a href="#cli-kyverno-io-v1alpha1-TestResult">TestResult</a>)
</p>
<p><p>TestResultBase declares a test result base fields</p>
</p>
<table class="table table-striped">
<thead class="thead-dark">
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>policy</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">string</span>
</td>
<td>
<p>Policy mentions the name of the policy.</p>
</td>
</tr>
<tr>
<td><code>rule</code>
</br>
<span style="font-family: monospace">string</span>
</td>
<td>
<p>Rule mentions the name of the rule in the policy.
It's required in case policy is a kyverno policy.</p>
</td>
</tr>
<tr>
<td><code>isValidatingAdmissionPolicy</code>
</br>
<span style="font-family: monospace">bool</span>
</td>
<td>
<p>IsValidatingAdmissionPolicy indicates if the policy is a validating admission policy.
It's required in case policy is a validating admission policy.</p>
</td>
</tr>
<tr>
<td><code>result</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">github.com/kyverno/kyverno/api/policyreport/v1alpha2.PolicyResult</span>
</td>
<td>
<p>Result mentions the result that the user is expecting.
Possible values are pass, fail and skip.</p>
</td>
</tr>
<tr>
<td><code>kind</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">string</span>
</td>
<td>
<p>Kind mentions the kind of the resource on which the policy is to be applied.</p>
</td>
</tr>
chore: Add a new field in the test results CRD to specify patched resources (#11297) * chore: Add a new field in the test results CRD to specify patched resources - The currently existing PatchedResource field has a misleading name, leading to users believing that it can only take a yaml containing a single resource. Another field with proper naming is added until this field is removed completely. - Generate the new CRD from the struct. Signed-off-by: aerosouund <aerosound161@gmail.com> * Update cmd/cli/kubectl-kyverno/apis/v1alpha1/test_result.go Signed-off-by: Jim Bugwadia <jim@nirmata.com> * chore: use more chainsaw step templates (#11296) Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * chore(deps): bump golangci/golangci-lint-action from 6.1.0 to 6.1.1 (#11298) Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 6.1.0 to 6.1.1. - [Release notes](https://github.com/golangci/golangci-lint-action/releases) - [Commits](https://github.com/golangci/golangci-lint-action/compare/aaa42aa0628b4ae2578232a66b541047968fac86...971e284b6050e8a5849b72094c50ab08da042db8) --- updated-dependencies: - dependency-name: golangci/golangci-lint-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: use more chainsaw step templates (#11300) Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * chore: use more chainsaw step templates (#11303) Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> --------- Signed-off-by: aerosouund <aerosound161@gmail.com> Signed-off-by: Jim Bugwadia <jim@nirmata.com> Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Jim Bugwadia <jim@nirmata.com> Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: shuting <shuting@nirmata.com>
2024-10-08 14:41:40 +03:00
<tr>
<td><code>patchedResources</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">string</span>
</td>
<td>
<p>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</p>
</td>
</tr>
<tr>
<td><code>generatedResource</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">string</span>
</td>
<td>
<p>GeneratedResource takes a resource configuration file in yaml format from
the user to compare it against the Kyverno generated resource configuration.</p>
</td>
</tr>
<tr>
<td><code>cloneSourceResource</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">string</span>
</td>
<td>
<p>CloneSourceResource takes the resource configuration file in yaml format
from the user which is meant to be cloned by the generate rule.</p>
</td>
</tr>
</tbody>
</table>
<H3 id="cli-kyverno-io-v1alpha1-TestResultData">TestResultData
</H3>
<p>
(<em>Appears in:</em>
<a href="#cli-kyverno-io-v1alpha1-TestResult">TestResult</a>)
</p>
<p><p>TestResultData declares a test result data</p>
</p>
<table class="table table-striped">
<thead class="thead-dark">
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>resources</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">[]string</span>
</td>
<td>
<p>Resources gives us the list of resources on which the policy is going to be applied.</p>
</td>
</tr>
<tr>
<td><code>resourceSpecs</code>
<span style="color:blue;"> *</span>
</br>
<a href="#cli-kyverno-io-v1alpha1-TestResourceSpec">
<span style="font-family: monospace">[]TestResourceSpec</span>
</a>
</td>
<td>
<p>Resources gives us the list of resources on which the policy is going to be applied.</p>
</td>
</tr>
</tbody>
</table>
<H3 id="cli-kyverno-io-v1alpha1-TestResultDeprecated">TestResultDeprecated
</H3>
<p>
(<em>Appears in:</em>
<a href="#cli-kyverno-io-v1alpha1-TestResult">TestResult</a>)
</p>
<p><p>TestResultBase declares a test result deprecated fields</p>
</p>
<table class="table table-striped">
<thead class="thead-dark">
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>status</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">github.com/kyverno/kyverno/api/policyreport/v1alpha2.PolicyResult</span>
</td>
<td>
<p>Status mentions the status that the user is expecting.
Possible values are pass, fail and skip.
This is DEPRECATED, use <code>Result</code> instead.</p>
</td>
</tr>
<tr>
<td><code>resource</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">string</span>
</td>
<td>
<p>Resource mentions the name of the resource on which the policy is to be applied.
This is DEPRECATED, use <code>Resources</code> instead.</p>
</td>
</tr>
<tr>
<td><code>namespace</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">string</span>
</td>
<td>
<p>Namespace mentions the namespace of the policy which has namespace scope.
This is DEPRECATED, use a name in the form <code>&lt;namespace&gt;/&lt;name&gt;</code> for policies and/or resources instead.</p>
</td>
</tr>
<tr>
<td><code>patchedResource</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">string</span>
</td>
<td>
<p>PatchedResource takes a resource configuration file in yaml format from
the user to compare it against the Kyverno mutated resource configuration.
This is DEPRECATED, Use <code>patchedResources</code> instead.</p>
</td>
</tr>
</tbody>
</table>
<H3 id="cli-kyverno-io-v1alpha1-ValuesSpec">ValuesSpec
</H3>
<p>
(<em>Appears in:</em>
<a href="#cli-kyverno-io-v1alpha1-Test">Test</a>,
<a href="#cli-kyverno-io-v1alpha1-Values">Values</a>)
</p>
<p><p>ValuesSpec declares values to be loaded by the Kyverno CLI</p>
</p>
<table class="table table-striped">
<thead class="thead-dark">
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>globalValues</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">map[string]interface{}</span>
</td>
<td>
<p>GlobalValues are the global values</p>
</td>
</tr>
<tr>
<td><code>policies</code>
<span style="color:blue;"> *</span>
</br>
<a href="#cli-kyverno-io-v1alpha1-Policy">
<span style="font-family: monospace">[]Policy</span>
</a>
</td>
<td>
<p>Policies are the policy values</p>
</td>
</tr>
<tr>
<td><code>namespaceSelector</code>
<span style="color:blue;"> *</span>
</br>
<a href="#cli-kyverno-io-v1alpha1-NamespaceSelector">
<span style="font-family: monospace">[]NamespaceSelector</span>
</a>
</td>
<td>
<p>NamespaceSelectors are the namespace labels</p>
</td>
</tr>
<tr>
<td><code>namespaces</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">[]core/v1.Namespace</span>
</td>
<td>
<p>Namespaces are the namespaces</p>
</td>
</tr>
<tr>
<td><code>subresources</code>
<span style="color:blue;"> *</span>
</br>
<a href="#cli-kyverno-io-v1alpha1-Subresource">
<span style="font-family: monospace">[]Subresource</span>
</a>
</td>
<td>
<p>Subresources are the subresource/parent resource mappings</p>
</td>
</tr>
</tbody>
</table>
<hr />
</div>
</body>
</html>