Documentation ¶
Overview ¶
+k8s:deepcopy-gen=package +kubebuilder:object:generate=true +groupName=kyverno.io
Copyright 2022 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+kubebuilder:object:generate=true +groupName=kyverno.io
Index ¶
- Variables
- func Kind(kind string) schema.GroupKind
- func Resource(resource string) schema.GroupResource
- func ValidateSchedule(path *field.Path, schedule string) (errs field.ErrorList)
- type CleanupPolicy
- func (in *CleanupPolicy) DeepCopy() *CleanupPolicy
- func (in *CleanupPolicy) DeepCopyInto(out *CleanupPolicy)
- func (in *CleanupPolicy) DeepCopyObject() runtime.Object
- func (p *CleanupPolicy) GetAPIVersion() string
- func (p *CleanupPolicy) GetKind() string
- func (p *CleanupPolicy) GetSpec() *CleanupPolicySpec
- func (p *CleanupPolicy) GetStatus() *CleanupPolicyStatus
- func (p *CleanupPolicy) Validate(clusterResources sets.Set[string]) (errs field.ErrorList)
- type CleanupPolicyInterface
- type CleanupPolicyList
- type CleanupPolicySpec
- func (in *CleanupPolicySpec) DeepCopy() *CleanupPolicySpec
- func (in *CleanupPolicySpec) DeepCopyInto(out *CleanupPolicySpec)
- func (p *CleanupPolicySpec) Validate(path *field.Path, clusterResources sets.Set[string], namespaced bool) (errs field.ErrorList)
- func (spec *CleanupPolicySpec) ValidateMatchExcludeConflict(path *field.Path) (errs field.ErrorList)
- type CleanupPolicyStatus
- type ClusterCleanupPolicy
- func (in *ClusterCleanupPolicy) DeepCopy() *ClusterCleanupPolicy
- func (in *ClusterCleanupPolicy) DeepCopyInto(out *ClusterCleanupPolicy)
- func (in *ClusterCleanupPolicy) DeepCopyObject() runtime.Object
- func (p *ClusterCleanupPolicy) GetAPIVersion() string
- func (p *ClusterCleanupPolicy) GetKind() string
- func (p *ClusterCleanupPolicy) GetSpec() *CleanupPolicySpec
- func (p *ClusterCleanupPolicy) GetStatus() *CleanupPolicyStatus
- func (p *ClusterCleanupPolicy) Validate(clusterResources sets.Set[string]) (errs field.ErrorList)
- type ClusterCleanupPolicyList
- type Exception
- type PolicyException
- func (p *PolicyException) Contains(policy string, rule string) bool
- func (in *PolicyException) DeepCopy() *PolicyException
- func (in *PolicyException) DeepCopyInto(out *PolicyException)
- func (in *PolicyException) DeepCopyObject() runtime.Object
- func (p *PolicyException) Validate() (errs field.ErrorList)
- type PolicyExceptionList
- type PolicyExceptionSpec
Constants ¶
This section is empty.
Variables ¶
var ( // SchemeBuilder builds the scheme SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) // AddToScheme adds all types of this clientset into the given scheme AddToScheme = SchemeBuilder.AddToScheme )
var SchemeGroupVersion = schema.GroupVersion{Group: kyverno.GroupName, Version: "v2alpha1"}
SchemeGroupVersion is group version used to register these objects
Functions ¶
func Resource ¶
func Resource(resource string) schema.GroupResource
Resource takes an unqualified resource and returns a Group qualified GroupResource
Types ¶
type CleanupPolicy ¶
type CleanupPolicy struct { metav1.TypeMeta `json:",inline,omitempty"` metav1.ObjectMeta `json:"metadata,omitempty"` // Spec declares policy behaviors. Spec CleanupPolicySpec `json:"spec"` // Status contains policy runtime data. // +optional Status CleanupPolicyStatus `json:"status,omitempty"` }
CleanupPolicy defines a rule for resource cleanup.
func (*CleanupPolicy) DeepCopy ¶
func (in *CleanupPolicy) DeepCopy() *CleanupPolicy
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CleanupPolicy.
func (*CleanupPolicy) DeepCopyInto ¶
func (in *CleanupPolicy) DeepCopyInto(out *CleanupPolicy)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*CleanupPolicy) DeepCopyObject ¶
func (in *CleanupPolicy) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*CleanupPolicy) GetAPIVersion ¶
func (p *CleanupPolicy) GetAPIVersion() string
GetAPIVersion returns the resource kind
func (*CleanupPolicy) GetKind ¶
func (p *CleanupPolicy) GetKind() string
GetKind returns the resource kind
func (*CleanupPolicy) GetSpec ¶
func (p *CleanupPolicy) GetSpec() *CleanupPolicySpec
GetSpec returns the policy spec
func (*CleanupPolicy) GetStatus ¶
func (p *CleanupPolicy) GetStatus() *CleanupPolicyStatus
GetStatus returns the policy status
type CleanupPolicyInterface ¶
type CleanupPolicyInterface interface { metav1.Object GetSpec() *CleanupPolicySpec GetStatus() *CleanupPolicyStatus Validate(sets.Set[string]) field.ErrorList GetKind() string GetAPIVersion() string }
CleanupPolicyInterface abstracts the concrete policy type (Policy vs ClusterPolicy) +kubebuilder:object:generate=false
type CleanupPolicyList ¶
type CleanupPolicyList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata"` Items []CleanupPolicy `json:"items"` }
CleanupPolicyList is a list of ClusterPolicy instances.
func (*CleanupPolicyList) DeepCopy ¶
func (in *CleanupPolicyList) DeepCopy() *CleanupPolicyList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CleanupPolicyList.
func (*CleanupPolicyList) DeepCopyInto ¶
func (in *CleanupPolicyList) DeepCopyInto(out *CleanupPolicyList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*CleanupPolicyList) DeepCopyObject ¶
func (in *CleanupPolicyList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type CleanupPolicySpec ¶
type CleanupPolicySpec struct { // MatchResources defines when cleanuppolicy should be applied. The match // criteria can include resource information (e.g. kind, name, namespace, labels) // and admission review request information like the user name or role. // At least one kind is required. MatchResources kyvernov2beta1.MatchResources `json:"match,omitempty"` // ExcludeResources defines when cleanuppolicy should not be applied. The exclude // criteria can include resource information (e.g. kind, name, namespace, labels) // and admission review request information like the name or role. // +optional ExcludeResources *kyvernov2beta1.MatchResources `json:"exclude,omitempty"` // The schedule in Cron format Schedule string `json:"schedule"` // Conditions defines the conditions used to select the resources which will be cleaned up. // +optional Conditions *kyvernov2beta1.AnyAllConditions `json:"conditions,omitempty"` }
CleanupPolicySpec stores specifications for selecting resources that the user needs to delete and schedule when the matching resources needs deleted.
func (*CleanupPolicySpec) DeepCopy ¶
func (in *CleanupPolicySpec) DeepCopy() *CleanupPolicySpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CleanupPolicySpec.
func (*CleanupPolicySpec) DeepCopyInto ¶
func (in *CleanupPolicySpec) DeepCopyInto(out *CleanupPolicySpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*CleanupPolicySpec) Validate ¶
func (p *CleanupPolicySpec) Validate(path *field.Path, clusterResources sets.Set[string], namespaced bool) (errs field.ErrorList)
Validate implements programmatic validation
func (*CleanupPolicySpec) ValidateMatchExcludeConflict ¶
func (spec *CleanupPolicySpec) ValidateMatchExcludeConflict(path *field.Path) (errs field.ErrorList)
ValidateMatchExcludeConflict checks if the resultant of match and exclude block is not an empty set
type CleanupPolicyStatus ¶
type CleanupPolicyStatus struct {
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
}
CleanupPolicyStatus stores the status of the policy.
func (*CleanupPolicyStatus) DeepCopy ¶
func (in *CleanupPolicyStatus) DeepCopy() *CleanupPolicyStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CleanupPolicyStatus.
func (*CleanupPolicyStatus) DeepCopyInto ¶
func (in *CleanupPolicyStatus) DeepCopyInto(out *CleanupPolicyStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ClusterCleanupPolicy ¶
type ClusterCleanupPolicy struct { metav1.TypeMeta `json:",inline,omitempty"` metav1.ObjectMeta `json:"metadata,omitempty"` // Spec declares policy behaviors. Spec CleanupPolicySpec `json:"spec"` // Status contains policy runtime data. // +optional Status CleanupPolicyStatus `json:"status,omitempty"` }
ClusterCleanupPolicy defines rule for resource cleanup.
func (*ClusterCleanupPolicy) DeepCopy ¶
func (in *ClusterCleanupPolicy) DeepCopy() *ClusterCleanupPolicy
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterCleanupPolicy.
func (*ClusterCleanupPolicy) DeepCopyInto ¶
func (in *ClusterCleanupPolicy) DeepCopyInto(out *ClusterCleanupPolicy)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ClusterCleanupPolicy) DeepCopyObject ¶
func (in *ClusterCleanupPolicy) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*ClusterCleanupPolicy) GetAPIVersion ¶
func (p *ClusterCleanupPolicy) GetAPIVersion() string
GetAPIVersion returns the resource kind
func (*ClusterCleanupPolicy) GetKind ¶
func (p *ClusterCleanupPolicy) GetKind() string
GetKind returns the resource kind
func (*ClusterCleanupPolicy) GetSpec ¶
func (p *ClusterCleanupPolicy) GetSpec() *CleanupPolicySpec
GetSpec returns the policy spec
func (*ClusterCleanupPolicy) GetStatus ¶
func (p *ClusterCleanupPolicy) GetStatus() *CleanupPolicyStatus
GetStatus returns the policy status
type ClusterCleanupPolicyList ¶
type ClusterCleanupPolicyList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata"` Items []ClusterCleanupPolicy `json:"items"` }
ClusterCleanupPolicyList is a list of ClusterCleanupPolicy instances.
func (*ClusterCleanupPolicyList) DeepCopy ¶
func (in *ClusterCleanupPolicyList) DeepCopy() *ClusterCleanupPolicyList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterCleanupPolicyList.
func (*ClusterCleanupPolicyList) DeepCopyInto ¶
func (in *ClusterCleanupPolicyList) DeepCopyInto(out *ClusterCleanupPolicyList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ClusterCleanupPolicyList) DeepCopyObject ¶
func (in *ClusterCleanupPolicyList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type Exception ¶
type Exception struct { // PolicyName identifies the policy to which the exception is applied. // The policy name uses the format <namespace>/<name> unless it // references a ClusterPolicy. PolicyName string `json:"policyName"` // RuleNames identifies the rules to which the exception is applied. RuleNames []string `json:"ruleNames"` }
Exception stores infos about a policy and rules
func (*Exception) Contains ¶
Contains returns true if it contains an exception for the given policy/rule pair
func (*Exception) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Exception.
func (*Exception) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PolicyException ¶
type PolicyException struct { metav1.TypeMeta `json:",inline,omitempty"` metav1.ObjectMeta `json:"metadata,omitempty"` // Spec declares policy exception behaviors. Spec PolicyExceptionSpec `json:"spec"` }
PolicyException declares resources to be excluded from specified policies.
func (*PolicyException) Contains ¶
func (p *PolicyException) Contains(policy string, rule string) bool
Contains returns true if it contains an exception for the given policy/rule pair
func (*PolicyException) DeepCopy ¶
func (in *PolicyException) DeepCopy() *PolicyException
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyException.
func (*PolicyException) DeepCopyInto ¶
func (in *PolicyException) DeepCopyInto(out *PolicyException)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*PolicyException) DeepCopyObject ¶
func (in *PolicyException) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*PolicyException) Validate ¶
func (p *PolicyException) Validate() (errs field.ErrorList)
Validate implements programmatic validation
type PolicyExceptionList ¶
type PolicyExceptionList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata"` Items []PolicyException `json:"items"` }
PolicyExceptionList is a list of Policy Exceptions
func (*PolicyExceptionList) DeepCopy ¶
func (in *PolicyExceptionList) DeepCopy() *PolicyExceptionList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyExceptionList.
func (*PolicyExceptionList) DeepCopyInto ¶
func (in *PolicyExceptionList) DeepCopyInto(out *PolicyExceptionList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*PolicyExceptionList) DeepCopyObject ¶
func (in *PolicyExceptionList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type PolicyExceptionSpec ¶
type PolicyExceptionSpec struct { // Match defines match clause used to check if a resource applies to the exception Match kyvernov2beta1.MatchResources `json:"match"` // Exceptions is a list policy/rules to be excluded Exceptions []Exception `json:"exceptions"` }
PolicyExceptionSpec stores policy exception spec
func (*PolicyExceptionSpec) Contains ¶
func (p *PolicyExceptionSpec) Contains(policy string, rule string) bool
Contains returns true if it contains an exception for the given policy/rule pair
func (*PolicyExceptionSpec) DeepCopy ¶
func (in *PolicyExceptionSpec) DeepCopy() *PolicyExceptionSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyExceptionSpec.
func (*PolicyExceptionSpec) DeepCopyInto ¶
func (in *PolicyExceptionSpec) DeepCopyInto(out *PolicyExceptionSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.