mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-15 17:51:20 +00:00
added +optional for optional fields
This commit is contained in:
parent
d41eb93e66
commit
9b033fd755
2 changed files with 43 additions and 25 deletions
|
@ -325,7 +325,7 @@ string
|
|||
</em>
|
||||
</td>
|
||||
<td>
|
||||
<p>Policy - The required field represents the name of the policy</p>
|
||||
<p>Specifies the name of the policy</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -728,7 +728,7 @@ string
|
|||
</em>
|
||||
</td>
|
||||
<td>
|
||||
<p>Policy - The required field represents the name of the policy</p>
|
||||
<p>Specifies the name of the policy</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -807,7 +807,8 @@ string
|
|||
</em>
|
||||
</td>
|
||||
<td>
|
||||
<p>Message - An optional field is the request status message</p>
|
||||
<em>(Optional)</em>
|
||||
<p>Specifies request status message</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -1584,7 +1585,8 @@ string
|
|||
</em>
|
||||
</td>
|
||||
<td>
|
||||
<p>(Required): Specifies resource kind</p>
|
||||
<em>(Optional)</em>
|
||||
<p>Specifies resource kind</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -1595,7 +1597,8 @@ string
|
|||
</em>
|
||||
</td>
|
||||
<td>
|
||||
<p>(Optional): Specifies resource namespace</p>
|
||||
<em>(Optional)</em>
|
||||
<p>Specifies resource namespace</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -1606,7 +1609,7 @@ string
|
|||
</em>
|
||||
</td>
|
||||
<td>
|
||||
<p>(Required): Specifies resource name</p>
|
||||
<p>Specifies resource name</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -1638,7 +1641,7 @@ string
|
|||
</em>
|
||||
</td>
|
||||
<td>
|
||||
<p>Name - A required field represents rule name</p>
|
||||
<p>Specifies rule name</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -1651,7 +1654,8 @@ MatchResources
|
|||
</em>
|
||||
</td>
|
||||
<td>
|
||||
<p>(Optional): Specifies resources for which the rule has to be applied.
|
||||
<em>(Optional)</em>
|
||||
<p>Specifies resources for which the rule has to be applied.
|
||||
If it’s defined, “kind” inside MatchResources block is required.</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -1665,7 +1669,8 @@ ExcludeResources
|
|||
</em>
|
||||
</td>
|
||||
<td>
|
||||
<p>(Optional): Specifies resources for which rule can be excluded</p>
|
||||
<em>(Optional)</em>
|
||||
<p>Specifies resources for which rule can be excluded</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -1678,7 +1683,8 @@ ExcludeResources
|
|||
</em>
|
||||
</td>
|
||||
<td>
|
||||
<p>(Optional): Allows controlling policy rule execution</p>
|
||||
<em>(Optional)</em>
|
||||
<p>Allows controlling policy rule execution</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -1691,7 +1697,8 @@ Mutation
|
|||
</em>
|
||||
</td>
|
||||
<td>
|
||||
<p>(Optional): Specifies patterns to mutate resources</p>
|
||||
<em>(Optional)</em>
|
||||
<p>Specifies patterns to mutate resources</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -1704,7 +1711,8 @@ Validation
|
|||
</em>
|
||||
</td>
|
||||
<td>
|
||||
<p>(Optional): Specifies patterns to validate resources</p>
|
||||
<em>(Optional)</em>
|
||||
<p>Specifies patterns to validate resources</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -1717,7 +1725,8 @@ Generation
|
|||
</em>
|
||||
</td>
|
||||
<td>
|
||||
<p>(Optional): Specifies patterns to create additional resources</p>
|
||||
<em>(Optional)</em>
|
||||
<p>Specifies patterns to create additional resources</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
|
|
@ -21,7 +21,7 @@ type GenerateRequest struct {
|
|||
|
||||
//GenerateRequestSpec stores the request specification
|
||||
type GenerateRequestSpec struct {
|
||||
// Policy - The required field represents the name of the policy
|
||||
// Specifies the name of the policy
|
||||
Policy string `json:"policy"`
|
||||
// ResourceSpec is the information to identify the generate request
|
||||
Resource ResourceSpec `json:"resource"`
|
||||
|
@ -49,7 +49,8 @@ type RequestInfo struct {
|
|||
type GenerateRequestStatus struct {
|
||||
// State represents state of the generate request
|
||||
State GenerateRequestState `json:"state"`
|
||||
// Message - An optional field is the request status message
|
||||
// Specifies request status message
|
||||
// +optional
|
||||
Message string `json:"message,omitempty"`
|
||||
// This will track the resources that are generated by the generate Policy
|
||||
// Will be used during clean up resources
|
||||
|
@ -149,20 +150,26 @@ type Spec struct {
|
|||
// Rule is set of mutation, validation and generation actions
|
||||
// for the single resource description
|
||||
type Rule struct {
|
||||
// Name - A required field represents rule name
|
||||
// Specifies rule name
|
||||
Name string `json:"name"`
|
||||
// (Optional): Specifies resources for which the rule has to be applied.
|
||||
// Specifies resources for which the rule has to be applied.
|
||||
// If it's defined, "kind" inside MatchResources block is required.
|
||||
// +optional
|
||||
MatchResources MatchResources `json:"match"`
|
||||
// (Optional): Specifies resources for which rule can be excluded
|
||||
// Specifies resources for which rule can be excluded
|
||||
// +optional
|
||||
ExcludeResources ExcludeResources `json:"exclude,omitempty"`
|
||||
// (Optional): Allows controlling policy rule execution
|
||||
// Allows controlling policy rule execution
|
||||
// +optional
|
||||
Conditions []Condition `json:"preconditions,omitempty"`
|
||||
// (Optional): Specifies patterns to mutate resources
|
||||
// Specifies patterns to mutate resources
|
||||
// +optional
|
||||
Mutation Mutation `json:"mutate,omitempty"`
|
||||
// (Optional): Specifies patterns to validate resources
|
||||
// Specifies patterns to validate resources
|
||||
// +optional
|
||||
Validation Validation `json:"validate,omitempty"`
|
||||
// (Optional): Specifies patterns to create additional resources
|
||||
// Specifies patterns to create additional resources
|
||||
// +optional
|
||||
Generation Generation `json:"generate,omitempty"`
|
||||
}
|
||||
|
||||
|
@ -349,11 +356,13 @@ type PolicyViolationSpec struct {
|
|||
|
||||
// ResourceSpec information to identify the resource
|
||||
type ResourceSpec struct {
|
||||
// (Required): Specifies resource kind
|
||||
// Specifies resource kind
|
||||
// +optional
|
||||
Kind string `json:"kind"`
|
||||
// (Optional): Specifies resource namespace
|
||||
// Specifies resource namespace
|
||||
// +optional
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
// (Required): Specifies resource name
|
||||
// Specifies resource name
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue