1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-05 07:26:55 +00:00

fix: deprecate spec.schemaValidation (#9189)

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
This commit is contained in:
Mariam Fahmy 2023-12-18 18:32:11 +02:00 committed by GitHub
parent 3f865d2038
commit e22cd9818f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 24 additions and 88 deletions

View file

@ -111,10 +111,6 @@ func (p *ClusterPolicy) IsReady() bool {
return p.Status.IsReady()
}
func (p *ClusterPolicy) ValidateSchema() bool {
return p.Spec.ValidateSchema()
}
// Validate implements programmatic validation
// namespaced means that the policy is bound to a namespace and therefore
// should not filter/generate cluster wide resources.

View file

@ -19,5 +19,4 @@ type PolicyInterface interface {
GetKind() string
CreateDeepCopy() PolicyInterface
IsReady() bool
ValidateSchema() bool
}

View file

@ -111,10 +111,6 @@ func (p *Policy) IsReady() bool {
return p.Status.IsReady()
}
func (p *Policy) ValidateSchema() bool {
return p.Spec.ValidateSchema()
}
// Validate implements programmatic validation.
// namespaced means that the policy is bound to a namespace and therefore
// should not filter/generate cluster wide resources.

View file

@ -93,9 +93,7 @@ type Spec struct {
// +kubebuilder:default=true
Background *bool `json:"background,omitempty" yaml:"background,omitempty"`
// SchemaValidation skips validation checks for policies as well as patched resources.
// Optional. The default value is set to "true", it must be set to "false" to disable the validation checks.
// +optional
// Deprecated.
SchemaValidation *bool `json:"schemaValidation,omitempty" yaml:"schemaValidation,omitempty"`
// WebhookTimeoutSeconds specifies the maximum time in seconds allowed to apply this policy.
@ -257,13 +255,6 @@ func (s *Spec) GetApplyRules() ApplyRulesType {
return *s.ApplyRules
}
func (s *Spec) ValidateSchema() bool {
if s.SchemaValidation != nil {
return *s.SchemaValidation
}
return true
}
// ValidateRuleNames checks if the rule names are unique across a policy
func (s *Spec) ValidateRuleNames(path *field.Path) (errs field.ErrorList) {
names := sets.New[string]()

View file

@ -54,9 +54,7 @@ type Spec struct {
// +kubebuilder:default=true
Background *bool `json:"background,omitempty" yaml:"background,omitempty"`
// SchemaValidation skips validation checks for policies as well as patched resources.
// Optional. The default value is set to "true", it must be set to "false" to disable the validation checks.
// +optional
// Deprecated.
SchemaValidation *bool `json:"schemaValidation,omitempty" yaml:"schemaValidation,omitempty"`
// WebhookTimeoutSeconds specifies the maximum time in seconds allowed to apply this policy.

View file

@ -10654,9 +10654,7 @@ spec:
type: object
type: array
schemaValidation:
description: SchemaValidation skips validation checks for policies
as well as patched resources. Optional. The default value is set
to "true", it must be set to "false" to disable the validation checks.
description: Deprecated.
type: boolean
useServerSideApply:
description: UseServerSideApply controls whether to use server-side
@ -19370,9 +19368,7 @@ spec:
type: object
type: array
schemaValidation:
description: SchemaValidation skips validation checks for policies
as well as patched resources. Optional. The default value is set
to "true", it must be set to "false" to disable the validation checks.
description: Deprecated.
type: boolean
useServerSideApply:
description: UseServerSideApply controls whether to use server-side
@ -28386,9 +28382,7 @@ spec:
type: object
type: array
schemaValidation:
description: SchemaValidation skips validation checks for policies
as well as patched resources. Optional. The default value is set
to "true", it must be set to "false" to disable the validation checks.
description: Deprecated.
type: boolean
useServerSideApply:
description: UseServerSideApply controls whether to use server-side
@ -37104,9 +37098,7 @@ spec:
type: object
type: array
schemaValidation:
description: SchemaValidation skips validation checks for policies
as well as patched resources. Optional. The default value is set
to "true", it must be set to "false" to disable the validation checks.
description: Deprecated.
type: boolean
useServerSideApply:
description: UseServerSideApply controls whether to use server-side

View file

@ -4348,9 +4348,7 @@ spec:
type: object
type: array
schemaValidation:
description: SchemaValidation skips validation checks for policies
as well as patched resources. Optional. The default value is set
to "true", it must be set to "false" to disable the validation checks.
description: Deprecated.
type: boolean
useServerSideApply:
description: UseServerSideApply controls whether to use server-side
@ -13064,9 +13062,7 @@ spec:
type: object
type: array
schemaValidation:
description: SchemaValidation skips validation checks for policies
as well as patched resources. Optional. The default value is set
to "true", it must be set to "false" to disable the validation checks.
description: Deprecated.
type: boolean
useServerSideApply:
description: UseServerSideApply controls whether to use server-side

View file

@ -4349,9 +4349,7 @@ spec:
type: object
type: array
schemaValidation:
description: SchemaValidation skips validation checks for policies
as well as patched resources. Optional. The default value is set
to "true", it must be set to "false" to disable the validation checks.
description: Deprecated.
type: boolean
useServerSideApply:
description: UseServerSideApply controls whether to use server-side
@ -13067,9 +13065,7 @@ spec:
type: object
type: array
schemaValidation:
description: SchemaValidation skips validation checks for policies
as well as patched resources. Optional. The default value is set
to "true", it must be set to "false" to disable the validation checks.
description: Deprecated.
type: boolean
useServerSideApply:
description: UseServerSideApply controls whether to use server-side

View file

@ -4348,9 +4348,7 @@ spec:
type: object
type: array
schemaValidation:
description: SchemaValidation skips validation checks for policies
as well as patched resources. Optional. The default value is set
to "true", it must be set to "false" to disable the validation checks.
description: Deprecated.
type: boolean
useServerSideApply:
description: UseServerSideApply controls whether to use server-side
@ -13064,9 +13062,7 @@ spec:
type: object
type: array
schemaValidation:
description: SchemaValidation skips validation checks for policies
as well as patched resources. Optional. The default value is set
to "true", it must be set to "false" to disable the validation checks.
description: Deprecated.
type: boolean
useServerSideApply:
description: UseServerSideApply controls whether to use server-side

View file

@ -4349,9 +4349,7 @@ spec:
type: object
type: array
schemaValidation:
description: SchemaValidation skips validation checks for policies
as well as patched resources. Optional. The default value is set
to "true", it must be set to "false" to disable the validation checks.
description: Deprecated.
type: boolean
useServerSideApply:
description: UseServerSideApply controls whether to use server-side
@ -13067,9 +13065,7 @@ spec:
type: object
type: array
schemaValidation:
description: SchemaValidation skips validation checks for policies
as well as patched resources. Optional. The default value is set
to "true", it must be set to "false" to disable the validation checks.
description: Deprecated.
type: boolean
useServerSideApply:
description: UseServerSideApply controls whether to use server-side

View file

@ -10873,9 +10873,7 @@ spec:
type: object
type: array
schemaValidation:
description: SchemaValidation skips validation checks for policies
as well as patched resources. Optional. The default value is set
to "true", it must be set to "false" to disable the validation checks.
description: Deprecated.
type: boolean
useServerSideApply:
description: UseServerSideApply controls whether to use server-side
@ -19589,9 +19587,7 @@ spec:
type: object
type: array
schemaValidation:
description: SchemaValidation skips validation checks for policies
as well as patched resources. Optional. The default value is set
to "true", it must be set to "false" to disable the validation checks.
description: Deprecated.
type: boolean
useServerSideApply:
description: UseServerSideApply controls whether to use server-side
@ -28607,9 +28603,7 @@ spec:
type: object
type: array
schemaValidation:
description: SchemaValidation skips validation checks for policies
as well as patched resources. Optional. The default value is set
to "true", it must be set to "false" to disable the validation checks.
description: Deprecated.
type: boolean
useServerSideApply:
description: UseServerSideApply controls whether to use server-side
@ -37325,9 +37319,7 @@ spec:
type: object
type: array
schemaValidation:
description: SchemaValidation skips validation checks for policies
as well as patched resources. Optional. The default value is set
to "true", it must be set to "false" to disable the validation checks.
description: Deprecated.
type: boolean
useServerSideApply:
description: UseServerSideApply controls whether to use server-side

View file

@ -218,9 +218,7 @@ bool
</em>
</td>
<td>
<em>(Optional)</em>
<p>SchemaValidation skips validation checks for policies as well as patched resources.
Optional. The default value is set to &ldquo;true&rdquo;, it must be set to &ldquo;false&rdquo; to disable the validation checks.</p>
<p>Deprecated.</p>
</td>
</tr>
<tr>
@ -483,9 +481,7 @@ bool
</em>
</td>
<td>
<em>(Optional)</em>
<p>SchemaValidation skips validation checks for policies as well as patched resources.
Optional. The default value is set to &ldquo;true&rdquo;, it must be set to &ldquo;false&rdquo; to disable the validation checks.</p>
<p>Deprecated.</p>
</td>
</tr>
<tr>
@ -3781,9 +3777,7 @@ bool
</em>
</td>
<td>
<em>(Optional)</em>
<p>SchemaValidation skips validation checks for policies as well as patched resources.
Optional. The default value is set to &ldquo;true&rdquo;, it must be set to &ldquo;false&rdquo; to disable the validation checks.</p>
<p>Deprecated.</p>
</td>
</tr>
<tr>
@ -6331,9 +6325,7 @@ bool
</em>
</td>
<td>
<em>(Optional)</em>
<p>SchemaValidation skips validation checks for policies as well as patched resources.
Optional. The default value is set to &ldquo;true&rdquo;, it must be set to &ldquo;false&rdquo; to disable the validation checks.</p>
<p>Deprecated.</p>
</td>
</tr>
<tr>
@ -6595,9 +6587,7 @@ bool
</em>
</td>
<td>
<em>(Optional)</em>
<p>SchemaValidation skips validation checks for policies as well as patched resources.
Optional. The default value is set to &ldquo;true&rdquo;, it must be set to &ldquo;false&rdquo; to disable the validation checks.</p>
<p>Deprecated.</p>
</td>
</tr>
<tr>
@ -7920,9 +7910,7 @@ bool
</em>
</td>
<td>
<em>(Optional)</em>
<p>SchemaValidation skips validation checks for policies as well as patched resources.
Optional. The default value is set to &ldquo;true&rdquo;, it must be set to &ldquo;false&rdquo; to disable the validation checks.</p>
<p>Deprecated.</p>
</td>
</tr>
<tr>