mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-30 19:35:06 +00:00
chore: bump cleanup policies to v2beta1 (#8594)
* chore: bump cleanup policies to v2beta1 Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com> * chore: remove the support of v2alpha1 cleanup policies Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com> --------- Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
This commit is contained in:
parent
8cbe66a06a
commit
fff3ad047e
58 changed files with 905 additions and 909 deletions
|
@ -22,192 +22,10 @@ limitations under the License.
|
||||||
package v2alpha1
|
package v2alpha1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
v1 "github.com/kyverno/kyverno/api/kyverno/v1"
|
|
||||||
v2beta1 "github.com/kyverno/kyverno/api/kyverno/v2beta1"
|
v2beta1 "github.com/kyverno/kyverno/api/kyverno/v2beta1"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
||||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
|
||||||
func (in *CleanupPolicy) DeepCopyInto(out *CleanupPolicy) {
|
|
||||||
*out = *in
|
|
||||||
out.TypeMeta = in.TypeMeta
|
|
||||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
|
||||||
in.Spec.DeepCopyInto(&out.Spec)
|
|
||||||
in.Status.DeepCopyInto(&out.Status)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CleanupPolicy.
|
|
||||||
func (in *CleanupPolicy) DeepCopy() *CleanupPolicy {
|
|
||||||
if in == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
out := new(CleanupPolicy)
|
|
||||||
in.DeepCopyInto(out)
|
|
||||||
return out
|
|
||||||
}
|
|
||||||
|
|
||||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
|
||||||
func (in *CleanupPolicy) DeepCopyObject() runtime.Object {
|
|
||||||
if c := in.DeepCopy(); c != nil {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
|
||||||
func (in *CleanupPolicyList) DeepCopyInto(out *CleanupPolicyList) {
|
|
||||||
*out = *in
|
|
||||||
out.TypeMeta = in.TypeMeta
|
|
||||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
|
||||||
if in.Items != nil {
|
|
||||||
in, out := &in.Items, &out.Items
|
|
||||||
*out = make([]CleanupPolicy, len(*in))
|
|
||||||
for i := range *in {
|
|
||||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CleanupPolicyList.
|
|
||||||
func (in *CleanupPolicyList) DeepCopy() *CleanupPolicyList {
|
|
||||||
if in == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
out := new(CleanupPolicyList)
|
|
||||||
in.DeepCopyInto(out)
|
|
||||||
return out
|
|
||||||
}
|
|
||||||
|
|
||||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
|
||||||
func (in *CleanupPolicyList) DeepCopyObject() runtime.Object {
|
|
||||||
if c := in.DeepCopy(); c != nil {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
|
||||||
func (in *CleanupPolicySpec) DeepCopyInto(out *CleanupPolicySpec) {
|
|
||||||
*out = *in
|
|
||||||
if in.Context != nil {
|
|
||||||
in, out := &in.Context, &out.Context
|
|
||||||
*out = make([]v1.ContextEntry, len(*in))
|
|
||||||
for i := range *in {
|
|
||||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
in.MatchResources.DeepCopyInto(&out.MatchResources)
|
|
||||||
if in.ExcludeResources != nil {
|
|
||||||
in, out := &in.ExcludeResources, &out.ExcludeResources
|
|
||||||
*out = new(v2beta1.MatchResources)
|
|
||||||
(*in).DeepCopyInto(*out)
|
|
||||||
}
|
|
||||||
if in.Conditions != nil {
|
|
||||||
in, out := &in.Conditions, &out.Conditions
|
|
||||||
*out = new(v2beta1.AnyAllConditions)
|
|
||||||
(*in).DeepCopyInto(*out)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CleanupPolicySpec.
|
|
||||||
func (in *CleanupPolicySpec) DeepCopy() *CleanupPolicySpec {
|
|
||||||
if in == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
out := new(CleanupPolicySpec)
|
|
||||||
in.DeepCopyInto(out)
|
|
||||||
return out
|
|
||||||
}
|
|
||||||
|
|
||||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
|
||||||
func (in *CleanupPolicyStatus) DeepCopyInto(out *CleanupPolicyStatus) {
|
|
||||||
*out = *in
|
|
||||||
if in.Conditions != nil {
|
|
||||||
in, out := &in.Conditions, &out.Conditions
|
|
||||||
*out = make([]metav1.Condition, len(*in))
|
|
||||||
for i := range *in {
|
|
||||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
in.LastExecutionTime.DeepCopyInto(&out.LastExecutionTime)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CleanupPolicyStatus.
|
|
||||||
func (in *CleanupPolicyStatus) DeepCopy() *CleanupPolicyStatus {
|
|
||||||
if in == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
out := new(CleanupPolicyStatus)
|
|
||||||
in.DeepCopyInto(out)
|
|
||||||
return out
|
|
||||||
}
|
|
||||||
|
|
||||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
|
||||||
func (in *ClusterCleanupPolicy) DeepCopyInto(out *ClusterCleanupPolicy) {
|
|
||||||
*out = *in
|
|
||||||
out.TypeMeta = in.TypeMeta
|
|
||||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
|
||||||
in.Spec.DeepCopyInto(&out.Spec)
|
|
||||||
in.Status.DeepCopyInto(&out.Status)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterCleanupPolicy.
|
|
||||||
func (in *ClusterCleanupPolicy) DeepCopy() *ClusterCleanupPolicy {
|
|
||||||
if in == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
out := new(ClusterCleanupPolicy)
|
|
||||||
in.DeepCopyInto(out)
|
|
||||||
return out
|
|
||||||
}
|
|
||||||
|
|
||||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
|
||||||
func (in *ClusterCleanupPolicy) DeepCopyObject() runtime.Object {
|
|
||||||
if c := in.DeepCopy(); c != nil {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
|
||||||
func (in *ClusterCleanupPolicyList) DeepCopyInto(out *ClusterCleanupPolicyList) {
|
|
||||||
*out = *in
|
|
||||||
out.TypeMeta = in.TypeMeta
|
|
||||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
|
||||||
if in.Items != nil {
|
|
||||||
in, out := &in.Items, &out.Items
|
|
||||||
*out = make([]ClusterCleanupPolicy, len(*in))
|
|
||||||
for i := range *in {
|
|
||||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterCleanupPolicyList.
|
|
||||||
func (in *ClusterCleanupPolicyList) DeepCopy() *ClusterCleanupPolicyList {
|
|
||||||
if in == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
out := new(ClusterCleanupPolicyList)
|
|
||||||
in.DeepCopyInto(out)
|
|
||||||
return out
|
|
||||||
}
|
|
||||||
|
|
||||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
|
||||||
func (in *ClusterCleanupPolicyList) DeepCopyObject() runtime.Object {
|
|
||||||
if c := in.DeepCopy(); c != nil {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
func (in *PolicyException) DeepCopyInto(out *PolicyException) {
|
func (in *PolicyException) DeepCopyInto(out *PolicyException) {
|
||||||
*out = *in
|
*out = *in
|
||||||
|
|
|
@ -58,10 +58,6 @@ func init() {
|
||||||
// Adds the list of known types to Scheme.
|
// Adds the list of known types to Scheme.
|
||||||
func addKnownTypes(scheme *runtime.Scheme) error {
|
func addKnownTypes(scheme *runtime.Scheme) error {
|
||||||
scheme.AddKnownTypes(SchemeGroupVersion,
|
scheme.AddKnownTypes(SchemeGroupVersion,
|
||||||
&CleanupPolicy{},
|
|
||||||
&CleanupPolicyList{},
|
|
||||||
&ClusterCleanupPolicy{},
|
|
||||||
&ClusterCleanupPolicyList{},
|
|
||||||
&PolicyException{},
|
&PolicyException{},
|
||||||
&PolicyExceptionList{},
|
&PolicyExceptionList{},
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package v2alpha1
|
package v2beta1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
|
@ -1,4 +1,4 @@
|
||||||
package v2alpha1
|
package v2beta1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
@ -78,7 +78,7 @@ func Test_ClusterCleanupPolicy_Schedule(t *testing.T) {
|
||||||
assert.Equal(t, errs[0].Error(), fmt.Sprintf(`spec.schedule: Invalid value: "%s": schedule spec in the cleanupPolicy is not in proper cron format`, subject.Spec.Schedule))
|
assert.Equal(t, errs[0].Error(), fmt.Sprintf(`spec.schedule: Invalid value: "%s": schedule spec in the cleanupPolicy is not in proper cron format`, subject.Spec.Schedule))
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_doesMatchExcludeConflict(t *testing.T) {
|
func Test_doesMatchExcludeConflict_CleanupPolicy(t *testing.T) {
|
||||||
path := field.NewPath("dummy")
|
path := field.NewPath("dummy")
|
||||||
testcases := []struct {
|
testcases := []struct {
|
||||||
description string
|
description string
|
|
@ -14,14 +14,13 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package v2alpha1
|
package v2beta1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/aptible/supercronic/cronexpr"
|
"github.com/aptible/supercronic/cronexpr"
|
||||||
kyvernov1 "github.com/kyverno/kyverno/api/kyverno/v1"
|
kyvernov1 "github.com/kyverno/kyverno/api/kyverno/v1"
|
||||||
kyvernov2beta1 "github.com/kyverno/kyverno/api/kyverno/v2beta1"
|
|
||||||
datautils "github.com/kyverno/kyverno/pkg/utils/data"
|
datautils "github.com/kyverno/kyverno/pkg/utils/data"
|
||||||
"github.com/robfig/cron"
|
"github.com/robfig/cron"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
@ -91,7 +90,7 @@ func (p *CleanupPolicy) Validate(clusterResources sets.Set[string]) (errs field.
|
||||||
|
|
||||||
// GetKind returns the resource kind
|
// GetKind returns the resource kind
|
||||||
func (p *CleanupPolicy) GetKind() string {
|
func (p *CleanupPolicy) GetKind() string {
|
||||||
return "CleanupPolicy"
|
return p.Kind
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetAPIVersion returns the resource kind
|
// GetAPIVersion returns the resource kind
|
||||||
|
@ -170,7 +169,7 @@ func (p *ClusterCleanupPolicy) GetNextExecutionTime(time time.Time) (*time.Time,
|
||||||
|
|
||||||
// GetKind returns the resource kind
|
// GetKind returns the resource kind
|
||||||
func (p *ClusterCleanupPolicy) GetKind() string {
|
func (p *ClusterCleanupPolicy) GetKind() string {
|
||||||
return "ClusterCleanupPolicy"
|
return p.Kind
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetAPIVersion returns the resource kind
|
// GetAPIVersion returns the resource kind
|
||||||
|
@ -211,20 +210,20 @@ type CleanupPolicySpec struct {
|
||||||
// criteria can include resource information (e.g. kind, name, namespace, labels)
|
// criteria can include resource information (e.g. kind, name, namespace, labels)
|
||||||
// and admission review request information like the user name or role.
|
// and admission review request information like the user name or role.
|
||||||
// At least one kind is required.
|
// At least one kind is required.
|
||||||
MatchResources kyvernov2beta1.MatchResources `json:"match,omitempty"`
|
MatchResources MatchResources `json:"match,omitempty"`
|
||||||
|
|
||||||
// ExcludeResources defines when cleanuppolicy should not be applied. The exclude
|
// ExcludeResources defines when cleanuppolicy should not be applied. The exclude
|
||||||
// criteria can include resource information (e.g. kind, name, namespace, labels)
|
// criteria can include resource information (e.g. kind, name, namespace, labels)
|
||||||
// and admission review request information like the name or role.
|
// and admission review request information like the name or role.
|
||||||
// +optional
|
// +optional
|
||||||
ExcludeResources *kyvernov2beta1.MatchResources `json:"exclude,omitempty"`
|
ExcludeResources *MatchResources `json:"exclude,omitempty"`
|
||||||
|
|
||||||
// The schedule in Cron format
|
// The schedule in Cron format
|
||||||
Schedule string `json:"schedule"`
|
Schedule string `json:"schedule"`
|
||||||
|
|
||||||
// Conditions defines the conditions used to select the resources which will be cleaned up.
|
// Conditions defines the conditions used to select the resources which will be cleaned up.
|
||||||
// +optional
|
// +optional
|
||||||
Conditions *kyvernov2beta1.AnyAllConditions `json:"conditions,omitempty"`
|
Conditions *AnyAllConditions `json:"conditions,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CleanupPolicyStatus stores the status of the policy.
|
// CleanupPolicyStatus stores the status of the policy.
|
||||||
|
@ -289,7 +288,7 @@ func (spec *CleanupPolicySpec) ValidateMatchExcludeConflict(path *field.Path) (e
|
||||||
}
|
}
|
||||||
return errs
|
return errs
|
||||||
}
|
}
|
||||||
if datautils.DeepEqual(spec.ExcludeResources, &kyvernov2beta1.MatchResources{}) {
|
if datautils.DeepEqual(spec.ExcludeResources, &MatchResources{}) {
|
||||||
return errs
|
return errs
|
||||||
}
|
}
|
||||||
return append(errs, field.Invalid(path, spec, "CleanupPolicy is matching an empty set"))
|
return append(errs, field.Invalid(path, spec, "CleanupPolicy is matching an empty set"))
|
|
@ -22,9 +22,9 @@ limitations under the License.
|
||||||
package v2beta1
|
package v2beta1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
kyvernov1 "github.com/kyverno/kyverno/api/kyverno/v1"
|
v1 "github.com/kyverno/kyverno/api/kyverno/v1"
|
||||||
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
|
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
|
||||||
v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
|
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||||
)
|
)
|
||||||
|
@ -59,6 +59,186 @@ func (in *AnyAllConditions) DeepCopy() *AnyAllConditions {
|
||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
|
func (in *CleanupPolicy) DeepCopyInto(out *CleanupPolicy) {
|
||||||
|
*out = *in
|
||||||
|
out.TypeMeta = in.TypeMeta
|
||||||
|
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||||
|
in.Spec.DeepCopyInto(&out.Spec)
|
||||||
|
in.Status.DeepCopyInto(&out.Status)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CleanupPolicy.
|
||||||
|
func (in *CleanupPolicy) DeepCopy() *CleanupPolicy {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(CleanupPolicy)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||||
|
func (in *CleanupPolicy) DeepCopyObject() runtime.Object {
|
||||||
|
if c := in.DeepCopy(); c != nil {
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
|
func (in *CleanupPolicyList) DeepCopyInto(out *CleanupPolicyList) {
|
||||||
|
*out = *in
|
||||||
|
out.TypeMeta = in.TypeMeta
|
||||||
|
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||||
|
if in.Items != nil {
|
||||||
|
in, out := &in.Items, &out.Items
|
||||||
|
*out = make([]CleanupPolicy, len(*in))
|
||||||
|
for i := range *in {
|
||||||
|
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CleanupPolicyList.
|
||||||
|
func (in *CleanupPolicyList) DeepCopy() *CleanupPolicyList {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(CleanupPolicyList)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||||
|
func (in *CleanupPolicyList) DeepCopyObject() runtime.Object {
|
||||||
|
if c := in.DeepCopy(); c != nil {
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
|
func (in *CleanupPolicySpec) DeepCopyInto(out *CleanupPolicySpec) {
|
||||||
|
*out = *in
|
||||||
|
if in.Context != nil {
|
||||||
|
in, out := &in.Context, &out.Context
|
||||||
|
*out = make([]v1.ContextEntry, len(*in))
|
||||||
|
for i := range *in {
|
||||||
|
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
in.MatchResources.DeepCopyInto(&out.MatchResources)
|
||||||
|
if in.ExcludeResources != nil {
|
||||||
|
in, out := &in.ExcludeResources, &out.ExcludeResources
|
||||||
|
*out = new(MatchResources)
|
||||||
|
(*in).DeepCopyInto(*out)
|
||||||
|
}
|
||||||
|
if in.Conditions != nil {
|
||||||
|
in, out := &in.Conditions, &out.Conditions
|
||||||
|
*out = new(AnyAllConditions)
|
||||||
|
(*in).DeepCopyInto(*out)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CleanupPolicySpec.
|
||||||
|
func (in *CleanupPolicySpec) DeepCopy() *CleanupPolicySpec {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(CleanupPolicySpec)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
|
func (in *CleanupPolicyStatus) DeepCopyInto(out *CleanupPolicyStatus) {
|
||||||
|
*out = *in
|
||||||
|
if in.Conditions != nil {
|
||||||
|
in, out := &in.Conditions, &out.Conditions
|
||||||
|
*out = make([]metav1.Condition, len(*in))
|
||||||
|
for i := range *in {
|
||||||
|
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
in.LastExecutionTime.DeepCopyInto(&out.LastExecutionTime)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CleanupPolicyStatus.
|
||||||
|
func (in *CleanupPolicyStatus) DeepCopy() *CleanupPolicyStatus {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(CleanupPolicyStatus)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
|
func (in *ClusterCleanupPolicy) DeepCopyInto(out *ClusterCleanupPolicy) {
|
||||||
|
*out = *in
|
||||||
|
out.TypeMeta = in.TypeMeta
|
||||||
|
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||||
|
in.Spec.DeepCopyInto(&out.Spec)
|
||||||
|
in.Status.DeepCopyInto(&out.Status)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterCleanupPolicy.
|
||||||
|
func (in *ClusterCleanupPolicy) DeepCopy() *ClusterCleanupPolicy {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(ClusterCleanupPolicy)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||||
|
func (in *ClusterCleanupPolicy) DeepCopyObject() runtime.Object {
|
||||||
|
if c := in.DeepCopy(); c != nil {
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
|
func (in *ClusterCleanupPolicyList) DeepCopyInto(out *ClusterCleanupPolicyList) {
|
||||||
|
*out = *in
|
||||||
|
out.TypeMeta = in.TypeMeta
|
||||||
|
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||||
|
if in.Items != nil {
|
||||||
|
in, out := &in.Items, &out.Items
|
||||||
|
*out = make([]ClusterCleanupPolicy, len(*in))
|
||||||
|
for i := range *in {
|
||||||
|
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterCleanupPolicyList.
|
||||||
|
func (in *ClusterCleanupPolicyList) DeepCopy() *ClusterCleanupPolicyList {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(ClusterCleanupPolicyList)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||||
|
func (in *ClusterCleanupPolicyList) DeepCopyObject() runtime.Object {
|
||||||
|
if c := in.DeepCopy(); c != nil {
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
func (in *ClusterPolicy) DeepCopyInto(out *ClusterPolicy) {
|
func (in *ClusterPolicy) DeepCopyInto(out *ClusterPolicy) {
|
||||||
*out = *in
|
*out = *in
|
||||||
|
@ -125,12 +305,12 @@ func (in *Condition) DeepCopyInto(out *Condition) {
|
||||||
*out = *in
|
*out = *in
|
||||||
if in.RawKey != nil {
|
if in.RawKey != nil {
|
||||||
in, out := &in.RawKey, &out.RawKey
|
in, out := &in.RawKey, &out.RawKey
|
||||||
*out = new(v1.JSON)
|
*out = new(apiextensionsv1.JSON)
|
||||||
(*in).DeepCopyInto(*out)
|
(*in).DeepCopyInto(*out)
|
||||||
}
|
}
|
||||||
if in.RawValue != nil {
|
if in.RawValue != nil {
|
||||||
in, out := &in.RawValue, &out.RawValue
|
in, out := &in.RawValue, &out.RawValue
|
||||||
*out = new(v1.JSON)
|
*out = new(apiextensionsv1.JSON)
|
||||||
(*in).DeepCopyInto(*out)
|
(*in).DeepCopyInto(*out)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
@ -198,21 +378,21 @@ func (in *ImageVerification) DeepCopyInto(out *ImageVerification) {
|
||||||
}
|
}
|
||||||
if in.Attestors != nil {
|
if in.Attestors != nil {
|
||||||
in, out := &in.Attestors, &out.Attestors
|
in, out := &in.Attestors, &out.Attestors
|
||||||
*out = make([]kyvernov1.AttestorSet, len(*in))
|
*out = make([]v1.AttestorSet, len(*in))
|
||||||
for i := range *in {
|
for i := range *in {
|
||||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if in.Attestations != nil {
|
if in.Attestations != nil {
|
||||||
in, out := &in.Attestations, &out.Attestations
|
in, out := &in.Attestations, &out.Attestations
|
||||||
*out = make([]kyvernov1.Attestation, len(*in))
|
*out = make([]v1.Attestation, len(*in))
|
||||||
for i := range *in {
|
for i := range *in {
|
||||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if in.ImageRegistryCredentials != nil {
|
if in.ImageRegistryCredentials != nil {
|
||||||
in, out := &in.ImageRegistryCredentials, &out.ImageRegistryCredentials
|
in, out := &in.ImageRegistryCredentials, &out.ImageRegistryCredentials
|
||||||
*out = new(kyvernov1.ImageRegistryCredentials)
|
*out = new(v1.ImageRegistryCredentials)
|
||||||
(*in).DeepCopyInto(*out)
|
(*in).DeepCopyInto(*out)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
@ -233,14 +413,14 @@ func (in *MatchResources) DeepCopyInto(out *MatchResources) {
|
||||||
*out = *in
|
*out = *in
|
||||||
if in.Any != nil {
|
if in.Any != nil {
|
||||||
in, out := &in.Any, &out.Any
|
in, out := &in.Any, &out.Any
|
||||||
*out = make(kyvernov1.ResourceFilters, len(*in))
|
*out = make(v1.ResourceFilters, len(*in))
|
||||||
for i := range *in {
|
for i := range *in {
|
||||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if in.All != nil {
|
if in.All != nil {
|
||||||
in, out := &in.All, &out.All
|
in, out := &in.All, &out.All
|
||||||
*out = make(kyvernov1.ResourceFilters, len(*in))
|
*out = make(v1.ResourceFilters, len(*in))
|
||||||
for i := range *in {
|
for i := range *in {
|
||||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||||
}
|
}
|
||||||
|
@ -445,7 +625,7 @@ func (in *ResourceDescription) DeepCopyInto(out *ResourceDescription) {
|
||||||
}
|
}
|
||||||
if in.Operations != nil {
|
if in.Operations != nil {
|
||||||
in, out := &in.Operations, &out.Operations
|
in, out := &in.Operations, &out.Operations
|
||||||
*out = make([]kyvernov1.AdmissionOperation, len(*in))
|
*out = make([]v1.AdmissionOperation, len(*in))
|
||||||
copy(*out, *in)
|
copy(*out, *in)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
@ -506,7 +686,7 @@ func (in *Rule) DeepCopyInto(out *Rule) {
|
||||||
*out = *in
|
*out = *in
|
||||||
if in.Context != nil {
|
if in.Context != nil {
|
||||||
in, out := &in.Context, &out.Context
|
in, out := &in.Context, &out.Context
|
||||||
*out = make([]kyvernov1.ContextEntry, len(*in))
|
*out = make([]v1.ContextEntry, len(*in))
|
||||||
for i := range *in {
|
for i := range *in {
|
||||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||||
}
|
}
|
||||||
|
@ -515,14 +695,14 @@ func (in *Rule) DeepCopyInto(out *Rule) {
|
||||||
in.ExcludeResources.DeepCopyInto(&out.ExcludeResources)
|
in.ExcludeResources.DeepCopyInto(&out.ExcludeResources)
|
||||||
if in.ImageExtractors != nil {
|
if in.ImageExtractors != nil {
|
||||||
in, out := &in.ImageExtractors, &out.ImageExtractors
|
in, out := &in.ImageExtractors, &out.ImageExtractors
|
||||||
*out = make(kyvernov1.ImageExtractorConfigs, len(*in))
|
*out = make(v1.ImageExtractorConfigs, len(*in))
|
||||||
for key, val := range *in {
|
for key, val := range *in {
|
||||||
var outVal []kyvernov1.ImageExtractorConfig
|
var outVal []v1.ImageExtractorConfig
|
||||||
if val == nil {
|
if val == nil {
|
||||||
(*out)[key] = nil
|
(*out)[key] = nil
|
||||||
} else {
|
} else {
|
||||||
in, out := &val, &outVal
|
in, out := &val, &outVal
|
||||||
*out = make([]kyvernov1.ImageExtractorConfig, len(*in))
|
*out = make([]v1.ImageExtractorConfig, len(*in))
|
||||||
copy(*out, *in)
|
copy(*out, *in)
|
||||||
}
|
}
|
||||||
(*out)[key] = outVal
|
(*out)[key] = outVal
|
||||||
|
@ -573,17 +753,17 @@ func (in *Spec) DeepCopyInto(out *Spec) {
|
||||||
}
|
}
|
||||||
if in.ApplyRules != nil {
|
if in.ApplyRules != nil {
|
||||||
in, out := &in.ApplyRules, &out.ApplyRules
|
in, out := &in.ApplyRules, &out.ApplyRules
|
||||||
*out = new(kyvernov1.ApplyRulesType)
|
*out = new(v1.ApplyRulesType)
|
||||||
**out = **in
|
**out = **in
|
||||||
}
|
}
|
||||||
if in.FailurePolicy != nil {
|
if in.FailurePolicy != nil {
|
||||||
in, out := &in.FailurePolicy, &out.FailurePolicy
|
in, out := &in.FailurePolicy, &out.FailurePolicy
|
||||||
*out = new(kyvernov1.FailurePolicyType)
|
*out = new(v1.FailurePolicyType)
|
||||||
**out = **in
|
**out = **in
|
||||||
}
|
}
|
||||||
if in.ValidationFailureActionOverrides != nil {
|
if in.ValidationFailureActionOverrides != nil {
|
||||||
in, out := &in.ValidationFailureActionOverrides, &out.ValidationFailureActionOverrides
|
in, out := &in.ValidationFailureActionOverrides, &out.ValidationFailureActionOverrides
|
||||||
*out = make([]kyvernov1.ValidationFailureActionOverride, len(*in))
|
*out = make([]v1.ValidationFailureActionOverride, len(*in))
|
||||||
for i := range *in {
|
for i := range *in {
|
||||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||||
}
|
}
|
||||||
|
@ -631,24 +811,24 @@ func (in *Validation) DeepCopyInto(out *Validation) {
|
||||||
*out = *in
|
*out = *in
|
||||||
if in.Manifests != nil {
|
if in.Manifests != nil {
|
||||||
in, out := &in.Manifests, &out.Manifests
|
in, out := &in.Manifests, &out.Manifests
|
||||||
*out = new(kyvernov1.Manifests)
|
*out = new(v1.Manifests)
|
||||||
(*in).DeepCopyInto(*out)
|
(*in).DeepCopyInto(*out)
|
||||||
}
|
}
|
||||||
if in.ForEachValidation != nil {
|
if in.ForEachValidation != nil {
|
||||||
in, out := &in.ForEachValidation, &out.ForEachValidation
|
in, out := &in.ForEachValidation, &out.ForEachValidation
|
||||||
*out = make([]kyvernov1.ForEachValidation, len(*in))
|
*out = make([]v1.ForEachValidation, len(*in))
|
||||||
for i := range *in {
|
for i := range *in {
|
||||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if in.RawPattern != nil {
|
if in.RawPattern != nil {
|
||||||
in, out := &in.RawPattern, &out.RawPattern
|
in, out := &in.RawPattern, &out.RawPattern
|
||||||
*out = new(v1.JSON)
|
*out = new(apiextensionsv1.JSON)
|
||||||
(*in).DeepCopyInto(*out)
|
(*in).DeepCopyInto(*out)
|
||||||
}
|
}
|
||||||
if in.RawAnyPattern != nil {
|
if in.RawAnyPattern != nil {
|
||||||
in, out := &in.RawAnyPattern, &out.RawAnyPattern
|
in, out := &in.RawAnyPattern, &out.RawAnyPattern
|
||||||
*out = new(v1.JSON)
|
*out = new(apiextensionsv1.JSON)
|
||||||
(*in).DeepCopyInto(*out)
|
(*in).DeepCopyInto(*out)
|
||||||
}
|
}
|
||||||
if in.Deny != nil {
|
if in.Deny != nil {
|
||||||
|
@ -658,12 +838,12 @@ func (in *Validation) DeepCopyInto(out *Validation) {
|
||||||
}
|
}
|
||||||
if in.PodSecurity != nil {
|
if in.PodSecurity != nil {
|
||||||
in, out := &in.PodSecurity, &out.PodSecurity
|
in, out := &in.PodSecurity, &out.PodSecurity
|
||||||
*out = new(kyvernov1.PodSecurity)
|
*out = new(v1.PodSecurity)
|
||||||
(*in).DeepCopyInto(*out)
|
(*in).DeepCopyInto(*out)
|
||||||
}
|
}
|
||||||
if in.CEL != nil {
|
if in.CEL != nil {
|
||||||
in, out := &in.CEL, &out.CEL
|
in, out := &in.CEL, &out.CEL
|
||||||
*out = new(kyvernov1.CEL)
|
*out = new(v1.CEL)
|
||||||
(*in).DeepCopyInto(*out)
|
(*in).DeepCopyInto(*out)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|
|
@ -58,6 +58,10 @@ func init() {
|
||||||
// Adds the list of known types to Scheme.
|
// Adds the list of known types to Scheme.
|
||||||
func addKnownTypes(scheme *runtime.Scheme) error {
|
func addKnownTypes(scheme *runtime.Scheme) error {
|
||||||
scheme.AddKnownTypes(SchemeGroupVersion,
|
scheme.AddKnownTypes(SchemeGroupVersion,
|
||||||
|
&CleanupPolicy{},
|
||||||
|
&CleanupPolicyList{},
|
||||||
|
&ClusterCleanupPolicy{},
|
||||||
|
&ClusterCleanupPolicyList{},
|
||||||
&ClusterPolicy{},
|
&ClusterPolicy{},
|
||||||
&ClusterPolicyList{},
|
&ClusterPolicyList{},
|
||||||
&Policy{},
|
&Policy{},
|
||||||
|
|
|
@ -673,7 +673,7 @@ spec:
|
||||||
- jsonPath: .metadata.creationTimestamp
|
- jsonPath: .metadata.creationTimestamp
|
||||||
name: Age
|
name: Age
|
||||||
type: date
|
type: date
|
||||||
name: v2alpha1
|
name: v2beta1
|
||||||
schema:
|
schema:
|
||||||
openAPIV3Schema:
|
openAPIV3Schema:
|
||||||
description: CleanupPolicy defines a rule for resource cleanup.
|
description: CleanupPolicy defines a rule for resource cleanup.
|
||||||
|
@ -2582,7 +2582,7 @@ spec:
|
||||||
- jsonPath: .metadata.creationTimestamp
|
- jsonPath: .metadata.creationTimestamp
|
||||||
name: Age
|
name: Age
|
||||||
type: date
|
type: date
|
||||||
name: v2alpha1
|
name: v2beta1
|
||||||
schema:
|
schema:
|
||||||
openAPIV3Schema:
|
openAPIV3Schema:
|
||||||
description: ClusterCleanupPolicy defines rule for resource cleanup.
|
description: ClusterCleanupPolicy defines rule for resource cleanup.
|
||||||
|
|
|
@ -119,19 +119,19 @@ func main() {
|
||||||
genericloggingcontroller.NewController(
|
genericloggingcontroller.NewController(
|
||||||
setup.Logger.WithName("cleanup-policy"),
|
setup.Logger.WithName("cleanup-policy"),
|
||||||
"CleanupPolicy",
|
"CleanupPolicy",
|
||||||
kyvernoInformer.Kyverno().V2alpha1().CleanupPolicies(),
|
kyvernoInformer.Kyverno().V2beta1().CleanupPolicies(),
|
||||||
genericloggingcontroller.CheckGeneration,
|
genericloggingcontroller.CheckGeneration,
|
||||||
)
|
)
|
||||||
genericloggingcontroller.NewController(
|
genericloggingcontroller.NewController(
|
||||||
setup.Logger.WithName("cluster-cleanup-policy"),
|
setup.Logger.WithName("cluster-cleanup-policy"),
|
||||||
"ClusterCleanupPolicy",
|
"ClusterCleanupPolicy",
|
||||||
kyvernoInformer.Kyverno().V2alpha1().ClusterCleanupPolicies(),
|
kyvernoInformer.Kyverno().V2beta1().ClusterCleanupPolicies(),
|
||||||
genericloggingcontroller.CheckGeneration,
|
genericloggingcontroller.CheckGeneration,
|
||||||
)
|
)
|
||||||
eventGenerator := event.NewEventCleanupGenerator(
|
eventGenerator := event.NewEventCleanupGenerator(
|
||||||
setup.KyvernoDynamicClient,
|
setup.KyvernoDynamicClient,
|
||||||
kyvernoInformer.Kyverno().V2alpha1().ClusterCleanupPolicies(),
|
kyvernoInformer.Kyverno().V2beta1().ClusterCleanupPolicies(),
|
||||||
kyvernoInformer.Kyverno().V2alpha1().CleanupPolicies(),
|
kyvernoInformer.Kyverno().V2beta1().CleanupPolicies(),
|
||||||
maxQueuedEvents,
|
maxQueuedEvents,
|
||||||
logging.WithName("EventGenerator"),
|
logging.WithName("EventGenerator"),
|
||||||
)
|
)
|
||||||
|
@ -199,7 +199,7 @@ func main() {
|
||||||
{
|
{
|
||||||
Rule: admissionregistrationv1.Rule{
|
Rule: admissionregistrationv1.Rule{
|
||||||
APIGroups: []string{"kyverno.io"},
|
APIGroups: []string{"kyverno.io"},
|
||||||
APIVersions: []string{"v2alpha1"},
|
APIVersions: []string{"v2beta1"},
|
||||||
Resources: []string{
|
Resources: []string{
|
||||||
"cleanuppolicies/*",
|
"cleanuppolicies/*",
|
||||||
"clustercleanuppolicies/*",
|
"clustercleanuppolicies/*",
|
||||||
|
@ -262,8 +262,8 @@ func main() {
|
||||||
cleanup.NewController(
|
cleanup.NewController(
|
||||||
setup.KyvernoDynamicClient,
|
setup.KyvernoDynamicClient,
|
||||||
setup.KyvernoClient,
|
setup.KyvernoClient,
|
||||||
kyvernoInformer.Kyverno().V2alpha1().ClusterCleanupPolicies(),
|
kyvernoInformer.Kyverno().V2beta1().ClusterCleanupPolicies(),
|
||||||
kyvernoInformer.Kyverno().V2alpha1().CleanupPolicies(),
|
kyvernoInformer.Kyverno().V2beta1().CleanupPolicies(),
|
||||||
nsLister,
|
nsLister,
|
||||||
setup.Configuration,
|
setup.Configuration,
|
||||||
cmResolver,
|
cmResolver,
|
||||||
|
|
|
@ -25,7 +25,7 @@ spec:
|
||||||
- jsonPath: .metadata.creationTimestamp
|
- jsonPath: .metadata.creationTimestamp
|
||||||
name: Age
|
name: Age
|
||||||
type: date
|
type: date
|
||||||
name: v2alpha1
|
name: v2beta1
|
||||||
schema:
|
schema:
|
||||||
openAPIV3Schema:
|
openAPIV3Schema:
|
||||||
description: CleanupPolicy defines a rule for resource cleanup.
|
description: CleanupPolicy defines a rule for resource cleanup.
|
||||||
|
|
|
@ -25,7 +25,7 @@ spec:
|
||||||
- jsonPath: .metadata.creationTimestamp
|
- jsonPath: .metadata.creationTimestamp
|
||||||
name: Age
|
name: Age
|
||||||
type: date
|
type: date
|
||||||
name: v2alpha1
|
name: v2beta1
|
||||||
schema:
|
schema:
|
||||||
openAPIV3Schema:
|
openAPIV3Schema:
|
||||||
description: ClusterCleanupPolicy defines rule for resource cleanup.
|
description: ClusterCleanupPolicy defines rule for resource cleanup.
|
||||||
|
|
|
@ -876,7 +876,7 @@ spec:
|
||||||
- jsonPath: .metadata.creationTimestamp
|
- jsonPath: .metadata.creationTimestamp
|
||||||
name: Age
|
name: Age
|
||||||
type: date
|
type: date
|
||||||
name: v2alpha1
|
name: v2beta1
|
||||||
schema:
|
schema:
|
||||||
openAPIV3Schema:
|
openAPIV3Schema:
|
||||||
description: CleanupPolicy defines a rule for resource cleanup.
|
description: CleanupPolicy defines a rule for resource cleanup.
|
||||||
|
@ -2785,7 +2785,7 @@ spec:
|
||||||
- jsonPath: .metadata.creationTimestamp
|
- jsonPath: .metadata.creationTimestamp
|
||||||
name: Age
|
name: Age
|
||||||
type: date
|
type: date
|
||||||
name: v2alpha1
|
name: v2beta1
|
||||||
schema:
|
schema:
|
||||||
openAPIV3Schema:
|
openAPIV3Schema:
|
||||||
description: ClusterCleanupPolicy defines rule for resource cleanup.
|
description: ClusterCleanupPolicy defines rule for resource cleanup.
|
||||||
|
|
|
@ -1373,7 +1373,7 @@ string
|
||||||
<a href="#kyverno.io/v1.ForEachValidation">ForEachValidation</a>,
|
<a href="#kyverno.io/v1.ForEachValidation">ForEachValidation</a>,
|
||||||
<a href="#kyverno.io/v1.Rule">Rule</a>,
|
<a href="#kyverno.io/v1.Rule">Rule</a>,
|
||||||
<a href="#kyverno.io/v1.TargetResourceSpec">TargetResourceSpec</a>,
|
<a href="#kyverno.io/v1.TargetResourceSpec">TargetResourceSpec</a>,
|
||||||
<a href="#kyverno.io/v2alpha1.CleanupPolicySpec">CleanupPolicySpec</a>,
|
<a href="#kyverno.io/v2beta1.CleanupPolicySpec">CleanupPolicySpec</a>,
|
||||||
<a href="#kyverno.io/v2beta1.Rule">Rule</a>)
|
<a href="#kyverno.io/v2beta1.Rule">Rule</a>)
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
|
@ -5404,311 +5404,9 @@ Will be used during clean up resources.</p>
|
||||||
</p>
|
</p>
|
||||||
Resource Types:
|
Resource Types:
|
||||||
<ul><li>
|
<ul><li>
|
||||||
<a href="#kyverno.io/v2alpha1.CleanupPolicy">CleanupPolicy</a>
|
|
||||||
</li><li>
|
|
||||||
<a href="#kyverno.io/v2alpha1.ClusterCleanupPolicy">ClusterCleanupPolicy</a>
|
|
||||||
</li><li>
|
|
||||||
<a href="#kyverno.io/v2alpha1.PolicyException">PolicyException</a>
|
<a href="#kyverno.io/v2alpha1.PolicyException">PolicyException</a>
|
||||||
</li></ul>
|
</li></ul>
|
||||||
<hr />
|
<hr />
|
||||||
<h3 id="kyverno.io/v2alpha1.CleanupPolicy">CleanupPolicy
|
|
||||||
</h3>
|
|
||||||
<p>
|
|
||||||
<p>CleanupPolicy defines a rule for resource cleanup.</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>
|
|
||||||
kyverno.io/v2alpha1
|
|
||||||
</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<code>kind</code><br/>
|
|
||||||
string
|
|
||||||
</td>
|
|
||||||
<td><code>CleanupPolicy</code></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<code>metadata</code><br/>
|
|
||||||
<em>
|
|
||||||
<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#objectmeta-v1-meta">
|
|
||||||
Kubernetes meta/v1.ObjectMeta
|
|
||||||
</a>
|
|
||||||
</em>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
Refer to the Kubernetes API documentation for the fields of the
|
|
||||||
<code>metadata</code> field.
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<code>spec</code><br/>
|
|
||||||
<em>
|
|
||||||
<a href="#kyverno.io/v2alpha1.CleanupPolicySpec">
|
|
||||||
CleanupPolicySpec
|
|
||||||
</a>
|
|
||||||
</em>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<p>Spec declares policy behaviors.</p>
|
|
||||||
<br/>
|
|
||||||
<br/>
|
|
||||||
<table class="table table-striped">
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<code>context</code><br/>
|
|
||||||
<em>
|
|
||||||
<a href="#kyverno.io/v1.ContextEntry">
|
|
||||||
[]ContextEntry
|
|
||||||
</a>
|
|
||||||
</em>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<em>(Optional)</em>
|
|
||||||
<p>Context defines variables and data sources that can be used during rule execution.</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<code>match</code><br/>
|
|
||||||
<em>
|
|
||||||
<a href="#kyverno.io/v2beta1.MatchResources">
|
|
||||||
MatchResources
|
|
||||||
</a>
|
|
||||||
</em>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<p>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.</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<code>exclude</code><br/>
|
|
||||||
<em>
|
|
||||||
<a href="#kyverno.io/v2beta1.MatchResources">
|
|
||||||
MatchResources
|
|
||||||
</a>
|
|
||||||
</em>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<em>(Optional)</em>
|
|
||||||
<p>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.</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<code>schedule</code><br/>
|
|
||||||
<em>
|
|
||||||
string
|
|
||||||
</em>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<p>The schedule in Cron format</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<code>conditions</code><br/>
|
|
||||||
<em>
|
|
||||||
<a href="#kyverno.io/v2beta1.AnyAllConditions">
|
|
||||||
AnyAllConditions
|
|
||||||
</a>
|
|
||||||
</em>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<em>(Optional)</em>
|
|
||||||
<p>Conditions defines the conditions used to select the resources which will be cleaned up.</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<code>status</code><br/>
|
|
||||||
<em>
|
|
||||||
<a href="#kyverno.io/v2alpha1.CleanupPolicyStatus">
|
|
||||||
CleanupPolicyStatus
|
|
||||||
</a>
|
|
||||||
</em>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<em>(Optional)</em>
|
|
||||||
<p>Status contains policy runtime data.</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<hr />
|
|
||||||
<h3 id="kyverno.io/v2alpha1.ClusterCleanupPolicy">ClusterCleanupPolicy
|
|
||||||
</h3>
|
|
||||||
<p>
|
|
||||||
<p>ClusterCleanupPolicy defines rule for resource cleanup.</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>
|
|
||||||
kyverno.io/v2alpha1
|
|
||||||
</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<code>kind</code><br/>
|
|
||||||
string
|
|
||||||
</td>
|
|
||||||
<td><code>ClusterCleanupPolicy</code></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<code>metadata</code><br/>
|
|
||||||
<em>
|
|
||||||
<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#objectmeta-v1-meta">
|
|
||||||
Kubernetes meta/v1.ObjectMeta
|
|
||||||
</a>
|
|
||||||
</em>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
Refer to the Kubernetes API documentation for the fields of the
|
|
||||||
<code>metadata</code> field.
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<code>spec</code><br/>
|
|
||||||
<em>
|
|
||||||
<a href="#kyverno.io/v2alpha1.CleanupPolicySpec">
|
|
||||||
CleanupPolicySpec
|
|
||||||
</a>
|
|
||||||
</em>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<p>Spec declares policy behaviors.</p>
|
|
||||||
<br/>
|
|
||||||
<br/>
|
|
||||||
<table class="table table-striped">
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<code>context</code><br/>
|
|
||||||
<em>
|
|
||||||
<a href="#kyverno.io/v1.ContextEntry">
|
|
||||||
[]ContextEntry
|
|
||||||
</a>
|
|
||||||
</em>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<em>(Optional)</em>
|
|
||||||
<p>Context defines variables and data sources that can be used during rule execution.</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<code>match</code><br/>
|
|
||||||
<em>
|
|
||||||
<a href="#kyverno.io/v2beta1.MatchResources">
|
|
||||||
MatchResources
|
|
||||||
</a>
|
|
||||||
</em>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<p>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.</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<code>exclude</code><br/>
|
|
||||||
<em>
|
|
||||||
<a href="#kyverno.io/v2beta1.MatchResources">
|
|
||||||
MatchResources
|
|
||||||
</a>
|
|
||||||
</em>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<em>(Optional)</em>
|
|
||||||
<p>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.</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<code>schedule</code><br/>
|
|
||||||
<em>
|
|
||||||
string
|
|
||||||
</em>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<p>The schedule in Cron format</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<code>conditions</code><br/>
|
|
||||||
<em>
|
|
||||||
<a href="#kyverno.io/v2beta1.AnyAllConditions">
|
|
||||||
AnyAllConditions
|
|
||||||
</a>
|
|
||||||
</em>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<em>(Optional)</em>
|
|
||||||
<p>Conditions defines the conditions used to select the resources which will be cleaned up.</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<code>status</code><br/>
|
|
||||||
<em>
|
|
||||||
<a href="#kyverno.io/v2alpha1.CleanupPolicyStatus">
|
|
||||||
CleanupPolicyStatus
|
|
||||||
</a>
|
|
||||||
</em>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<em>(Optional)</em>
|
|
||||||
<p>Status contains policy runtime data.</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<hr />
|
|
||||||
<h3 id="kyverno.io/v2alpha1.PolicyException">PolicyException
|
<h3 id="kyverno.io/v2alpha1.PolicyException">PolicyException
|
||||||
</h3>
|
</h3>
|
||||||
<p>
|
<p>
|
||||||
|
@ -5812,21 +5510,24 @@ MatchResources
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<hr />
|
<hr />
|
||||||
<h3 id="kyverno.io/v2alpha1.CleanupPolicyInterface">CleanupPolicyInterface
|
<h2 id="kyverno.io/v2beta1">kyverno.io/v2beta1</h2>
|
||||||
|
Resource Types:
|
||||||
|
<ul><li>
|
||||||
|
<a href="#kyverno.io/v2beta1.CleanupPolicy">CleanupPolicy</a>
|
||||||
|
</li><li>
|
||||||
|
<a href="#kyverno.io/v2beta1.ClusterCleanupPolicy">ClusterCleanupPolicy</a>
|
||||||
|
</li><li>
|
||||||
|
<a href="#kyverno.io/v2beta1.ClusterPolicy">ClusterPolicy</a>
|
||||||
|
</li><li>
|
||||||
|
<a href="#kyverno.io/v2beta1.Policy">Policy</a>
|
||||||
|
</li><li>
|
||||||
|
<a href="#kyverno.io/v2beta1.PolicyException">PolicyException</a>
|
||||||
|
</li></ul>
|
||||||
|
<hr />
|
||||||
|
<h3 id="kyverno.io/v2beta1.CleanupPolicy">CleanupPolicy
|
||||||
</h3>
|
</h3>
|
||||||
<p>
|
<p>
|
||||||
<p>CleanupPolicyInterface abstracts the concrete policy type (CleanupPolicy vs ClusterCleanupPolicy)</p>
|
<p>CleanupPolicy defines a rule for resource cleanup.</p>
|
||||||
</p>
|
|
||||||
<h3 id="kyverno.io/v2alpha1.CleanupPolicySpec">CleanupPolicySpec
|
|
||||||
</h3>
|
|
||||||
<p>
|
|
||||||
(<em>Appears on:</em>
|
|
||||||
<a href="#kyverno.io/v2alpha1.CleanupPolicy">CleanupPolicy</a>,
|
|
||||||
<a href="#kyverno.io/v2alpha1.ClusterCleanupPolicy">ClusterCleanupPolicy</a>)
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<p>CleanupPolicySpec stores specifications for selecting resources that the user needs to delete
|
|
||||||
and schedule when the matching resources needs deleted.</p>
|
|
||||||
</p>
|
</p>
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<thead class="thead-dark">
|
<thead class="thead-dark">
|
||||||
|
@ -5838,6 +5539,51 @@ and schedule when the matching resources needs deleted.</p>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
|
<code>apiVersion</code><br/>
|
||||||
|
string</td>
|
||||||
|
<td>
|
||||||
|
<code>
|
||||||
|
kyverno.io/v2beta1
|
||||||
|
</code>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<code>kind</code><br/>
|
||||||
|
string
|
||||||
|
</td>
|
||||||
|
<td><code>CleanupPolicy</code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<code>metadata</code><br/>
|
||||||
|
<em>
|
||||||
|
<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#objectmeta-v1-meta">
|
||||||
|
Kubernetes meta/v1.ObjectMeta
|
||||||
|
</a>
|
||||||
|
</em>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
Refer to the Kubernetes API documentation for the fields of the
|
||||||
|
<code>metadata</code> field.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<code>spec</code><br/>
|
||||||
|
<em>
|
||||||
|
<a href="#kyverno.io/v2beta1.CleanupPolicySpec">
|
||||||
|
CleanupPolicySpec
|
||||||
|
</a>
|
||||||
|
</em>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Spec declares policy behaviors.</p>
|
||||||
|
<br/>
|
||||||
|
<br/>
|
||||||
|
<table class="table table-striped">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
<code>context</code><br/>
|
<code>context</code><br/>
|
||||||
<em>
|
<em>
|
||||||
<a href="#kyverno.io/v1.ContextEntry">
|
<a href="#kyverno.io/v1.ContextEntry">
|
||||||
|
@ -5907,18 +5653,30 @@ AnyAllConditions
|
||||||
<p>Conditions defines the conditions used to select the resources which will be cleaned up.</p>
|
<p>Conditions defines the conditions used to select the resources which will be cleaned up.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<code>status</code><br/>
|
||||||
|
<em>
|
||||||
|
<a href="#kyverno.io/v2beta1.CleanupPolicyStatus">
|
||||||
|
CleanupPolicyStatus
|
||||||
|
</a>
|
||||||
|
</em>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<em>(Optional)</em>
|
||||||
|
<p>Status contains policy runtime data.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<hr />
|
<hr />
|
||||||
<h3 id="kyverno.io/v2alpha1.CleanupPolicyStatus">CleanupPolicyStatus
|
<h3 id="kyverno.io/v2beta1.ClusterCleanupPolicy">ClusterCleanupPolicy
|
||||||
</h3>
|
</h3>
|
||||||
<p>
|
<p>
|
||||||
(<em>Appears on:</em>
|
<p>ClusterCleanupPolicy defines rule for resource cleanup.</p>
|
||||||
<a href="#kyverno.io/v2alpha1.CleanupPolicy">CleanupPolicy</a>,
|
|
||||||
<a href="#kyverno.io/v2alpha1.ClusterCleanupPolicy">ClusterCleanupPolicy</a>)
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<p>CleanupPolicyStatus stores the status of the policy.</p>
|
|
||||||
</p>
|
</p>
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<thead class="thead-dark">
|
<thead class="thead-dark">
|
||||||
|
@ -5930,41 +5688,140 @@ AnyAllConditions
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<code>conditions</code><br/>
|
<code>apiVersion</code><br/>
|
||||||
<em>
|
string</td>
|
||||||
<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#condition-v1-meta">
|
|
||||||
[]Kubernetes meta/v1.Condition
|
|
||||||
</a>
|
|
||||||
</em>
|
|
||||||
</td>
|
|
||||||
<td>
|
<td>
|
||||||
|
<code>
|
||||||
|
kyverno.io/v2beta1
|
||||||
|
</code>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<code>lastExecutionTime</code><br/>
|
<code>kind</code><br/>
|
||||||
|
string
|
||||||
|
</td>
|
||||||
|
<td><code>ClusterCleanupPolicy</code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<code>metadata</code><br/>
|
||||||
<em>
|
<em>
|
||||||
<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#time-v1-meta">
|
<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#objectmeta-v1-meta">
|
||||||
Kubernetes meta/v1.Time
|
Kubernetes meta/v1.ObjectMeta
|
||||||
</a>
|
</a>
|
||||||
</em>
|
</em>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
Refer to the Kubernetes API documentation for the fields of the
|
||||||
|
<code>metadata</code> field.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<code>spec</code><br/>
|
||||||
|
<em>
|
||||||
|
<a href="#kyverno.io/v2beta1.CleanupPolicySpec">
|
||||||
|
CleanupPolicySpec
|
||||||
|
</a>
|
||||||
|
</em>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Spec declares policy behaviors.</p>
|
||||||
|
<br/>
|
||||||
|
<br/>
|
||||||
|
<table class="table table-striped">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<code>context</code><br/>
|
||||||
|
<em>
|
||||||
|
<a href="#kyverno.io/v1.ContextEntry">
|
||||||
|
[]ContextEntry
|
||||||
|
</a>
|
||||||
|
</em>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<em>(Optional)</em>
|
||||||
|
<p>Context defines variables and data sources that can be used during rule execution.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<code>match</code><br/>
|
||||||
|
<em>
|
||||||
|
<a href="#kyverno.io/v2beta1.MatchResources">
|
||||||
|
MatchResources
|
||||||
|
</a>
|
||||||
|
</em>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>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.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<code>exclude</code><br/>
|
||||||
|
<em>
|
||||||
|
<a href="#kyverno.io/v2beta1.MatchResources">
|
||||||
|
MatchResources
|
||||||
|
</a>
|
||||||
|
</em>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<em>(Optional)</em>
|
||||||
|
<p>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.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<code>schedule</code><br/>
|
||||||
|
<em>
|
||||||
|
string
|
||||||
|
</em>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>The schedule in Cron format</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<code>conditions</code><br/>
|
||||||
|
<em>
|
||||||
|
<a href="#kyverno.io/v2beta1.AnyAllConditions">
|
||||||
|
AnyAllConditions
|
||||||
|
</a>
|
||||||
|
</em>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<em>(Optional)</em>
|
||||||
|
<p>Conditions defines the conditions used to select the resources which will be cleaned up.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<code>status</code><br/>
|
||||||
|
<em>
|
||||||
|
<a href="#kyverno.io/v2beta1.CleanupPolicyStatus">
|
||||||
|
CleanupPolicyStatus
|
||||||
|
</a>
|
||||||
|
</em>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<em>(Optional)</em>
|
||||||
|
<p>Status contains policy runtime data.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<hr />
|
<hr />
|
||||||
<h2 id="kyverno.io/v2beta1">kyverno.io/v2beta1</h2>
|
|
||||||
Resource Types:
|
|
||||||
<ul><li>
|
|
||||||
<a href="#kyverno.io/v2beta1.ClusterPolicy">ClusterPolicy</a>
|
|
||||||
</li><li>
|
|
||||||
<a href="#kyverno.io/v2beta1.Policy">Policy</a>
|
|
||||||
</li><li>
|
|
||||||
<a href="#kyverno.io/v2beta1.PolicyException">PolicyException</a>
|
|
||||||
</li></ul>
|
|
||||||
<hr />
|
|
||||||
<h3 id="kyverno.io/v2beta1.ClusterPolicy">ClusterPolicy
|
<h3 id="kyverno.io/v2beta1.ClusterPolicy">ClusterPolicy
|
||||||
</h3>
|
</h3>
|
||||||
<p>
|
<p>
|
||||||
|
@ -6599,7 +6456,7 @@ MatchResources
|
||||||
</h3>
|
</h3>
|
||||||
<p>
|
<p>
|
||||||
(<em>Appears on:</em>
|
(<em>Appears on:</em>
|
||||||
<a href="#kyverno.io/v2alpha1.CleanupPolicySpec">CleanupPolicySpec</a>,
|
<a href="#kyverno.io/v2beta1.CleanupPolicySpec">CleanupPolicySpec</a>,
|
||||||
<a href="#kyverno.io/v2beta1.Deny">Deny</a>,
|
<a href="#kyverno.io/v2beta1.Deny">Deny</a>,
|
||||||
<a href="#kyverno.io/v2beta1.Rule">Rule</a>)
|
<a href="#kyverno.io/v2beta1.Rule">Rule</a>)
|
||||||
</p>
|
</p>
|
||||||
|
@ -6650,6 +6507,149 @@ Here, all of the conditions need to pass.</p>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<hr />
|
<hr />
|
||||||
|
<h3 id="kyverno.io/v2beta1.CleanupPolicyInterface">CleanupPolicyInterface
|
||||||
|
</h3>
|
||||||
|
<p>
|
||||||
|
<p>CleanupPolicyInterface abstracts the concrete policy type (CleanupPolicy vs ClusterCleanupPolicy)</p>
|
||||||
|
</p>
|
||||||
|
<h3 id="kyverno.io/v2beta1.CleanupPolicySpec">CleanupPolicySpec
|
||||||
|
</h3>
|
||||||
|
<p>
|
||||||
|
(<em>Appears on:</em>
|
||||||
|
<a href="#kyverno.io/v2beta1.CleanupPolicy">CleanupPolicy</a>,
|
||||||
|
<a href="#kyverno.io/v2beta1.ClusterCleanupPolicy">ClusterCleanupPolicy</a>)
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<p>CleanupPolicySpec stores specifications for selecting resources that the user needs to delete
|
||||||
|
and schedule when the matching resources needs deleted.</p>
|
||||||
|
</p>
|
||||||
|
<table class="table table-striped">
|
||||||
|
<thead class="thead-dark">
|
||||||
|
<tr>
|
||||||
|
<th>Field</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<code>context</code><br/>
|
||||||
|
<em>
|
||||||
|
<a href="#kyverno.io/v1.ContextEntry">
|
||||||
|
[]ContextEntry
|
||||||
|
</a>
|
||||||
|
</em>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<em>(Optional)</em>
|
||||||
|
<p>Context defines variables and data sources that can be used during rule execution.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<code>match</code><br/>
|
||||||
|
<em>
|
||||||
|
<a href="#kyverno.io/v2beta1.MatchResources">
|
||||||
|
MatchResources
|
||||||
|
</a>
|
||||||
|
</em>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>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.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<code>exclude</code><br/>
|
||||||
|
<em>
|
||||||
|
<a href="#kyverno.io/v2beta1.MatchResources">
|
||||||
|
MatchResources
|
||||||
|
</a>
|
||||||
|
</em>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<em>(Optional)</em>
|
||||||
|
<p>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.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<code>schedule</code><br/>
|
||||||
|
<em>
|
||||||
|
string
|
||||||
|
</em>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>The schedule in Cron format</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<code>conditions</code><br/>
|
||||||
|
<em>
|
||||||
|
<a href="#kyverno.io/v2beta1.AnyAllConditions">
|
||||||
|
AnyAllConditions
|
||||||
|
</a>
|
||||||
|
</em>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<em>(Optional)</em>
|
||||||
|
<p>Conditions defines the conditions used to select the resources which will be cleaned up.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<hr />
|
||||||
|
<h3 id="kyverno.io/v2beta1.CleanupPolicyStatus">CleanupPolicyStatus
|
||||||
|
</h3>
|
||||||
|
<p>
|
||||||
|
(<em>Appears on:</em>
|
||||||
|
<a href="#kyverno.io/v2beta1.CleanupPolicy">CleanupPolicy</a>,
|
||||||
|
<a href="#kyverno.io/v2beta1.ClusterCleanupPolicy">ClusterCleanupPolicy</a>)
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<p>CleanupPolicyStatus stores the status of the 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>conditions</code><br/>
|
||||||
|
<em>
|
||||||
|
<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#condition-v1-meta">
|
||||||
|
[]Kubernetes meta/v1.Condition
|
||||||
|
</a>
|
||||||
|
</em>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<code>lastExecutionTime</code><br/>
|
||||||
|
<em>
|
||||||
|
<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#time-v1-meta">
|
||||||
|
Kubernetes meta/v1.Time
|
||||||
|
</a>
|
||||||
|
</em>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<hr />
|
||||||
<h3 id="kyverno.io/v2beta1.Condition">Condition
|
<h3 id="kyverno.io/v2beta1.Condition">Condition
|
||||||
</h3>
|
</h3>
|
||||||
<p>
|
<p>
|
||||||
|
@ -6964,7 +6964,7 @@ bool
|
||||||
</h3>
|
</h3>
|
||||||
<p>
|
<p>
|
||||||
(<em>Appears on:</em>
|
(<em>Appears on:</em>
|
||||||
<a href="#kyverno.io/v2alpha1.CleanupPolicySpec">CleanupPolicySpec</a>,
|
<a href="#kyverno.io/v2beta1.CleanupPolicySpec">CleanupPolicySpec</a>,
|
||||||
<a href="#kyverno.io/v2beta1.PolicyExceptionSpec">PolicyExceptionSpec</a>,
|
<a href="#kyverno.io/v2beta1.PolicyExceptionSpec">PolicyExceptionSpec</a>,
|
||||||
<a href="#kyverno.io/v2beta1.Rule">Rule</a>)
|
<a href="#kyverno.io/v2beta1.Rule">Rule</a>)
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -16,7 +16,7 @@ limitations under the License.
|
||||||
|
|
||||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||||
|
|
||||||
package v2alpha1
|
package v2beta1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
@ -40,7 +40,7 @@ func CleanupPolicy(name, namespace string) *CleanupPolicyApplyConfiguration {
|
||||||
b.WithName(name)
|
b.WithName(name)
|
||||||
b.WithNamespace(namespace)
|
b.WithNamespace(namespace)
|
||||||
b.WithKind("CleanupPolicy")
|
b.WithKind("CleanupPolicy")
|
||||||
b.WithAPIVersion("kyverno.io/v2alpha1")
|
b.WithAPIVersion("kyverno.io/v2beta1")
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,21 +16,20 @@ limitations under the License.
|
||||||
|
|
||||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||||
|
|
||||||
package v2alpha1
|
package v2beta1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
v1 "github.com/kyverno/kyverno/pkg/client/applyconfigurations/kyverno/v1"
|
v1 "github.com/kyverno/kyverno/pkg/client/applyconfigurations/kyverno/v1"
|
||||||
v2beta1 "github.com/kyverno/kyverno/pkg/client/applyconfigurations/kyverno/v2beta1"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// CleanupPolicySpecApplyConfiguration represents an declarative configuration of the CleanupPolicySpec type for use
|
// CleanupPolicySpecApplyConfiguration represents an declarative configuration of the CleanupPolicySpec type for use
|
||||||
// with apply.
|
// with apply.
|
||||||
type CleanupPolicySpecApplyConfiguration struct {
|
type CleanupPolicySpecApplyConfiguration struct {
|
||||||
Context []v1.ContextEntryApplyConfiguration `json:"context,omitempty"`
|
Context []v1.ContextEntryApplyConfiguration `json:"context,omitempty"`
|
||||||
MatchResources *v2beta1.MatchResourcesApplyConfiguration `json:"match,omitempty"`
|
MatchResources *MatchResourcesApplyConfiguration `json:"match,omitempty"`
|
||||||
ExcludeResources *v2beta1.MatchResourcesApplyConfiguration `json:"exclude,omitempty"`
|
ExcludeResources *MatchResourcesApplyConfiguration `json:"exclude,omitempty"`
|
||||||
Schedule *string `json:"schedule,omitempty"`
|
Schedule *string `json:"schedule,omitempty"`
|
||||||
Conditions *v2beta1.AnyAllConditionsApplyConfiguration `json:"conditions,omitempty"`
|
Conditions *AnyAllConditionsApplyConfiguration `json:"conditions,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CleanupPolicySpecApplyConfiguration constructs an declarative configuration of the CleanupPolicySpec type for use with
|
// CleanupPolicySpecApplyConfiguration constructs an declarative configuration of the CleanupPolicySpec type for use with
|
||||||
|
@ -55,7 +54,7 @@ func (b *CleanupPolicySpecApplyConfiguration) WithContext(values ...*v1.ContextE
|
||||||
// WithMatchResources sets the MatchResources field in the declarative configuration to the given value
|
// WithMatchResources sets the MatchResources field in the declarative configuration to the given value
|
||||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||||
// If called multiple times, the MatchResources field is set to the value of the last call.
|
// If called multiple times, the MatchResources field is set to the value of the last call.
|
||||||
func (b *CleanupPolicySpecApplyConfiguration) WithMatchResources(value *v2beta1.MatchResourcesApplyConfiguration) *CleanupPolicySpecApplyConfiguration {
|
func (b *CleanupPolicySpecApplyConfiguration) WithMatchResources(value *MatchResourcesApplyConfiguration) *CleanupPolicySpecApplyConfiguration {
|
||||||
b.MatchResources = value
|
b.MatchResources = value
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
@ -63,7 +62,7 @@ func (b *CleanupPolicySpecApplyConfiguration) WithMatchResources(value *v2beta1.
|
||||||
// WithExcludeResources sets the ExcludeResources field in the declarative configuration to the given value
|
// WithExcludeResources sets the ExcludeResources field in the declarative configuration to the given value
|
||||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||||
// If called multiple times, the ExcludeResources field is set to the value of the last call.
|
// If called multiple times, the ExcludeResources field is set to the value of the last call.
|
||||||
func (b *CleanupPolicySpecApplyConfiguration) WithExcludeResources(value *v2beta1.MatchResourcesApplyConfiguration) *CleanupPolicySpecApplyConfiguration {
|
func (b *CleanupPolicySpecApplyConfiguration) WithExcludeResources(value *MatchResourcesApplyConfiguration) *CleanupPolicySpecApplyConfiguration {
|
||||||
b.ExcludeResources = value
|
b.ExcludeResources = value
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
@ -79,7 +78,7 @@ func (b *CleanupPolicySpecApplyConfiguration) WithSchedule(value string) *Cleanu
|
||||||
// WithConditions sets the Conditions field in the declarative configuration to the given value
|
// WithConditions sets the Conditions field in the declarative configuration to the given value
|
||||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||||
// If called multiple times, the Conditions field is set to the value of the last call.
|
// If called multiple times, the Conditions field is set to the value of the last call.
|
||||||
func (b *CleanupPolicySpecApplyConfiguration) WithConditions(value *v2beta1.AnyAllConditionsApplyConfiguration) *CleanupPolicySpecApplyConfiguration {
|
func (b *CleanupPolicySpecApplyConfiguration) WithConditions(value *AnyAllConditionsApplyConfiguration) *CleanupPolicySpecApplyConfiguration {
|
||||||
b.Conditions = value
|
b.Conditions = value
|
||||||
return b
|
return b
|
||||||
}
|
}
|
|
@ -16,7 +16,7 @@ limitations under the License.
|
||||||
|
|
||||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||||
|
|
||||||
package v2alpha1
|
package v2beta1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
@ -16,7 +16,7 @@ limitations under the License.
|
||||||
|
|
||||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||||
|
|
||||||
package v2alpha1
|
package v2beta1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
@ -39,7 +39,7 @@ func ClusterCleanupPolicy(name string) *ClusterCleanupPolicyApplyConfiguration {
|
||||||
b := &ClusterCleanupPolicyApplyConfiguration{}
|
b := &ClusterCleanupPolicyApplyConfiguration{}
|
||||||
b.WithName(name)
|
b.WithName(name)
|
||||||
b.WithKind("ClusterCleanupPolicy")
|
b.WithKind("ClusterCleanupPolicy")
|
||||||
b.WithAPIVersion("kyverno.io/v2alpha1")
|
b.WithAPIVersion("kyverno.io/v2beta1")
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
|
@ -169,20 +169,20 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
|
||||||
return &kyvernov1beta1.UpdateRequestStatusApplyConfiguration{}
|
return &kyvernov1beta1.UpdateRequestStatusApplyConfiguration{}
|
||||||
|
|
||||||
// Group=kyverno.io, Version=v2alpha1
|
// Group=kyverno.io, Version=v2alpha1
|
||||||
case v2alpha1.SchemeGroupVersion.WithKind("CleanupPolicy"):
|
|
||||||
return &kyvernov2alpha1.CleanupPolicyApplyConfiguration{}
|
|
||||||
case v2alpha1.SchemeGroupVersion.WithKind("CleanupPolicySpec"):
|
|
||||||
return &kyvernov2alpha1.CleanupPolicySpecApplyConfiguration{}
|
|
||||||
case v2alpha1.SchemeGroupVersion.WithKind("CleanupPolicyStatus"):
|
|
||||||
return &kyvernov2alpha1.CleanupPolicyStatusApplyConfiguration{}
|
|
||||||
case v2alpha1.SchemeGroupVersion.WithKind("ClusterCleanupPolicy"):
|
|
||||||
return &kyvernov2alpha1.ClusterCleanupPolicyApplyConfiguration{}
|
|
||||||
case v2alpha1.SchemeGroupVersion.WithKind("PolicyException"):
|
case v2alpha1.SchemeGroupVersion.WithKind("PolicyException"):
|
||||||
return &kyvernov2alpha1.PolicyExceptionApplyConfiguration{}
|
return &kyvernov2alpha1.PolicyExceptionApplyConfiguration{}
|
||||||
|
|
||||||
// Group=kyverno.io, Version=v2beta1
|
// Group=kyverno.io, Version=v2beta1
|
||||||
case v2beta1.SchemeGroupVersion.WithKind("AnyAllConditions"):
|
case v2beta1.SchemeGroupVersion.WithKind("AnyAllConditions"):
|
||||||
return &kyvernov2beta1.AnyAllConditionsApplyConfiguration{}
|
return &kyvernov2beta1.AnyAllConditionsApplyConfiguration{}
|
||||||
|
case v2beta1.SchemeGroupVersion.WithKind("CleanupPolicy"):
|
||||||
|
return &kyvernov2beta1.CleanupPolicyApplyConfiguration{}
|
||||||
|
case v2beta1.SchemeGroupVersion.WithKind("CleanupPolicySpec"):
|
||||||
|
return &kyvernov2beta1.CleanupPolicySpecApplyConfiguration{}
|
||||||
|
case v2beta1.SchemeGroupVersion.WithKind("CleanupPolicyStatus"):
|
||||||
|
return &kyvernov2beta1.CleanupPolicyStatusApplyConfiguration{}
|
||||||
|
case v2beta1.SchemeGroupVersion.WithKind("ClusterCleanupPolicy"):
|
||||||
|
return &kyvernov2beta1.ClusterCleanupPolicyApplyConfiguration{}
|
||||||
case v2beta1.SchemeGroupVersion.WithKind("ClusterPolicy"):
|
case v2beta1.SchemeGroupVersion.WithKind("ClusterPolicy"):
|
||||||
return &kyvernov2beta1.ClusterPolicyApplyConfiguration{}
|
return &kyvernov2beta1.ClusterPolicyApplyConfiguration{}
|
||||||
case v2beta1.SchemeGroupVersion.WithKind("Condition"):
|
case v2beta1.SchemeGroupVersion.WithKind("Condition"):
|
||||||
|
|
|
@ -28,14 +28,6 @@ type FakeKyvernoV2alpha1 struct {
|
||||||
*testing.Fake
|
*testing.Fake
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *FakeKyvernoV2alpha1) CleanupPolicies(namespace string) v2alpha1.CleanupPolicyInterface {
|
|
||||||
return &FakeCleanupPolicies{c, namespace}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *FakeKyvernoV2alpha1) ClusterCleanupPolicies() v2alpha1.ClusterCleanupPolicyInterface {
|
|
||||||
return &FakeClusterCleanupPolicies{c}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *FakeKyvernoV2alpha1) PolicyExceptions(namespace string) v2alpha1.PolicyExceptionInterface {
|
func (c *FakeKyvernoV2alpha1) PolicyExceptions(namespace string) v2alpha1.PolicyExceptionInterface {
|
||||||
return &FakePolicyExceptions{c, namespace}
|
return &FakePolicyExceptions{c, namespace}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,8 +18,4 @@ limitations under the License.
|
||||||
|
|
||||||
package v2alpha1
|
package v2alpha1
|
||||||
|
|
||||||
type CleanupPolicyExpansion interface{}
|
|
||||||
|
|
||||||
type ClusterCleanupPolicyExpansion interface{}
|
|
||||||
|
|
||||||
type PolicyExceptionExpansion interface{}
|
type PolicyExceptionExpansion interface{}
|
||||||
|
|
|
@ -28,8 +28,6 @@ import (
|
||||||
|
|
||||||
type KyvernoV2alpha1Interface interface {
|
type KyvernoV2alpha1Interface interface {
|
||||||
RESTClient() rest.Interface
|
RESTClient() rest.Interface
|
||||||
CleanupPoliciesGetter
|
|
||||||
ClusterCleanupPoliciesGetter
|
|
||||||
PolicyExceptionsGetter
|
PolicyExceptionsGetter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,14 +36,6 @@ type KyvernoV2alpha1Client struct {
|
||||||
restClient rest.Interface
|
restClient rest.Interface
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *KyvernoV2alpha1Client) CleanupPolicies(namespace string) CleanupPolicyInterface {
|
|
||||||
return newCleanupPolicies(c, namespace)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *KyvernoV2alpha1Client) ClusterCleanupPolicies() ClusterCleanupPolicyInterface {
|
|
||||||
return newClusterCleanupPolicies(c)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *KyvernoV2alpha1Client) PolicyExceptions(namespace string) PolicyExceptionInterface {
|
func (c *KyvernoV2alpha1Client) PolicyExceptions(namespace string) PolicyExceptionInterface {
|
||||||
return newPolicyExceptions(c, namespace)
|
return newPolicyExceptions(c, namespace)
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,13 +16,13 @@ limitations under the License.
|
||||||
|
|
||||||
// Code generated by client-gen. DO NOT EDIT.
|
// Code generated by client-gen. DO NOT EDIT.
|
||||||
|
|
||||||
package v2alpha1
|
package v2beta1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
v2alpha1 "github.com/kyverno/kyverno/api/kyverno/v2alpha1"
|
v2beta1 "github.com/kyverno/kyverno/api/kyverno/v2beta1"
|
||||||
scheme "github.com/kyverno/kyverno/pkg/client/clientset/versioned/scheme"
|
scheme "github.com/kyverno/kyverno/pkg/client/clientset/versioned/scheme"
|
||||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
types "k8s.io/apimachinery/pkg/types"
|
types "k8s.io/apimachinery/pkg/types"
|
||||||
|
@ -38,15 +38,15 @@ type CleanupPoliciesGetter interface {
|
||||||
|
|
||||||
// CleanupPolicyInterface has methods to work with CleanupPolicy resources.
|
// CleanupPolicyInterface has methods to work with CleanupPolicy resources.
|
||||||
type CleanupPolicyInterface interface {
|
type CleanupPolicyInterface interface {
|
||||||
Create(ctx context.Context, cleanupPolicy *v2alpha1.CleanupPolicy, opts v1.CreateOptions) (*v2alpha1.CleanupPolicy, error)
|
Create(ctx context.Context, cleanupPolicy *v2beta1.CleanupPolicy, opts v1.CreateOptions) (*v2beta1.CleanupPolicy, error)
|
||||||
Update(ctx context.Context, cleanupPolicy *v2alpha1.CleanupPolicy, opts v1.UpdateOptions) (*v2alpha1.CleanupPolicy, error)
|
Update(ctx context.Context, cleanupPolicy *v2beta1.CleanupPolicy, opts v1.UpdateOptions) (*v2beta1.CleanupPolicy, error)
|
||||||
UpdateStatus(ctx context.Context, cleanupPolicy *v2alpha1.CleanupPolicy, opts v1.UpdateOptions) (*v2alpha1.CleanupPolicy, error)
|
UpdateStatus(ctx context.Context, cleanupPolicy *v2beta1.CleanupPolicy, opts v1.UpdateOptions) (*v2beta1.CleanupPolicy, error)
|
||||||
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
|
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
|
||||||
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
|
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
|
||||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*v2alpha1.CleanupPolicy, error)
|
Get(ctx context.Context, name string, opts v1.GetOptions) (*v2beta1.CleanupPolicy, error)
|
||||||
List(ctx context.Context, opts v1.ListOptions) (*v2alpha1.CleanupPolicyList, error)
|
List(ctx context.Context, opts v1.ListOptions) (*v2beta1.CleanupPolicyList, error)
|
||||||
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
|
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
|
||||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.CleanupPolicy, err error)
|
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta1.CleanupPolicy, err error)
|
||||||
CleanupPolicyExpansion
|
CleanupPolicyExpansion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ type cleanupPolicies struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// newCleanupPolicies returns a CleanupPolicies
|
// newCleanupPolicies returns a CleanupPolicies
|
||||||
func newCleanupPolicies(c *KyvernoV2alpha1Client, namespace string) *cleanupPolicies {
|
func newCleanupPolicies(c *KyvernoV2beta1Client, namespace string) *cleanupPolicies {
|
||||||
return &cleanupPolicies{
|
return &cleanupPolicies{
|
||||||
client: c.RESTClient(),
|
client: c.RESTClient(),
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
|
@ -65,8 +65,8 @@ func newCleanupPolicies(c *KyvernoV2alpha1Client, namespace string) *cleanupPoli
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get takes name of the cleanupPolicy, and returns the corresponding cleanupPolicy object, and an error if there is any.
|
// Get takes name of the cleanupPolicy, and returns the corresponding cleanupPolicy object, and an error if there is any.
|
||||||
func (c *cleanupPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.CleanupPolicy, err error) {
|
func (c *cleanupPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2beta1.CleanupPolicy, err error) {
|
||||||
result = &v2alpha1.CleanupPolicy{}
|
result = &v2beta1.CleanupPolicy{}
|
||||||
err = c.client.Get().
|
err = c.client.Get().
|
||||||
Namespace(c.ns).
|
Namespace(c.ns).
|
||||||
Resource("cleanuppolicies").
|
Resource("cleanuppolicies").
|
||||||
|
@ -78,12 +78,12 @@ func (c *cleanupPolicies) Get(ctx context.Context, name string, options v1.GetOp
|
||||||
}
|
}
|
||||||
|
|
||||||
// List takes label and field selectors, and returns the list of CleanupPolicies that match those selectors.
|
// List takes label and field selectors, and returns the list of CleanupPolicies that match those selectors.
|
||||||
func (c *cleanupPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.CleanupPolicyList, err error) {
|
func (c *cleanupPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v2beta1.CleanupPolicyList, err error) {
|
||||||
var timeout time.Duration
|
var timeout time.Duration
|
||||||
if opts.TimeoutSeconds != nil {
|
if opts.TimeoutSeconds != nil {
|
||||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||||
}
|
}
|
||||||
result = &v2alpha1.CleanupPolicyList{}
|
result = &v2beta1.CleanupPolicyList{}
|
||||||
err = c.client.Get().
|
err = c.client.Get().
|
||||||
Namespace(c.ns).
|
Namespace(c.ns).
|
||||||
Resource("cleanuppolicies").
|
Resource("cleanuppolicies").
|
||||||
|
@ -110,8 +110,8 @@ func (c *cleanupPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create takes the representation of a cleanupPolicy and creates it. Returns the server's representation of the cleanupPolicy, and an error, if there is any.
|
// Create takes the representation of a cleanupPolicy and creates it. Returns the server's representation of the cleanupPolicy, and an error, if there is any.
|
||||||
func (c *cleanupPolicies) Create(ctx context.Context, cleanupPolicy *v2alpha1.CleanupPolicy, opts v1.CreateOptions) (result *v2alpha1.CleanupPolicy, err error) {
|
func (c *cleanupPolicies) Create(ctx context.Context, cleanupPolicy *v2beta1.CleanupPolicy, opts v1.CreateOptions) (result *v2beta1.CleanupPolicy, err error) {
|
||||||
result = &v2alpha1.CleanupPolicy{}
|
result = &v2beta1.CleanupPolicy{}
|
||||||
err = c.client.Post().
|
err = c.client.Post().
|
||||||
Namespace(c.ns).
|
Namespace(c.ns).
|
||||||
Resource("cleanuppolicies").
|
Resource("cleanuppolicies").
|
||||||
|
@ -123,8 +123,8 @@ func (c *cleanupPolicies) Create(ctx context.Context, cleanupPolicy *v2alpha1.Cl
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update takes the representation of a cleanupPolicy and updates it. Returns the server's representation of the cleanupPolicy, and an error, if there is any.
|
// Update takes the representation of a cleanupPolicy and updates it. Returns the server's representation of the cleanupPolicy, and an error, if there is any.
|
||||||
func (c *cleanupPolicies) Update(ctx context.Context, cleanupPolicy *v2alpha1.CleanupPolicy, opts v1.UpdateOptions) (result *v2alpha1.CleanupPolicy, err error) {
|
func (c *cleanupPolicies) Update(ctx context.Context, cleanupPolicy *v2beta1.CleanupPolicy, opts v1.UpdateOptions) (result *v2beta1.CleanupPolicy, err error) {
|
||||||
result = &v2alpha1.CleanupPolicy{}
|
result = &v2beta1.CleanupPolicy{}
|
||||||
err = c.client.Put().
|
err = c.client.Put().
|
||||||
Namespace(c.ns).
|
Namespace(c.ns).
|
||||||
Resource("cleanuppolicies").
|
Resource("cleanuppolicies").
|
||||||
|
@ -138,8 +138,8 @@ func (c *cleanupPolicies) Update(ctx context.Context, cleanupPolicy *v2alpha1.Cl
|
||||||
|
|
||||||
// UpdateStatus was generated because the type contains a Status member.
|
// UpdateStatus was generated because the type contains a Status member.
|
||||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||||
func (c *cleanupPolicies) UpdateStatus(ctx context.Context, cleanupPolicy *v2alpha1.CleanupPolicy, opts v1.UpdateOptions) (result *v2alpha1.CleanupPolicy, err error) {
|
func (c *cleanupPolicies) UpdateStatus(ctx context.Context, cleanupPolicy *v2beta1.CleanupPolicy, opts v1.UpdateOptions) (result *v2beta1.CleanupPolicy, err error) {
|
||||||
result = &v2alpha1.CleanupPolicy{}
|
result = &v2beta1.CleanupPolicy{}
|
||||||
err = c.client.Put().
|
err = c.client.Put().
|
||||||
Namespace(c.ns).
|
Namespace(c.ns).
|
||||||
Resource("cleanuppolicies").
|
Resource("cleanuppolicies").
|
||||||
|
@ -180,8 +180,8 @@ func (c *cleanupPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOp
|
||||||
}
|
}
|
||||||
|
|
||||||
// Patch applies the patch and returns the patched cleanupPolicy.
|
// Patch applies the patch and returns the patched cleanupPolicy.
|
||||||
func (c *cleanupPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.CleanupPolicy, err error) {
|
func (c *cleanupPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta1.CleanupPolicy, err error) {
|
||||||
result = &v2alpha1.CleanupPolicy{}
|
result = &v2beta1.CleanupPolicy{}
|
||||||
err = c.client.Patch(pt).
|
err = c.client.Patch(pt).
|
||||||
Namespace(c.ns).
|
Namespace(c.ns).
|
||||||
Resource("cleanuppolicies").
|
Resource("cleanuppolicies").
|
|
@ -16,13 +16,13 @@ limitations under the License.
|
||||||
|
|
||||||
// Code generated by client-gen. DO NOT EDIT.
|
// Code generated by client-gen. DO NOT EDIT.
|
||||||
|
|
||||||
package v2alpha1
|
package v2beta1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
v2alpha1 "github.com/kyverno/kyverno/api/kyverno/v2alpha1"
|
v2beta1 "github.com/kyverno/kyverno/api/kyverno/v2beta1"
|
||||||
scheme "github.com/kyverno/kyverno/pkg/client/clientset/versioned/scheme"
|
scheme "github.com/kyverno/kyverno/pkg/client/clientset/versioned/scheme"
|
||||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
types "k8s.io/apimachinery/pkg/types"
|
types "k8s.io/apimachinery/pkg/types"
|
||||||
|
@ -38,15 +38,15 @@ type ClusterCleanupPoliciesGetter interface {
|
||||||
|
|
||||||
// ClusterCleanupPolicyInterface has methods to work with ClusterCleanupPolicy resources.
|
// ClusterCleanupPolicyInterface has methods to work with ClusterCleanupPolicy resources.
|
||||||
type ClusterCleanupPolicyInterface interface {
|
type ClusterCleanupPolicyInterface interface {
|
||||||
Create(ctx context.Context, clusterCleanupPolicy *v2alpha1.ClusterCleanupPolicy, opts v1.CreateOptions) (*v2alpha1.ClusterCleanupPolicy, error)
|
Create(ctx context.Context, clusterCleanupPolicy *v2beta1.ClusterCleanupPolicy, opts v1.CreateOptions) (*v2beta1.ClusterCleanupPolicy, error)
|
||||||
Update(ctx context.Context, clusterCleanupPolicy *v2alpha1.ClusterCleanupPolicy, opts v1.UpdateOptions) (*v2alpha1.ClusterCleanupPolicy, error)
|
Update(ctx context.Context, clusterCleanupPolicy *v2beta1.ClusterCleanupPolicy, opts v1.UpdateOptions) (*v2beta1.ClusterCleanupPolicy, error)
|
||||||
UpdateStatus(ctx context.Context, clusterCleanupPolicy *v2alpha1.ClusterCleanupPolicy, opts v1.UpdateOptions) (*v2alpha1.ClusterCleanupPolicy, error)
|
UpdateStatus(ctx context.Context, clusterCleanupPolicy *v2beta1.ClusterCleanupPolicy, opts v1.UpdateOptions) (*v2beta1.ClusterCleanupPolicy, error)
|
||||||
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
|
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
|
||||||
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
|
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
|
||||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*v2alpha1.ClusterCleanupPolicy, error)
|
Get(ctx context.Context, name string, opts v1.GetOptions) (*v2beta1.ClusterCleanupPolicy, error)
|
||||||
List(ctx context.Context, opts v1.ListOptions) (*v2alpha1.ClusterCleanupPolicyList, error)
|
List(ctx context.Context, opts v1.ListOptions) (*v2beta1.ClusterCleanupPolicyList, error)
|
||||||
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
|
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
|
||||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.ClusterCleanupPolicy, err error)
|
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta1.ClusterCleanupPolicy, err error)
|
||||||
ClusterCleanupPolicyExpansion
|
ClusterCleanupPolicyExpansion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,15 +56,15 @@ type clusterCleanupPolicies struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// newClusterCleanupPolicies returns a ClusterCleanupPolicies
|
// newClusterCleanupPolicies returns a ClusterCleanupPolicies
|
||||||
func newClusterCleanupPolicies(c *KyvernoV2alpha1Client) *clusterCleanupPolicies {
|
func newClusterCleanupPolicies(c *KyvernoV2beta1Client) *clusterCleanupPolicies {
|
||||||
return &clusterCleanupPolicies{
|
return &clusterCleanupPolicies{
|
||||||
client: c.RESTClient(),
|
client: c.RESTClient(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get takes name of the clusterCleanupPolicy, and returns the corresponding clusterCleanupPolicy object, and an error if there is any.
|
// Get takes name of the clusterCleanupPolicy, and returns the corresponding clusterCleanupPolicy object, and an error if there is any.
|
||||||
func (c *clusterCleanupPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.ClusterCleanupPolicy, err error) {
|
func (c *clusterCleanupPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2beta1.ClusterCleanupPolicy, err error) {
|
||||||
result = &v2alpha1.ClusterCleanupPolicy{}
|
result = &v2beta1.ClusterCleanupPolicy{}
|
||||||
err = c.client.Get().
|
err = c.client.Get().
|
||||||
Resource("clustercleanuppolicies").
|
Resource("clustercleanuppolicies").
|
||||||
Name(name).
|
Name(name).
|
||||||
|
@ -75,12 +75,12 @@ func (c *clusterCleanupPolicies) Get(ctx context.Context, name string, options v
|
||||||
}
|
}
|
||||||
|
|
||||||
// List takes label and field selectors, and returns the list of ClusterCleanupPolicies that match those selectors.
|
// List takes label and field selectors, and returns the list of ClusterCleanupPolicies that match those selectors.
|
||||||
func (c *clusterCleanupPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.ClusterCleanupPolicyList, err error) {
|
func (c *clusterCleanupPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v2beta1.ClusterCleanupPolicyList, err error) {
|
||||||
var timeout time.Duration
|
var timeout time.Duration
|
||||||
if opts.TimeoutSeconds != nil {
|
if opts.TimeoutSeconds != nil {
|
||||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||||
}
|
}
|
||||||
result = &v2alpha1.ClusterCleanupPolicyList{}
|
result = &v2beta1.ClusterCleanupPolicyList{}
|
||||||
err = c.client.Get().
|
err = c.client.Get().
|
||||||
Resource("clustercleanuppolicies").
|
Resource("clustercleanuppolicies").
|
||||||
VersionedParams(&opts, scheme.ParameterCodec).
|
VersionedParams(&opts, scheme.ParameterCodec).
|
||||||
|
@ -105,8 +105,8 @@ func (c *clusterCleanupPolicies) Watch(ctx context.Context, opts v1.ListOptions)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create takes the representation of a clusterCleanupPolicy and creates it. Returns the server's representation of the clusterCleanupPolicy, and an error, if there is any.
|
// Create takes the representation of a clusterCleanupPolicy and creates it. Returns the server's representation of the clusterCleanupPolicy, and an error, if there is any.
|
||||||
func (c *clusterCleanupPolicies) Create(ctx context.Context, clusterCleanupPolicy *v2alpha1.ClusterCleanupPolicy, opts v1.CreateOptions) (result *v2alpha1.ClusterCleanupPolicy, err error) {
|
func (c *clusterCleanupPolicies) Create(ctx context.Context, clusterCleanupPolicy *v2beta1.ClusterCleanupPolicy, opts v1.CreateOptions) (result *v2beta1.ClusterCleanupPolicy, err error) {
|
||||||
result = &v2alpha1.ClusterCleanupPolicy{}
|
result = &v2beta1.ClusterCleanupPolicy{}
|
||||||
err = c.client.Post().
|
err = c.client.Post().
|
||||||
Resource("clustercleanuppolicies").
|
Resource("clustercleanuppolicies").
|
||||||
VersionedParams(&opts, scheme.ParameterCodec).
|
VersionedParams(&opts, scheme.ParameterCodec).
|
||||||
|
@ -117,8 +117,8 @@ func (c *clusterCleanupPolicies) Create(ctx context.Context, clusterCleanupPolic
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update takes the representation of a clusterCleanupPolicy and updates it. Returns the server's representation of the clusterCleanupPolicy, and an error, if there is any.
|
// Update takes the representation of a clusterCleanupPolicy and updates it. Returns the server's representation of the clusterCleanupPolicy, and an error, if there is any.
|
||||||
func (c *clusterCleanupPolicies) Update(ctx context.Context, clusterCleanupPolicy *v2alpha1.ClusterCleanupPolicy, opts v1.UpdateOptions) (result *v2alpha1.ClusterCleanupPolicy, err error) {
|
func (c *clusterCleanupPolicies) Update(ctx context.Context, clusterCleanupPolicy *v2beta1.ClusterCleanupPolicy, opts v1.UpdateOptions) (result *v2beta1.ClusterCleanupPolicy, err error) {
|
||||||
result = &v2alpha1.ClusterCleanupPolicy{}
|
result = &v2beta1.ClusterCleanupPolicy{}
|
||||||
err = c.client.Put().
|
err = c.client.Put().
|
||||||
Resource("clustercleanuppolicies").
|
Resource("clustercleanuppolicies").
|
||||||
Name(clusterCleanupPolicy.Name).
|
Name(clusterCleanupPolicy.Name).
|
||||||
|
@ -131,8 +131,8 @@ func (c *clusterCleanupPolicies) Update(ctx context.Context, clusterCleanupPolic
|
||||||
|
|
||||||
// UpdateStatus was generated because the type contains a Status member.
|
// UpdateStatus was generated because the type contains a Status member.
|
||||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||||
func (c *clusterCleanupPolicies) UpdateStatus(ctx context.Context, clusterCleanupPolicy *v2alpha1.ClusterCleanupPolicy, opts v1.UpdateOptions) (result *v2alpha1.ClusterCleanupPolicy, err error) {
|
func (c *clusterCleanupPolicies) UpdateStatus(ctx context.Context, clusterCleanupPolicy *v2beta1.ClusterCleanupPolicy, opts v1.UpdateOptions) (result *v2beta1.ClusterCleanupPolicy, err error) {
|
||||||
result = &v2alpha1.ClusterCleanupPolicy{}
|
result = &v2beta1.ClusterCleanupPolicy{}
|
||||||
err = c.client.Put().
|
err = c.client.Put().
|
||||||
Resource("clustercleanuppolicies").
|
Resource("clustercleanuppolicies").
|
||||||
Name(clusterCleanupPolicy.Name).
|
Name(clusterCleanupPolicy.Name).
|
||||||
|
@ -170,8 +170,8 @@ func (c *clusterCleanupPolicies) DeleteCollection(ctx context.Context, opts v1.D
|
||||||
}
|
}
|
||||||
|
|
||||||
// Patch applies the patch and returns the patched clusterCleanupPolicy.
|
// Patch applies the patch and returns the patched clusterCleanupPolicy.
|
||||||
func (c *clusterCleanupPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.ClusterCleanupPolicy, err error) {
|
func (c *clusterCleanupPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta1.ClusterCleanupPolicy, err error) {
|
||||||
result = &v2alpha1.ClusterCleanupPolicy{}
|
result = &v2beta1.ClusterCleanupPolicy{}
|
||||||
err = c.client.Patch(pt).
|
err = c.client.Patch(pt).
|
||||||
Resource("clustercleanuppolicies").
|
Resource("clustercleanuppolicies").
|
||||||
Name(name).
|
Name(name).
|
|
@ -21,7 +21,7 @@ package fake
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
v2alpha1 "github.com/kyverno/kyverno/api/kyverno/v2alpha1"
|
v2beta1 "github.com/kyverno/kyverno/api/kyverno/v2beta1"
|
||||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
labels "k8s.io/apimachinery/pkg/labels"
|
labels "k8s.io/apimachinery/pkg/labels"
|
||||||
types "k8s.io/apimachinery/pkg/types"
|
types "k8s.io/apimachinery/pkg/types"
|
||||||
|
@ -31,29 +31,29 @@ import (
|
||||||
|
|
||||||
// FakeCleanupPolicies implements CleanupPolicyInterface
|
// FakeCleanupPolicies implements CleanupPolicyInterface
|
||||||
type FakeCleanupPolicies struct {
|
type FakeCleanupPolicies struct {
|
||||||
Fake *FakeKyvernoV2alpha1
|
Fake *FakeKyvernoV2beta1
|
||||||
ns string
|
ns string
|
||||||
}
|
}
|
||||||
|
|
||||||
var cleanuppoliciesResource = v2alpha1.SchemeGroupVersion.WithResource("cleanuppolicies")
|
var cleanuppoliciesResource = v2beta1.SchemeGroupVersion.WithResource("cleanuppolicies")
|
||||||
|
|
||||||
var cleanuppoliciesKind = v2alpha1.SchemeGroupVersion.WithKind("CleanupPolicy")
|
var cleanuppoliciesKind = v2beta1.SchemeGroupVersion.WithKind("CleanupPolicy")
|
||||||
|
|
||||||
// Get takes name of the cleanupPolicy, and returns the corresponding cleanupPolicy object, and an error if there is any.
|
// Get takes name of the cleanupPolicy, and returns the corresponding cleanupPolicy object, and an error if there is any.
|
||||||
func (c *FakeCleanupPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.CleanupPolicy, err error) {
|
func (c *FakeCleanupPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2beta1.CleanupPolicy, err error) {
|
||||||
obj, err := c.Fake.
|
obj, err := c.Fake.
|
||||||
Invokes(testing.NewGetAction(cleanuppoliciesResource, c.ns, name), &v2alpha1.CleanupPolicy{})
|
Invokes(testing.NewGetAction(cleanuppoliciesResource, c.ns, name), &v2beta1.CleanupPolicy{})
|
||||||
|
|
||||||
if obj == nil {
|
if obj == nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return obj.(*v2alpha1.CleanupPolicy), err
|
return obj.(*v2beta1.CleanupPolicy), err
|
||||||
}
|
}
|
||||||
|
|
||||||
// List takes label and field selectors, and returns the list of CleanupPolicies that match those selectors.
|
// List takes label and field selectors, and returns the list of CleanupPolicies that match those selectors.
|
||||||
func (c *FakeCleanupPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.CleanupPolicyList, err error) {
|
func (c *FakeCleanupPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v2beta1.CleanupPolicyList, err error) {
|
||||||
obj, err := c.Fake.
|
obj, err := c.Fake.
|
||||||
Invokes(testing.NewListAction(cleanuppoliciesResource, cleanuppoliciesKind, c.ns, opts), &v2alpha1.CleanupPolicyList{})
|
Invokes(testing.NewListAction(cleanuppoliciesResource, cleanuppoliciesKind, c.ns, opts), &v2beta1.CleanupPolicyList{})
|
||||||
|
|
||||||
if obj == nil {
|
if obj == nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -63,8 +63,8 @@ func (c *FakeCleanupPolicies) List(ctx context.Context, opts v1.ListOptions) (re
|
||||||
if label == nil {
|
if label == nil {
|
||||||
label = labels.Everything()
|
label = labels.Everything()
|
||||||
}
|
}
|
||||||
list := &v2alpha1.CleanupPolicyList{ListMeta: obj.(*v2alpha1.CleanupPolicyList).ListMeta}
|
list := &v2beta1.CleanupPolicyList{ListMeta: obj.(*v2beta1.CleanupPolicyList).ListMeta}
|
||||||
for _, item := range obj.(*v2alpha1.CleanupPolicyList).Items {
|
for _, item := range obj.(*v2beta1.CleanupPolicyList).Items {
|
||||||
if label.Matches(labels.Set(item.Labels)) {
|
if label.Matches(labels.Set(item.Labels)) {
|
||||||
list.Items = append(list.Items, item)
|
list.Items = append(list.Items, item)
|
||||||
}
|
}
|
||||||
|
@ -80,43 +80,43 @@ func (c *FakeCleanupPolicies) Watch(ctx context.Context, opts v1.ListOptions) (w
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create takes the representation of a cleanupPolicy and creates it. Returns the server's representation of the cleanupPolicy, and an error, if there is any.
|
// Create takes the representation of a cleanupPolicy and creates it. Returns the server's representation of the cleanupPolicy, and an error, if there is any.
|
||||||
func (c *FakeCleanupPolicies) Create(ctx context.Context, cleanupPolicy *v2alpha1.CleanupPolicy, opts v1.CreateOptions) (result *v2alpha1.CleanupPolicy, err error) {
|
func (c *FakeCleanupPolicies) Create(ctx context.Context, cleanupPolicy *v2beta1.CleanupPolicy, opts v1.CreateOptions) (result *v2beta1.CleanupPolicy, err error) {
|
||||||
obj, err := c.Fake.
|
obj, err := c.Fake.
|
||||||
Invokes(testing.NewCreateAction(cleanuppoliciesResource, c.ns, cleanupPolicy), &v2alpha1.CleanupPolicy{})
|
Invokes(testing.NewCreateAction(cleanuppoliciesResource, c.ns, cleanupPolicy), &v2beta1.CleanupPolicy{})
|
||||||
|
|
||||||
if obj == nil {
|
if obj == nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return obj.(*v2alpha1.CleanupPolicy), err
|
return obj.(*v2beta1.CleanupPolicy), err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update takes the representation of a cleanupPolicy and updates it. Returns the server's representation of the cleanupPolicy, and an error, if there is any.
|
// Update takes the representation of a cleanupPolicy and updates it. Returns the server's representation of the cleanupPolicy, and an error, if there is any.
|
||||||
func (c *FakeCleanupPolicies) Update(ctx context.Context, cleanupPolicy *v2alpha1.CleanupPolicy, opts v1.UpdateOptions) (result *v2alpha1.CleanupPolicy, err error) {
|
func (c *FakeCleanupPolicies) Update(ctx context.Context, cleanupPolicy *v2beta1.CleanupPolicy, opts v1.UpdateOptions) (result *v2beta1.CleanupPolicy, err error) {
|
||||||
obj, err := c.Fake.
|
obj, err := c.Fake.
|
||||||
Invokes(testing.NewUpdateAction(cleanuppoliciesResource, c.ns, cleanupPolicy), &v2alpha1.CleanupPolicy{})
|
Invokes(testing.NewUpdateAction(cleanuppoliciesResource, c.ns, cleanupPolicy), &v2beta1.CleanupPolicy{})
|
||||||
|
|
||||||
if obj == nil {
|
if obj == nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return obj.(*v2alpha1.CleanupPolicy), err
|
return obj.(*v2beta1.CleanupPolicy), err
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateStatus was generated because the type contains a Status member.
|
// UpdateStatus was generated because the type contains a Status member.
|
||||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||||
func (c *FakeCleanupPolicies) UpdateStatus(ctx context.Context, cleanupPolicy *v2alpha1.CleanupPolicy, opts v1.UpdateOptions) (*v2alpha1.CleanupPolicy, error) {
|
func (c *FakeCleanupPolicies) UpdateStatus(ctx context.Context, cleanupPolicy *v2beta1.CleanupPolicy, opts v1.UpdateOptions) (*v2beta1.CleanupPolicy, error) {
|
||||||
obj, err := c.Fake.
|
obj, err := c.Fake.
|
||||||
Invokes(testing.NewUpdateSubresourceAction(cleanuppoliciesResource, "status", c.ns, cleanupPolicy), &v2alpha1.CleanupPolicy{})
|
Invokes(testing.NewUpdateSubresourceAction(cleanuppoliciesResource, "status", c.ns, cleanupPolicy), &v2beta1.CleanupPolicy{})
|
||||||
|
|
||||||
if obj == nil {
|
if obj == nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return obj.(*v2alpha1.CleanupPolicy), err
|
return obj.(*v2beta1.CleanupPolicy), err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete takes name of the cleanupPolicy and deletes it. Returns an error if one occurs.
|
// Delete takes name of the cleanupPolicy and deletes it. Returns an error if one occurs.
|
||||||
func (c *FakeCleanupPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
func (c *FakeCleanupPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||||
_, err := c.Fake.
|
_, err := c.Fake.
|
||||||
Invokes(testing.NewDeleteActionWithOptions(cleanuppoliciesResource, c.ns, name, opts), &v2alpha1.CleanupPolicy{})
|
Invokes(testing.NewDeleteActionWithOptions(cleanuppoliciesResource, c.ns, name, opts), &v2beta1.CleanupPolicy{})
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -125,17 +125,17 @@ func (c *FakeCleanupPolicies) Delete(ctx context.Context, name string, opts v1.D
|
||||||
func (c *FakeCleanupPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
func (c *FakeCleanupPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||||
action := testing.NewDeleteCollectionAction(cleanuppoliciesResource, c.ns, listOpts)
|
action := testing.NewDeleteCollectionAction(cleanuppoliciesResource, c.ns, listOpts)
|
||||||
|
|
||||||
_, err := c.Fake.Invokes(action, &v2alpha1.CleanupPolicyList{})
|
_, err := c.Fake.Invokes(action, &v2beta1.CleanupPolicyList{})
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Patch applies the patch and returns the patched cleanupPolicy.
|
// Patch applies the patch and returns the patched cleanupPolicy.
|
||||||
func (c *FakeCleanupPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.CleanupPolicy, err error) {
|
func (c *FakeCleanupPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta1.CleanupPolicy, err error) {
|
||||||
obj, err := c.Fake.
|
obj, err := c.Fake.
|
||||||
Invokes(testing.NewPatchSubresourceAction(cleanuppoliciesResource, c.ns, name, pt, data, subresources...), &v2alpha1.CleanupPolicy{})
|
Invokes(testing.NewPatchSubresourceAction(cleanuppoliciesResource, c.ns, name, pt, data, subresources...), &v2beta1.CleanupPolicy{})
|
||||||
|
|
||||||
if obj == nil {
|
if obj == nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return obj.(*v2alpha1.CleanupPolicy), err
|
return obj.(*v2beta1.CleanupPolicy), err
|
||||||
}
|
}
|
|
@ -21,7 +21,7 @@ package fake
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
v2alpha1 "github.com/kyverno/kyverno/api/kyverno/v2alpha1"
|
v2beta1 "github.com/kyverno/kyverno/api/kyverno/v2beta1"
|
||||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
labels "k8s.io/apimachinery/pkg/labels"
|
labels "k8s.io/apimachinery/pkg/labels"
|
||||||
types "k8s.io/apimachinery/pkg/types"
|
types "k8s.io/apimachinery/pkg/types"
|
||||||
|
@ -31,27 +31,27 @@ import (
|
||||||
|
|
||||||
// FakeClusterCleanupPolicies implements ClusterCleanupPolicyInterface
|
// FakeClusterCleanupPolicies implements ClusterCleanupPolicyInterface
|
||||||
type FakeClusterCleanupPolicies struct {
|
type FakeClusterCleanupPolicies struct {
|
||||||
Fake *FakeKyvernoV2alpha1
|
Fake *FakeKyvernoV2beta1
|
||||||
}
|
}
|
||||||
|
|
||||||
var clustercleanuppoliciesResource = v2alpha1.SchemeGroupVersion.WithResource("clustercleanuppolicies")
|
var clustercleanuppoliciesResource = v2beta1.SchemeGroupVersion.WithResource("clustercleanuppolicies")
|
||||||
|
|
||||||
var clustercleanuppoliciesKind = v2alpha1.SchemeGroupVersion.WithKind("ClusterCleanupPolicy")
|
var clustercleanuppoliciesKind = v2beta1.SchemeGroupVersion.WithKind("ClusterCleanupPolicy")
|
||||||
|
|
||||||
// Get takes name of the clusterCleanupPolicy, and returns the corresponding clusterCleanupPolicy object, and an error if there is any.
|
// Get takes name of the clusterCleanupPolicy, and returns the corresponding clusterCleanupPolicy object, and an error if there is any.
|
||||||
func (c *FakeClusterCleanupPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.ClusterCleanupPolicy, err error) {
|
func (c *FakeClusterCleanupPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2beta1.ClusterCleanupPolicy, err error) {
|
||||||
obj, err := c.Fake.
|
obj, err := c.Fake.
|
||||||
Invokes(testing.NewRootGetAction(clustercleanuppoliciesResource, name), &v2alpha1.ClusterCleanupPolicy{})
|
Invokes(testing.NewRootGetAction(clustercleanuppoliciesResource, name), &v2beta1.ClusterCleanupPolicy{})
|
||||||
if obj == nil {
|
if obj == nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return obj.(*v2alpha1.ClusterCleanupPolicy), err
|
return obj.(*v2beta1.ClusterCleanupPolicy), err
|
||||||
}
|
}
|
||||||
|
|
||||||
// List takes label and field selectors, and returns the list of ClusterCleanupPolicies that match those selectors.
|
// List takes label and field selectors, and returns the list of ClusterCleanupPolicies that match those selectors.
|
||||||
func (c *FakeClusterCleanupPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.ClusterCleanupPolicyList, err error) {
|
func (c *FakeClusterCleanupPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v2beta1.ClusterCleanupPolicyList, err error) {
|
||||||
obj, err := c.Fake.
|
obj, err := c.Fake.
|
||||||
Invokes(testing.NewRootListAction(clustercleanuppoliciesResource, clustercleanuppoliciesKind, opts), &v2alpha1.ClusterCleanupPolicyList{})
|
Invokes(testing.NewRootListAction(clustercleanuppoliciesResource, clustercleanuppoliciesKind, opts), &v2beta1.ClusterCleanupPolicyList{})
|
||||||
if obj == nil {
|
if obj == nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -60,8 +60,8 @@ func (c *FakeClusterCleanupPolicies) List(ctx context.Context, opts v1.ListOptio
|
||||||
if label == nil {
|
if label == nil {
|
||||||
label = labels.Everything()
|
label = labels.Everything()
|
||||||
}
|
}
|
||||||
list := &v2alpha1.ClusterCleanupPolicyList{ListMeta: obj.(*v2alpha1.ClusterCleanupPolicyList).ListMeta}
|
list := &v2beta1.ClusterCleanupPolicyList{ListMeta: obj.(*v2beta1.ClusterCleanupPolicyList).ListMeta}
|
||||||
for _, item := range obj.(*v2alpha1.ClusterCleanupPolicyList).Items {
|
for _, item := range obj.(*v2beta1.ClusterCleanupPolicyList).Items {
|
||||||
if label.Matches(labels.Set(item.Labels)) {
|
if label.Matches(labels.Set(item.Labels)) {
|
||||||
list.Items = append(list.Items, item)
|
list.Items = append(list.Items, item)
|
||||||
}
|
}
|
||||||
|
@ -76,40 +76,40 @@ func (c *FakeClusterCleanupPolicies) Watch(ctx context.Context, opts v1.ListOpti
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create takes the representation of a clusterCleanupPolicy and creates it. Returns the server's representation of the clusterCleanupPolicy, and an error, if there is any.
|
// Create takes the representation of a clusterCleanupPolicy and creates it. Returns the server's representation of the clusterCleanupPolicy, and an error, if there is any.
|
||||||
func (c *FakeClusterCleanupPolicies) Create(ctx context.Context, clusterCleanupPolicy *v2alpha1.ClusterCleanupPolicy, opts v1.CreateOptions) (result *v2alpha1.ClusterCleanupPolicy, err error) {
|
func (c *FakeClusterCleanupPolicies) Create(ctx context.Context, clusterCleanupPolicy *v2beta1.ClusterCleanupPolicy, opts v1.CreateOptions) (result *v2beta1.ClusterCleanupPolicy, err error) {
|
||||||
obj, err := c.Fake.
|
obj, err := c.Fake.
|
||||||
Invokes(testing.NewRootCreateAction(clustercleanuppoliciesResource, clusterCleanupPolicy), &v2alpha1.ClusterCleanupPolicy{})
|
Invokes(testing.NewRootCreateAction(clustercleanuppoliciesResource, clusterCleanupPolicy), &v2beta1.ClusterCleanupPolicy{})
|
||||||
if obj == nil {
|
if obj == nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return obj.(*v2alpha1.ClusterCleanupPolicy), err
|
return obj.(*v2beta1.ClusterCleanupPolicy), err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update takes the representation of a clusterCleanupPolicy and updates it. Returns the server's representation of the clusterCleanupPolicy, and an error, if there is any.
|
// Update takes the representation of a clusterCleanupPolicy and updates it. Returns the server's representation of the clusterCleanupPolicy, and an error, if there is any.
|
||||||
func (c *FakeClusterCleanupPolicies) Update(ctx context.Context, clusterCleanupPolicy *v2alpha1.ClusterCleanupPolicy, opts v1.UpdateOptions) (result *v2alpha1.ClusterCleanupPolicy, err error) {
|
func (c *FakeClusterCleanupPolicies) Update(ctx context.Context, clusterCleanupPolicy *v2beta1.ClusterCleanupPolicy, opts v1.UpdateOptions) (result *v2beta1.ClusterCleanupPolicy, err error) {
|
||||||
obj, err := c.Fake.
|
obj, err := c.Fake.
|
||||||
Invokes(testing.NewRootUpdateAction(clustercleanuppoliciesResource, clusterCleanupPolicy), &v2alpha1.ClusterCleanupPolicy{})
|
Invokes(testing.NewRootUpdateAction(clustercleanuppoliciesResource, clusterCleanupPolicy), &v2beta1.ClusterCleanupPolicy{})
|
||||||
if obj == nil {
|
if obj == nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return obj.(*v2alpha1.ClusterCleanupPolicy), err
|
return obj.(*v2beta1.ClusterCleanupPolicy), err
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateStatus was generated because the type contains a Status member.
|
// UpdateStatus was generated because the type contains a Status member.
|
||||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||||
func (c *FakeClusterCleanupPolicies) UpdateStatus(ctx context.Context, clusterCleanupPolicy *v2alpha1.ClusterCleanupPolicy, opts v1.UpdateOptions) (*v2alpha1.ClusterCleanupPolicy, error) {
|
func (c *FakeClusterCleanupPolicies) UpdateStatus(ctx context.Context, clusterCleanupPolicy *v2beta1.ClusterCleanupPolicy, opts v1.UpdateOptions) (*v2beta1.ClusterCleanupPolicy, error) {
|
||||||
obj, err := c.Fake.
|
obj, err := c.Fake.
|
||||||
Invokes(testing.NewRootUpdateSubresourceAction(clustercleanuppoliciesResource, "status", clusterCleanupPolicy), &v2alpha1.ClusterCleanupPolicy{})
|
Invokes(testing.NewRootUpdateSubresourceAction(clustercleanuppoliciesResource, "status", clusterCleanupPolicy), &v2beta1.ClusterCleanupPolicy{})
|
||||||
if obj == nil {
|
if obj == nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return obj.(*v2alpha1.ClusterCleanupPolicy), err
|
return obj.(*v2beta1.ClusterCleanupPolicy), err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete takes name of the clusterCleanupPolicy and deletes it. Returns an error if one occurs.
|
// Delete takes name of the clusterCleanupPolicy and deletes it. Returns an error if one occurs.
|
||||||
func (c *FakeClusterCleanupPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
func (c *FakeClusterCleanupPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||||
_, err := c.Fake.
|
_, err := c.Fake.
|
||||||
Invokes(testing.NewRootDeleteActionWithOptions(clustercleanuppoliciesResource, name, opts), &v2alpha1.ClusterCleanupPolicy{})
|
Invokes(testing.NewRootDeleteActionWithOptions(clustercleanuppoliciesResource, name, opts), &v2beta1.ClusterCleanupPolicy{})
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,16 +117,16 @@ func (c *FakeClusterCleanupPolicies) Delete(ctx context.Context, name string, op
|
||||||
func (c *FakeClusterCleanupPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
func (c *FakeClusterCleanupPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||||
action := testing.NewRootDeleteCollectionAction(clustercleanuppoliciesResource, listOpts)
|
action := testing.NewRootDeleteCollectionAction(clustercleanuppoliciesResource, listOpts)
|
||||||
|
|
||||||
_, err := c.Fake.Invokes(action, &v2alpha1.ClusterCleanupPolicyList{})
|
_, err := c.Fake.Invokes(action, &v2beta1.ClusterCleanupPolicyList{})
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Patch applies the patch and returns the patched clusterCleanupPolicy.
|
// Patch applies the patch and returns the patched clusterCleanupPolicy.
|
||||||
func (c *FakeClusterCleanupPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.ClusterCleanupPolicy, err error) {
|
func (c *FakeClusterCleanupPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta1.ClusterCleanupPolicy, err error) {
|
||||||
obj, err := c.Fake.
|
obj, err := c.Fake.
|
||||||
Invokes(testing.NewRootPatchSubresourceAction(clustercleanuppoliciesResource, name, pt, data, subresources...), &v2alpha1.ClusterCleanupPolicy{})
|
Invokes(testing.NewRootPatchSubresourceAction(clustercleanuppoliciesResource, name, pt, data, subresources...), &v2beta1.ClusterCleanupPolicy{})
|
||||||
if obj == nil {
|
if obj == nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return obj.(*v2alpha1.ClusterCleanupPolicy), err
|
return obj.(*v2beta1.ClusterCleanupPolicy), err
|
||||||
}
|
}
|
|
@ -28,6 +28,14 @@ type FakeKyvernoV2beta1 struct {
|
||||||
*testing.Fake
|
*testing.Fake
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *FakeKyvernoV2beta1) CleanupPolicies(namespace string) v2beta1.CleanupPolicyInterface {
|
||||||
|
return &FakeCleanupPolicies{c, namespace}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *FakeKyvernoV2beta1) ClusterCleanupPolicies() v2beta1.ClusterCleanupPolicyInterface {
|
||||||
|
return &FakeClusterCleanupPolicies{c}
|
||||||
|
}
|
||||||
|
|
||||||
func (c *FakeKyvernoV2beta1) ClusterPolicies() v2beta1.ClusterPolicyInterface {
|
func (c *FakeKyvernoV2beta1) ClusterPolicies() v2beta1.ClusterPolicyInterface {
|
||||||
return &FakeClusterPolicies{c}
|
return &FakeClusterPolicies{c}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,10 @@ limitations under the License.
|
||||||
|
|
||||||
package v2beta1
|
package v2beta1
|
||||||
|
|
||||||
|
type CleanupPolicyExpansion interface{}
|
||||||
|
|
||||||
|
type ClusterCleanupPolicyExpansion interface{}
|
||||||
|
|
||||||
type ClusterPolicyExpansion interface{}
|
type ClusterPolicyExpansion interface{}
|
||||||
|
|
||||||
type PolicyExpansion interface{}
|
type PolicyExpansion interface{}
|
||||||
|
|
|
@ -28,6 +28,8 @@ import (
|
||||||
|
|
||||||
type KyvernoV2beta1Interface interface {
|
type KyvernoV2beta1Interface interface {
|
||||||
RESTClient() rest.Interface
|
RESTClient() rest.Interface
|
||||||
|
CleanupPoliciesGetter
|
||||||
|
ClusterCleanupPoliciesGetter
|
||||||
ClusterPoliciesGetter
|
ClusterPoliciesGetter
|
||||||
PoliciesGetter
|
PoliciesGetter
|
||||||
PolicyExceptionsGetter
|
PolicyExceptionsGetter
|
||||||
|
@ -38,6 +40,14 @@ type KyvernoV2beta1Client struct {
|
||||||
restClient rest.Interface
|
restClient rest.Interface
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *KyvernoV2beta1Client) CleanupPolicies(namespace string) CleanupPolicyInterface {
|
||||||
|
return newCleanupPolicies(c, namespace)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *KyvernoV2beta1Client) ClusterCleanupPolicies() ClusterCleanupPolicyInterface {
|
||||||
|
return newClusterCleanupPolicies(c)
|
||||||
|
}
|
||||||
|
|
||||||
func (c *KyvernoV2beta1Client) ClusterPolicies() ClusterPolicyInterface {
|
func (c *KyvernoV2beta1Client) ClusterPolicies() ClusterPolicyInterface {
|
||||||
return newClusterPolicies(c)
|
return newClusterPolicies(c)
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,14 +78,14 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
|
||||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Kyverno().V1beta1().UpdateRequests().Informer()}, nil
|
return &genericInformer{resource: resource.GroupResource(), informer: f.Kyverno().V1beta1().UpdateRequests().Informer()}, nil
|
||||||
|
|
||||||
// Group=kyverno.io, Version=v2alpha1
|
// Group=kyverno.io, Version=v2alpha1
|
||||||
case v2alpha1.SchemeGroupVersion.WithResource("cleanuppolicies"):
|
|
||||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Kyverno().V2alpha1().CleanupPolicies().Informer()}, nil
|
|
||||||
case v2alpha1.SchemeGroupVersion.WithResource("clustercleanuppolicies"):
|
|
||||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Kyverno().V2alpha1().ClusterCleanupPolicies().Informer()}, nil
|
|
||||||
case v2alpha1.SchemeGroupVersion.WithResource("policyexceptions"):
|
case v2alpha1.SchemeGroupVersion.WithResource("policyexceptions"):
|
||||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Kyverno().V2alpha1().PolicyExceptions().Informer()}, nil
|
return &genericInformer{resource: resource.GroupResource(), informer: f.Kyverno().V2alpha1().PolicyExceptions().Informer()}, nil
|
||||||
|
|
||||||
// Group=kyverno.io, Version=v2beta1
|
// Group=kyverno.io, Version=v2beta1
|
||||||
|
case v2beta1.SchemeGroupVersion.WithResource("cleanuppolicies"):
|
||||||
|
return &genericInformer{resource: resource.GroupResource(), informer: f.Kyverno().V2beta1().CleanupPolicies().Informer()}, nil
|
||||||
|
case v2beta1.SchemeGroupVersion.WithResource("clustercleanuppolicies"):
|
||||||
|
return &genericInformer{resource: resource.GroupResource(), informer: f.Kyverno().V2beta1().ClusterCleanupPolicies().Informer()}, nil
|
||||||
case v2beta1.SchemeGroupVersion.WithResource("clusterpolicies"):
|
case v2beta1.SchemeGroupVersion.WithResource("clusterpolicies"):
|
||||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Kyverno().V2beta1().ClusterPolicies().Informer()}, nil
|
return &genericInformer{resource: resource.GroupResource(), informer: f.Kyverno().V2beta1().ClusterPolicies().Informer()}, nil
|
||||||
case v2beta1.SchemeGroupVersion.WithResource("policies"):
|
case v2beta1.SchemeGroupVersion.WithResource("policies"):
|
||||||
|
|
|
@ -24,10 +24,6 @@ import (
|
||||||
|
|
||||||
// Interface provides access to all the informers in this group version.
|
// Interface provides access to all the informers in this group version.
|
||||||
type Interface interface {
|
type Interface interface {
|
||||||
// CleanupPolicies returns a CleanupPolicyInformer.
|
|
||||||
CleanupPolicies() CleanupPolicyInformer
|
|
||||||
// ClusterCleanupPolicies returns a ClusterCleanupPolicyInformer.
|
|
||||||
ClusterCleanupPolicies() ClusterCleanupPolicyInformer
|
|
||||||
// PolicyExceptions returns a PolicyExceptionInformer.
|
// PolicyExceptions returns a PolicyExceptionInformer.
|
||||||
PolicyExceptions() PolicyExceptionInformer
|
PolicyExceptions() PolicyExceptionInformer
|
||||||
}
|
}
|
||||||
|
@ -43,16 +39,6 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList
|
||||||
return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
|
return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
|
||||||
}
|
}
|
||||||
|
|
||||||
// CleanupPolicies returns a CleanupPolicyInformer.
|
|
||||||
func (v *version) CleanupPolicies() CleanupPolicyInformer {
|
|
||||||
return &cleanupPolicyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ClusterCleanupPolicies returns a ClusterCleanupPolicyInformer.
|
|
||||||
func (v *version) ClusterCleanupPolicies() ClusterCleanupPolicyInformer {
|
|
||||||
return &clusterCleanupPolicyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
|
|
||||||
}
|
|
||||||
|
|
||||||
// PolicyExceptions returns a PolicyExceptionInformer.
|
// PolicyExceptions returns a PolicyExceptionInformer.
|
||||||
func (v *version) PolicyExceptions() PolicyExceptionInformer {
|
func (v *version) PolicyExceptions() PolicyExceptionInformer {
|
||||||
return &policyExceptionInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
|
return &policyExceptionInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
|
||||||
|
|
|
@ -16,16 +16,16 @@ limitations under the License.
|
||||||
|
|
||||||
// Code generated by informer-gen. DO NOT EDIT.
|
// Code generated by informer-gen. DO NOT EDIT.
|
||||||
|
|
||||||
package v2alpha1
|
package v2beta1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
time "time"
|
time "time"
|
||||||
|
|
||||||
kyvernov2alpha1 "github.com/kyverno/kyverno/api/kyverno/v2alpha1"
|
kyvernov2beta1 "github.com/kyverno/kyverno/api/kyverno/v2beta1"
|
||||||
versioned "github.com/kyverno/kyverno/pkg/client/clientset/versioned"
|
versioned "github.com/kyverno/kyverno/pkg/client/clientset/versioned"
|
||||||
internalinterfaces "github.com/kyverno/kyverno/pkg/client/informers/externalversions/internalinterfaces"
|
internalinterfaces "github.com/kyverno/kyverno/pkg/client/informers/externalversions/internalinterfaces"
|
||||||
v2alpha1 "github.com/kyverno/kyverno/pkg/client/listers/kyverno/v2alpha1"
|
v2beta1 "github.com/kyverno/kyverno/pkg/client/listers/kyverno/v2beta1"
|
||||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||||
watch "k8s.io/apimachinery/pkg/watch"
|
watch "k8s.io/apimachinery/pkg/watch"
|
||||||
|
@ -36,7 +36,7 @@ import (
|
||||||
// CleanupPolicies.
|
// CleanupPolicies.
|
||||||
type CleanupPolicyInformer interface {
|
type CleanupPolicyInformer interface {
|
||||||
Informer() cache.SharedIndexInformer
|
Informer() cache.SharedIndexInformer
|
||||||
Lister() v2alpha1.CleanupPolicyLister
|
Lister() v2beta1.CleanupPolicyLister
|
||||||
}
|
}
|
||||||
|
|
||||||
type cleanupPolicyInformer struct {
|
type cleanupPolicyInformer struct {
|
||||||
|
@ -62,16 +62,16 @@ func NewFilteredCleanupPolicyInformer(client versioned.Interface, namespace stri
|
||||||
if tweakListOptions != nil {
|
if tweakListOptions != nil {
|
||||||
tweakListOptions(&options)
|
tweakListOptions(&options)
|
||||||
}
|
}
|
||||||
return client.KyvernoV2alpha1().CleanupPolicies(namespace).List(context.TODO(), options)
|
return client.KyvernoV2beta1().CleanupPolicies(namespace).List(context.TODO(), options)
|
||||||
},
|
},
|
||||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||||
if tweakListOptions != nil {
|
if tweakListOptions != nil {
|
||||||
tweakListOptions(&options)
|
tweakListOptions(&options)
|
||||||
}
|
}
|
||||||
return client.KyvernoV2alpha1().CleanupPolicies(namespace).Watch(context.TODO(), options)
|
return client.KyvernoV2beta1().CleanupPolicies(namespace).Watch(context.TODO(), options)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
&kyvernov2alpha1.CleanupPolicy{},
|
&kyvernov2beta1.CleanupPolicy{},
|
||||||
resyncPeriod,
|
resyncPeriod,
|
||||||
indexers,
|
indexers,
|
||||||
)
|
)
|
||||||
|
@ -82,9 +82,9 @@ func (f *cleanupPolicyInformer) defaultInformer(client versioned.Interface, resy
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *cleanupPolicyInformer) Informer() cache.SharedIndexInformer {
|
func (f *cleanupPolicyInformer) Informer() cache.SharedIndexInformer {
|
||||||
return f.factory.InformerFor(&kyvernov2alpha1.CleanupPolicy{}, f.defaultInformer)
|
return f.factory.InformerFor(&kyvernov2beta1.CleanupPolicy{}, f.defaultInformer)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *cleanupPolicyInformer) Lister() v2alpha1.CleanupPolicyLister {
|
func (f *cleanupPolicyInformer) Lister() v2beta1.CleanupPolicyLister {
|
||||||
return v2alpha1.NewCleanupPolicyLister(f.Informer().GetIndexer())
|
return v2beta1.NewCleanupPolicyLister(f.Informer().GetIndexer())
|
||||||
}
|
}
|
|
@ -16,16 +16,16 @@ limitations under the License.
|
||||||
|
|
||||||
// Code generated by informer-gen. DO NOT EDIT.
|
// Code generated by informer-gen. DO NOT EDIT.
|
||||||
|
|
||||||
package v2alpha1
|
package v2beta1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
time "time"
|
time "time"
|
||||||
|
|
||||||
kyvernov2alpha1 "github.com/kyverno/kyverno/api/kyverno/v2alpha1"
|
kyvernov2beta1 "github.com/kyverno/kyverno/api/kyverno/v2beta1"
|
||||||
versioned "github.com/kyverno/kyverno/pkg/client/clientset/versioned"
|
versioned "github.com/kyverno/kyverno/pkg/client/clientset/versioned"
|
||||||
internalinterfaces "github.com/kyverno/kyverno/pkg/client/informers/externalversions/internalinterfaces"
|
internalinterfaces "github.com/kyverno/kyverno/pkg/client/informers/externalversions/internalinterfaces"
|
||||||
v2alpha1 "github.com/kyverno/kyverno/pkg/client/listers/kyverno/v2alpha1"
|
v2beta1 "github.com/kyverno/kyverno/pkg/client/listers/kyverno/v2beta1"
|
||||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||||
watch "k8s.io/apimachinery/pkg/watch"
|
watch "k8s.io/apimachinery/pkg/watch"
|
||||||
|
@ -36,7 +36,7 @@ import (
|
||||||
// ClusterCleanupPolicies.
|
// ClusterCleanupPolicies.
|
||||||
type ClusterCleanupPolicyInformer interface {
|
type ClusterCleanupPolicyInformer interface {
|
||||||
Informer() cache.SharedIndexInformer
|
Informer() cache.SharedIndexInformer
|
||||||
Lister() v2alpha1.ClusterCleanupPolicyLister
|
Lister() v2beta1.ClusterCleanupPolicyLister
|
||||||
}
|
}
|
||||||
|
|
||||||
type clusterCleanupPolicyInformer struct {
|
type clusterCleanupPolicyInformer struct {
|
||||||
|
@ -61,16 +61,16 @@ func NewFilteredClusterCleanupPolicyInformer(client versioned.Interface, resyncP
|
||||||
if tweakListOptions != nil {
|
if tweakListOptions != nil {
|
||||||
tweakListOptions(&options)
|
tweakListOptions(&options)
|
||||||
}
|
}
|
||||||
return client.KyvernoV2alpha1().ClusterCleanupPolicies().List(context.TODO(), options)
|
return client.KyvernoV2beta1().ClusterCleanupPolicies().List(context.TODO(), options)
|
||||||
},
|
},
|
||||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||||
if tweakListOptions != nil {
|
if tweakListOptions != nil {
|
||||||
tweakListOptions(&options)
|
tweakListOptions(&options)
|
||||||
}
|
}
|
||||||
return client.KyvernoV2alpha1().ClusterCleanupPolicies().Watch(context.TODO(), options)
|
return client.KyvernoV2beta1().ClusterCleanupPolicies().Watch(context.TODO(), options)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
&kyvernov2alpha1.ClusterCleanupPolicy{},
|
&kyvernov2beta1.ClusterCleanupPolicy{},
|
||||||
resyncPeriod,
|
resyncPeriod,
|
||||||
indexers,
|
indexers,
|
||||||
)
|
)
|
||||||
|
@ -81,9 +81,9 @@ func (f *clusterCleanupPolicyInformer) defaultInformer(client versioned.Interfac
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *clusterCleanupPolicyInformer) Informer() cache.SharedIndexInformer {
|
func (f *clusterCleanupPolicyInformer) Informer() cache.SharedIndexInformer {
|
||||||
return f.factory.InformerFor(&kyvernov2alpha1.ClusterCleanupPolicy{}, f.defaultInformer)
|
return f.factory.InformerFor(&kyvernov2beta1.ClusterCleanupPolicy{}, f.defaultInformer)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *clusterCleanupPolicyInformer) Lister() v2alpha1.ClusterCleanupPolicyLister {
|
func (f *clusterCleanupPolicyInformer) Lister() v2beta1.ClusterCleanupPolicyLister {
|
||||||
return v2alpha1.NewClusterCleanupPolicyLister(f.Informer().GetIndexer())
|
return v2beta1.NewClusterCleanupPolicyLister(f.Informer().GetIndexer())
|
||||||
}
|
}
|
|
@ -24,6 +24,10 @@ import (
|
||||||
|
|
||||||
// Interface provides access to all the informers in this group version.
|
// Interface provides access to all the informers in this group version.
|
||||||
type Interface interface {
|
type Interface interface {
|
||||||
|
// CleanupPolicies returns a CleanupPolicyInformer.
|
||||||
|
CleanupPolicies() CleanupPolicyInformer
|
||||||
|
// ClusterCleanupPolicies returns a ClusterCleanupPolicyInformer.
|
||||||
|
ClusterCleanupPolicies() ClusterCleanupPolicyInformer
|
||||||
// ClusterPolicies returns a ClusterPolicyInformer.
|
// ClusterPolicies returns a ClusterPolicyInformer.
|
||||||
ClusterPolicies() ClusterPolicyInformer
|
ClusterPolicies() ClusterPolicyInformer
|
||||||
// Policies returns a PolicyInformer.
|
// Policies returns a PolicyInformer.
|
||||||
|
@ -43,6 +47,16 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList
|
||||||
return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
|
return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CleanupPolicies returns a CleanupPolicyInformer.
|
||||||
|
func (v *version) CleanupPolicies() CleanupPolicyInformer {
|
||||||
|
return &cleanupPolicyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ClusterCleanupPolicies returns a ClusterCleanupPolicyInformer.
|
||||||
|
func (v *version) ClusterCleanupPolicies() ClusterCleanupPolicyInformer {
|
||||||
|
return &clusterCleanupPolicyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
|
||||||
|
}
|
||||||
|
|
||||||
// ClusterPolicies returns a ClusterPolicyInformer.
|
// ClusterPolicies returns a ClusterPolicyInformer.
|
||||||
func (v *version) ClusterPolicies() ClusterPolicyInformer {
|
func (v *version) ClusterPolicies() ClusterPolicyInformer {
|
||||||
return &clusterPolicyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
|
return &clusterPolicyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
|
||||||
|
|
|
@ -18,18 +18,6 @@ limitations under the License.
|
||||||
|
|
||||||
package v2alpha1
|
package v2alpha1
|
||||||
|
|
||||||
// CleanupPolicyListerExpansion allows custom methods to be added to
|
|
||||||
// CleanupPolicyLister.
|
|
||||||
type CleanupPolicyListerExpansion interface{}
|
|
||||||
|
|
||||||
// CleanupPolicyNamespaceListerExpansion allows custom methods to be added to
|
|
||||||
// CleanupPolicyNamespaceLister.
|
|
||||||
type CleanupPolicyNamespaceListerExpansion interface{}
|
|
||||||
|
|
||||||
// ClusterCleanupPolicyListerExpansion allows custom methods to be added to
|
|
||||||
// ClusterCleanupPolicyLister.
|
|
||||||
type ClusterCleanupPolicyListerExpansion interface{}
|
|
||||||
|
|
||||||
// PolicyExceptionListerExpansion allows custom methods to be added to
|
// PolicyExceptionListerExpansion allows custom methods to be added to
|
||||||
// PolicyExceptionLister.
|
// PolicyExceptionLister.
|
||||||
type PolicyExceptionListerExpansion interface{}
|
type PolicyExceptionListerExpansion interface{}
|
||||||
|
|
|
@ -16,10 +16,10 @@ limitations under the License.
|
||||||
|
|
||||||
// Code generated by lister-gen. DO NOT EDIT.
|
// Code generated by lister-gen. DO NOT EDIT.
|
||||||
|
|
||||||
package v2alpha1
|
package v2beta1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
v2alpha1 "github.com/kyverno/kyverno/api/kyverno/v2alpha1"
|
v2beta1 "github.com/kyverno/kyverno/api/kyverno/v2beta1"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
"k8s.io/client-go/tools/cache"
|
"k8s.io/client-go/tools/cache"
|
||||||
|
@ -30,7 +30,7 @@ import (
|
||||||
type CleanupPolicyLister interface {
|
type CleanupPolicyLister interface {
|
||||||
// List lists all CleanupPolicies in the indexer.
|
// List lists all CleanupPolicies in the indexer.
|
||||||
// Objects returned here must be treated as read-only.
|
// Objects returned here must be treated as read-only.
|
||||||
List(selector labels.Selector) (ret []*v2alpha1.CleanupPolicy, err error)
|
List(selector labels.Selector) (ret []*v2beta1.CleanupPolicy, err error)
|
||||||
// CleanupPolicies returns an object that can list and get CleanupPolicies.
|
// CleanupPolicies returns an object that can list and get CleanupPolicies.
|
||||||
CleanupPolicies(namespace string) CleanupPolicyNamespaceLister
|
CleanupPolicies(namespace string) CleanupPolicyNamespaceLister
|
||||||
CleanupPolicyListerExpansion
|
CleanupPolicyListerExpansion
|
||||||
|
@ -47,9 +47,9 @@ func NewCleanupPolicyLister(indexer cache.Indexer) CleanupPolicyLister {
|
||||||
}
|
}
|
||||||
|
|
||||||
// List lists all CleanupPolicies in the indexer.
|
// List lists all CleanupPolicies in the indexer.
|
||||||
func (s *cleanupPolicyLister) List(selector labels.Selector) (ret []*v2alpha1.CleanupPolicy, err error) {
|
func (s *cleanupPolicyLister) List(selector labels.Selector) (ret []*v2beta1.CleanupPolicy, err error) {
|
||||||
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
|
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
|
||||||
ret = append(ret, m.(*v2alpha1.CleanupPolicy))
|
ret = append(ret, m.(*v2beta1.CleanupPolicy))
|
||||||
})
|
})
|
||||||
return ret, err
|
return ret, err
|
||||||
}
|
}
|
||||||
|
@ -64,10 +64,10 @@ func (s *cleanupPolicyLister) CleanupPolicies(namespace string) CleanupPolicyNam
|
||||||
type CleanupPolicyNamespaceLister interface {
|
type CleanupPolicyNamespaceLister interface {
|
||||||
// List lists all CleanupPolicies in the indexer for a given namespace.
|
// List lists all CleanupPolicies in the indexer for a given namespace.
|
||||||
// Objects returned here must be treated as read-only.
|
// Objects returned here must be treated as read-only.
|
||||||
List(selector labels.Selector) (ret []*v2alpha1.CleanupPolicy, err error)
|
List(selector labels.Selector) (ret []*v2beta1.CleanupPolicy, err error)
|
||||||
// Get retrieves the CleanupPolicy from the indexer for a given namespace and name.
|
// Get retrieves the CleanupPolicy from the indexer for a given namespace and name.
|
||||||
// Objects returned here must be treated as read-only.
|
// Objects returned here must be treated as read-only.
|
||||||
Get(name string) (*v2alpha1.CleanupPolicy, error)
|
Get(name string) (*v2beta1.CleanupPolicy, error)
|
||||||
CleanupPolicyNamespaceListerExpansion
|
CleanupPolicyNamespaceListerExpansion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,21 +79,21 @@ type cleanupPolicyNamespaceLister struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// List lists all CleanupPolicies in the indexer for a given namespace.
|
// List lists all CleanupPolicies in the indexer for a given namespace.
|
||||||
func (s cleanupPolicyNamespaceLister) List(selector labels.Selector) (ret []*v2alpha1.CleanupPolicy, err error) {
|
func (s cleanupPolicyNamespaceLister) List(selector labels.Selector) (ret []*v2beta1.CleanupPolicy, err error) {
|
||||||
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
|
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
|
||||||
ret = append(ret, m.(*v2alpha1.CleanupPolicy))
|
ret = append(ret, m.(*v2beta1.CleanupPolicy))
|
||||||
})
|
})
|
||||||
return ret, err
|
return ret, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get retrieves the CleanupPolicy from the indexer for a given namespace and name.
|
// Get retrieves the CleanupPolicy from the indexer for a given namespace and name.
|
||||||
func (s cleanupPolicyNamespaceLister) Get(name string) (*v2alpha1.CleanupPolicy, error) {
|
func (s cleanupPolicyNamespaceLister) Get(name string) (*v2beta1.CleanupPolicy, error) {
|
||||||
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
|
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if !exists {
|
if !exists {
|
||||||
return nil, errors.NewNotFound(v2alpha1.Resource("cleanuppolicy"), name)
|
return nil, errors.NewNotFound(v2beta1.Resource("cleanuppolicy"), name)
|
||||||
}
|
}
|
||||||
return obj.(*v2alpha1.CleanupPolicy), nil
|
return obj.(*v2beta1.CleanupPolicy), nil
|
||||||
}
|
}
|
|
@ -16,10 +16,10 @@ limitations under the License.
|
||||||
|
|
||||||
// Code generated by lister-gen. DO NOT EDIT.
|
// Code generated by lister-gen. DO NOT EDIT.
|
||||||
|
|
||||||
package v2alpha1
|
package v2beta1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
v2alpha1 "github.com/kyverno/kyverno/api/kyverno/v2alpha1"
|
v2beta1 "github.com/kyverno/kyverno/api/kyverno/v2beta1"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
"k8s.io/client-go/tools/cache"
|
"k8s.io/client-go/tools/cache"
|
||||||
|
@ -30,10 +30,10 @@ import (
|
||||||
type ClusterCleanupPolicyLister interface {
|
type ClusterCleanupPolicyLister interface {
|
||||||
// List lists all ClusterCleanupPolicies in the indexer.
|
// List lists all ClusterCleanupPolicies in the indexer.
|
||||||
// Objects returned here must be treated as read-only.
|
// Objects returned here must be treated as read-only.
|
||||||
List(selector labels.Selector) (ret []*v2alpha1.ClusterCleanupPolicy, err error)
|
List(selector labels.Selector) (ret []*v2beta1.ClusterCleanupPolicy, err error)
|
||||||
// Get retrieves the ClusterCleanupPolicy from the index for a given name.
|
// Get retrieves the ClusterCleanupPolicy from the index for a given name.
|
||||||
// Objects returned here must be treated as read-only.
|
// Objects returned here must be treated as read-only.
|
||||||
Get(name string) (*v2alpha1.ClusterCleanupPolicy, error)
|
Get(name string) (*v2beta1.ClusterCleanupPolicy, error)
|
||||||
ClusterCleanupPolicyListerExpansion
|
ClusterCleanupPolicyListerExpansion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,21 +48,21 @@ func NewClusterCleanupPolicyLister(indexer cache.Indexer) ClusterCleanupPolicyLi
|
||||||
}
|
}
|
||||||
|
|
||||||
// List lists all ClusterCleanupPolicies in the indexer.
|
// List lists all ClusterCleanupPolicies in the indexer.
|
||||||
func (s *clusterCleanupPolicyLister) List(selector labels.Selector) (ret []*v2alpha1.ClusterCleanupPolicy, err error) {
|
func (s *clusterCleanupPolicyLister) List(selector labels.Selector) (ret []*v2beta1.ClusterCleanupPolicy, err error) {
|
||||||
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
|
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
|
||||||
ret = append(ret, m.(*v2alpha1.ClusterCleanupPolicy))
|
ret = append(ret, m.(*v2beta1.ClusterCleanupPolicy))
|
||||||
})
|
})
|
||||||
return ret, err
|
return ret, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get retrieves the ClusterCleanupPolicy from the index for a given name.
|
// Get retrieves the ClusterCleanupPolicy from the index for a given name.
|
||||||
func (s *clusterCleanupPolicyLister) Get(name string) (*v2alpha1.ClusterCleanupPolicy, error) {
|
func (s *clusterCleanupPolicyLister) Get(name string) (*v2beta1.ClusterCleanupPolicy, error) {
|
||||||
obj, exists, err := s.indexer.GetByKey(name)
|
obj, exists, err := s.indexer.GetByKey(name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if !exists {
|
if !exists {
|
||||||
return nil, errors.NewNotFound(v2alpha1.Resource("clustercleanuppolicy"), name)
|
return nil, errors.NewNotFound(v2beta1.Resource("clustercleanuppolicy"), name)
|
||||||
}
|
}
|
||||||
return obj.(*v2alpha1.ClusterCleanupPolicy), nil
|
return obj.(*v2beta1.ClusterCleanupPolicy), nil
|
||||||
}
|
}
|
|
@ -18,6 +18,18 @@ limitations under the License.
|
||||||
|
|
||||||
package v2beta1
|
package v2beta1
|
||||||
|
|
||||||
|
// CleanupPolicyListerExpansion allows custom methods to be added to
|
||||||
|
// CleanupPolicyLister.
|
||||||
|
type CleanupPolicyListerExpansion interface{}
|
||||||
|
|
||||||
|
// CleanupPolicyNamespaceListerExpansion allows custom methods to be added to
|
||||||
|
// CleanupPolicyNamespaceLister.
|
||||||
|
type CleanupPolicyNamespaceListerExpansion interface{}
|
||||||
|
|
||||||
|
// ClusterCleanupPolicyListerExpansion allows custom methods to be added to
|
||||||
|
// ClusterCleanupPolicyLister.
|
||||||
|
type ClusterCleanupPolicyListerExpansion interface{}
|
||||||
|
|
||||||
// ClusterPolicyListerExpansion allows custom methods to be added to
|
// ClusterPolicyListerExpansion allows custom methods to be added to
|
||||||
// ClusterPolicyLister.
|
// ClusterPolicyLister.
|
||||||
type ClusterPolicyListerExpansion interface{}
|
type ClusterPolicyListerExpansion interface{}
|
||||||
|
|
|
@ -3,8 +3,6 @@ package client
|
||||||
import (
|
import (
|
||||||
"github.com/go-logr/logr"
|
"github.com/go-logr/logr"
|
||||||
github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2alpha1 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/kyverno/v2alpha1"
|
github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2alpha1 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/kyverno/v2alpha1"
|
||||||
cleanuppolicies "github.com/kyverno/kyverno/pkg/clients/kyverno/kyvernov2alpha1/cleanuppolicies"
|
|
||||||
clustercleanuppolicies "github.com/kyverno/kyverno/pkg/clients/kyverno/kyvernov2alpha1/clustercleanuppolicies"
|
|
||||||
policyexceptions "github.com/kyverno/kyverno/pkg/clients/kyverno/kyvernov2alpha1/policyexceptions"
|
policyexceptions "github.com/kyverno/kyverno/pkg/clients/kyverno/kyvernov2alpha1/policyexceptions"
|
||||||
"github.com/kyverno/kyverno/pkg/metrics"
|
"github.com/kyverno/kyverno/pkg/metrics"
|
||||||
"k8s.io/client-go/rest"
|
"k8s.io/client-go/rest"
|
||||||
|
@ -31,14 +29,6 @@ type withMetrics struct {
|
||||||
func (c *withMetrics) RESTClient() rest.Interface {
|
func (c *withMetrics) RESTClient() rest.Interface {
|
||||||
return c.inner.RESTClient()
|
return c.inner.RESTClient()
|
||||||
}
|
}
|
||||||
func (c *withMetrics) CleanupPolicies(namespace string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2alpha1.CleanupPolicyInterface {
|
|
||||||
recorder := metrics.NamespacedClientQueryRecorder(c.metrics, namespace, "CleanupPolicy", c.clientType)
|
|
||||||
return cleanuppolicies.WithMetrics(c.inner.CleanupPolicies(namespace), recorder)
|
|
||||||
}
|
|
||||||
func (c *withMetrics) ClusterCleanupPolicies() github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2alpha1.ClusterCleanupPolicyInterface {
|
|
||||||
recorder := metrics.ClusteredClientQueryRecorder(c.metrics, "ClusterCleanupPolicy", c.clientType)
|
|
||||||
return clustercleanuppolicies.WithMetrics(c.inner.ClusterCleanupPolicies(), recorder)
|
|
||||||
}
|
|
||||||
func (c *withMetrics) PolicyExceptions(namespace string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2alpha1.PolicyExceptionInterface {
|
func (c *withMetrics) PolicyExceptions(namespace string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2alpha1.PolicyExceptionInterface {
|
||||||
recorder := metrics.NamespacedClientQueryRecorder(c.metrics, namespace, "PolicyException", c.clientType)
|
recorder := metrics.NamespacedClientQueryRecorder(c.metrics, namespace, "PolicyException", c.clientType)
|
||||||
return policyexceptions.WithMetrics(c.inner.PolicyExceptions(namespace), recorder)
|
return policyexceptions.WithMetrics(c.inner.PolicyExceptions(namespace), recorder)
|
||||||
|
@ -52,12 +42,6 @@ type withTracing struct {
|
||||||
func (c *withTracing) RESTClient() rest.Interface {
|
func (c *withTracing) RESTClient() rest.Interface {
|
||||||
return c.inner.RESTClient()
|
return c.inner.RESTClient()
|
||||||
}
|
}
|
||||||
func (c *withTracing) CleanupPolicies(namespace string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2alpha1.CleanupPolicyInterface {
|
|
||||||
return cleanuppolicies.WithTracing(c.inner.CleanupPolicies(namespace), c.client, "CleanupPolicy")
|
|
||||||
}
|
|
||||||
func (c *withTracing) ClusterCleanupPolicies() github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2alpha1.ClusterCleanupPolicyInterface {
|
|
||||||
return clustercleanuppolicies.WithTracing(c.inner.ClusterCleanupPolicies(), c.client, "ClusterCleanupPolicy")
|
|
||||||
}
|
|
||||||
func (c *withTracing) PolicyExceptions(namespace string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2alpha1.PolicyExceptionInterface {
|
func (c *withTracing) PolicyExceptions(namespace string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2alpha1.PolicyExceptionInterface {
|
||||||
return policyexceptions.WithTracing(c.inner.PolicyExceptions(namespace), c.client, "PolicyException")
|
return policyexceptions.WithTracing(c.inner.PolicyExceptions(namespace), c.client, "PolicyException")
|
||||||
}
|
}
|
||||||
|
@ -70,12 +54,6 @@ type withLogging struct {
|
||||||
func (c *withLogging) RESTClient() rest.Interface {
|
func (c *withLogging) RESTClient() rest.Interface {
|
||||||
return c.inner.RESTClient()
|
return c.inner.RESTClient()
|
||||||
}
|
}
|
||||||
func (c *withLogging) CleanupPolicies(namespace string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2alpha1.CleanupPolicyInterface {
|
|
||||||
return cleanuppolicies.WithLogging(c.inner.CleanupPolicies(namespace), c.logger.WithValues("resource", "CleanupPolicies").WithValues("namespace", namespace))
|
|
||||||
}
|
|
||||||
func (c *withLogging) ClusterCleanupPolicies() github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2alpha1.ClusterCleanupPolicyInterface {
|
|
||||||
return clustercleanuppolicies.WithLogging(c.inner.ClusterCleanupPolicies(), c.logger.WithValues("resource", "ClusterCleanupPolicies"))
|
|
||||||
}
|
|
||||||
func (c *withLogging) PolicyExceptions(namespace string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2alpha1.PolicyExceptionInterface {
|
func (c *withLogging) PolicyExceptions(namespace string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2alpha1.PolicyExceptionInterface {
|
||||||
return policyexceptions.WithLogging(c.inner.PolicyExceptions(namespace), c.logger.WithValues("resource", "PolicyExceptions").WithValues("namespace", namespace))
|
return policyexceptions.WithLogging(c.inner.PolicyExceptions(namespace), c.logger.WithValues("resource", "PolicyExceptions").WithValues("namespace", namespace))
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,8 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/go-logr/logr"
|
"github.com/go-logr/logr"
|
||||||
github_com_kyverno_kyverno_api_kyverno_v2alpha1 "github.com/kyverno/kyverno/api/kyverno/v2alpha1"
|
github_com_kyverno_kyverno_api_kyverno_v2beta1 "github.com/kyverno/kyverno/api/kyverno/v2beta1"
|
||||||
github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2alpha1 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/kyverno/v2alpha1"
|
github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2beta1 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/kyverno/v2beta1"
|
||||||
"github.com/kyverno/kyverno/pkg/metrics"
|
"github.com/kyverno/kyverno/pkg/metrics"
|
||||||
"github.com/kyverno/kyverno/pkg/tracing"
|
"github.com/kyverno/kyverno/pkg/tracing"
|
||||||
"go.opentelemetry.io/otel/trace"
|
"go.opentelemetry.io/otel/trace"
|
||||||
|
@ -17,24 +17,24 @@ import (
|
||||||
k8s_io_apimachinery_pkg_watch "k8s.io/apimachinery/pkg/watch"
|
k8s_io_apimachinery_pkg_watch "k8s.io/apimachinery/pkg/watch"
|
||||||
)
|
)
|
||||||
|
|
||||||
func WithLogging(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2alpha1.ClusterCleanupPolicyInterface, logger logr.Logger) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2alpha1.ClusterCleanupPolicyInterface {
|
func WithLogging(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2beta1.CleanupPolicyInterface, logger logr.Logger) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2beta1.CleanupPolicyInterface {
|
||||||
return &withLogging{inner, logger}
|
return &withLogging{inner, logger}
|
||||||
}
|
}
|
||||||
|
|
||||||
func WithMetrics(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2alpha1.ClusterCleanupPolicyInterface, recorder metrics.Recorder) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2alpha1.ClusterCleanupPolicyInterface {
|
func WithMetrics(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2beta1.CleanupPolicyInterface, recorder metrics.Recorder) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2beta1.CleanupPolicyInterface {
|
||||||
return &withMetrics{inner, recorder}
|
return &withMetrics{inner, recorder}
|
||||||
}
|
}
|
||||||
|
|
||||||
func WithTracing(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2alpha1.ClusterCleanupPolicyInterface, client, kind string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2alpha1.ClusterCleanupPolicyInterface {
|
func WithTracing(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2beta1.CleanupPolicyInterface, client, kind string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2beta1.CleanupPolicyInterface {
|
||||||
return &withTracing{inner, client, kind}
|
return &withTracing{inner, client, kind}
|
||||||
}
|
}
|
||||||
|
|
||||||
type withLogging struct {
|
type withLogging struct {
|
||||||
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2alpha1.ClusterCleanupPolicyInterface
|
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2beta1.CleanupPolicyInterface
|
||||||
logger logr.Logger
|
logger logr.Logger
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *withLogging) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2alpha1.ClusterCleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.ClusterCleanupPolicy, error) {
|
func (c *withLogging) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2beta1.CleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.CleanupPolicy, error) {
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
logger := c.logger.WithValues("operation", "Create")
|
logger := c.logger.WithValues("operation", "Create")
|
||||||
ret0, ret1 := c.inner.Create(arg0, arg1, arg2)
|
ret0, ret1 := c.inner.Create(arg0, arg1, arg2)
|
||||||
|
@ -67,7 +67,7 @@ func (c *withLogging) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimach
|
||||||
}
|
}
|
||||||
return ret0
|
return ret0
|
||||||
}
|
}
|
||||||
func (c *withLogging) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.ClusterCleanupPolicy, error) {
|
func (c *withLogging) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.CleanupPolicy, error) {
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
logger := c.logger.WithValues("operation", "Get")
|
logger := c.logger.WithValues("operation", "Get")
|
||||||
ret0, ret1 := c.inner.Get(arg0, arg1, arg2)
|
ret0, ret1 := c.inner.Get(arg0, arg1, arg2)
|
||||||
|
@ -78,7 +78,7 @@ func (c *withLogging) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimach
|
||||||
}
|
}
|
||||||
return ret0, ret1
|
return ret0, ret1
|
||||||
}
|
}
|
||||||
func (c *withLogging) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.ClusterCleanupPolicyList, error) {
|
func (c *withLogging) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.CleanupPolicyList, error) {
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
logger := c.logger.WithValues("operation", "List")
|
logger := c.logger.WithValues("operation", "List")
|
||||||
ret0, ret1 := c.inner.List(arg0, arg1)
|
ret0, ret1 := c.inner.List(arg0, arg1)
|
||||||
|
@ -89,7 +89,7 @@ func (c *withLogging) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_ap
|
||||||
}
|
}
|
||||||
return ret0, ret1
|
return ret0, ret1
|
||||||
}
|
}
|
||||||
func (c *withLogging) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.ClusterCleanupPolicy, error) {
|
func (c *withLogging) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.CleanupPolicy, error) {
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
logger := c.logger.WithValues("operation", "Patch")
|
logger := c.logger.WithValues("operation", "Patch")
|
||||||
ret0, ret1 := c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...)
|
ret0, ret1 := c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...)
|
||||||
|
@ -100,7 +100,7 @@ func (c *withLogging) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apima
|
||||||
}
|
}
|
||||||
return ret0, ret1
|
return ret0, ret1
|
||||||
}
|
}
|
||||||
func (c *withLogging) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2alpha1.ClusterCleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.ClusterCleanupPolicy, error) {
|
func (c *withLogging) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2beta1.CleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.CleanupPolicy, error) {
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
logger := c.logger.WithValues("operation", "Update")
|
logger := c.logger.WithValues("operation", "Update")
|
||||||
ret0, ret1 := c.inner.Update(arg0, arg1, arg2)
|
ret0, ret1 := c.inner.Update(arg0, arg1, arg2)
|
||||||
|
@ -111,7 +111,7 @@ func (c *withLogging) Update(arg0 context.Context, arg1 *github_com_kyverno_kyve
|
||||||
}
|
}
|
||||||
return ret0, ret1
|
return ret0, ret1
|
||||||
}
|
}
|
||||||
func (c *withLogging) UpdateStatus(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2alpha1.ClusterCleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.ClusterCleanupPolicy, error) {
|
func (c *withLogging) UpdateStatus(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2beta1.CleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.CleanupPolicy, error) {
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
logger := c.logger.WithValues("operation", "UpdateStatus")
|
logger := c.logger.WithValues("operation", "UpdateStatus")
|
||||||
ret0, ret1 := c.inner.UpdateStatus(arg0, arg1, arg2)
|
ret0, ret1 := c.inner.UpdateStatus(arg0, arg1, arg2)
|
||||||
|
@ -135,11 +135,11 @@ func (c *withLogging) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_a
|
||||||
}
|
}
|
||||||
|
|
||||||
type withMetrics struct {
|
type withMetrics struct {
|
||||||
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2alpha1.ClusterCleanupPolicyInterface
|
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2beta1.CleanupPolicyInterface
|
||||||
recorder metrics.Recorder
|
recorder metrics.Recorder
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *withMetrics) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2alpha1.ClusterCleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.ClusterCleanupPolicy, error) {
|
func (c *withMetrics) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2beta1.CleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.CleanupPolicy, error) {
|
||||||
defer c.recorder.RecordWithContext(arg0, "create")
|
defer c.recorder.RecordWithContext(arg0, "create")
|
||||||
return c.inner.Create(arg0, arg1, arg2)
|
return c.inner.Create(arg0, arg1, arg2)
|
||||||
}
|
}
|
||||||
|
@ -151,23 +151,23 @@ func (c *withMetrics) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimach
|
||||||
defer c.recorder.RecordWithContext(arg0, "delete_collection")
|
defer c.recorder.RecordWithContext(arg0, "delete_collection")
|
||||||
return c.inner.DeleteCollection(arg0, arg1, arg2)
|
return c.inner.DeleteCollection(arg0, arg1, arg2)
|
||||||
}
|
}
|
||||||
func (c *withMetrics) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.ClusterCleanupPolicy, error) {
|
func (c *withMetrics) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.CleanupPolicy, error) {
|
||||||
defer c.recorder.RecordWithContext(arg0, "get")
|
defer c.recorder.RecordWithContext(arg0, "get")
|
||||||
return c.inner.Get(arg0, arg1, arg2)
|
return c.inner.Get(arg0, arg1, arg2)
|
||||||
}
|
}
|
||||||
func (c *withMetrics) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.ClusterCleanupPolicyList, error) {
|
func (c *withMetrics) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.CleanupPolicyList, error) {
|
||||||
defer c.recorder.RecordWithContext(arg0, "list")
|
defer c.recorder.RecordWithContext(arg0, "list")
|
||||||
return c.inner.List(arg0, arg1)
|
return c.inner.List(arg0, arg1)
|
||||||
}
|
}
|
||||||
func (c *withMetrics) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.ClusterCleanupPolicy, error) {
|
func (c *withMetrics) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.CleanupPolicy, error) {
|
||||||
defer c.recorder.RecordWithContext(arg0, "patch")
|
defer c.recorder.RecordWithContext(arg0, "patch")
|
||||||
return c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...)
|
return c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...)
|
||||||
}
|
}
|
||||||
func (c *withMetrics) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2alpha1.ClusterCleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.ClusterCleanupPolicy, error) {
|
func (c *withMetrics) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2beta1.CleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.CleanupPolicy, error) {
|
||||||
defer c.recorder.RecordWithContext(arg0, "update")
|
defer c.recorder.RecordWithContext(arg0, "update")
|
||||||
return c.inner.Update(arg0, arg1, arg2)
|
return c.inner.Update(arg0, arg1, arg2)
|
||||||
}
|
}
|
||||||
func (c *withMetrics) UpdateStatus(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2alpha1.ClusterCleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.ClusterCleanupPolicy, error) {
|
func (c *withMetrics) UpdateStatus(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2beta1.CleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.CleanupPolicy, error) {
|
||||||
defer c.recorder.RecordWithContext(arg0, "update_status")
|
defer c.recorder.RecordWithContext(arg0, "update_status")
|
||||||
return c.inner.UpdateStatus(arg0, arg1, arg2)
|
return c.inner.UpdateStatus(arg0, arg1, arg2)
|
||||||
}
|
}
|
||||||
|
@ -177,12 +177,12 @@ func (c *withMetrics) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_a
|
||||||
}
|
}
|
||||||
|
|
||||||
type withTracing struct {
|
type withTracing struct {
|
||||||
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2alpha1.ClusterCleanupPolicyInterface
|
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2beta1.CleanupPolicyInterface
|
||||||
client string
|
client string
|
||||||
kind string
|
kind string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *withTracing) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2alpha1.ClusterCleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.ClusterCleanupPolicy, error) {
|
func (c *withTracing) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2beta1.CleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.CleanupPolicy, error) {
|
||||||
var span trace.Span
|
var span trace.Span
|
||||||
if tracing.IsInSpan(arg0) {
|
if tracing.IsInSpan(arg0) {
|
||||||
arg0, span = tracing.StartChildSpan(
|
arg0, span = tracing.StartChildSpan(
|
||||||
|
@ -245,7 +245,7 @@ func (c *withTracing) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimach
|
||||||
}
|
}
|
||||||
return ret0
|
return ret0
|
||||||
}
|
}
|
||||||
func (c *withTracing) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.ClusterCleanupPolicy, error) {
|
func (c *withTracing) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.CleanupPolicy, error) {
|
||||||
var span trace.Span
|
var span trace.Span
|
||||||
if tracing.IsInSpan(arg0) {
|
if tracing.IsInSpan(arg0) {
|
||||||
arg0, span = tracing.StartChildSpan(
|
arg0, span = tracing.StartChildSpan(
|
||||||
|
@ -266,7 +266,7 @@ func (c *withTracing) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimach
|
||||||
}
|
}
|
||||||
return ret0, ret1
|
return ret0, ret1
|
||||||
}
|
}
|
||||||
func (c *withTracing) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.ClusterCleanupPolicyList, error) {
|
func (c *withTracing) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.CleanupPolicyList, error) {
|
||||||
var span trace.Span
|
var span trace.Span
|
||||||
if tracing.IsInSpan(arg0) {
|
if tracing.IsInSpan(arg0) {
|
||||||
arg0, span = tracing.StartChildSpan(
|
arg0, span = tracing.StartChildSpan(
|
||||||
|
@ -287,7 +287,7 @@ func (c *withTracing) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_ap
|
||||||
}
|
}
|
||||||
return ret0, ret1
|
return ret0, ret1
|
||||||
}
|
}
|
||||||
func (c *withTracing) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.ClusterCleanupPolicy, error) {
|
func (c *withTracing) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.CleanupPolicy, error) {
|
||||||
var span trace.Span
|
var span trace.Span
|
||||||
if tracing.IsInSpan(arg0) {
|
if tracing.IsInSpan(arg0) {
|
||||||
arg0, span = tracing.StartChildSpan(
|
arg0, span = tracing.StartChildSpan(
|
||||||
|
@ -308,7 +308,7 @@ func (c *withTracing) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apima
|
||||||
}
|
}
|
||||||
return ret0, ret1
|
return ret0, ret1
|
||||||
}
|
}
|
||||||
func (c *withTracing) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2alpha1.ClusterCleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.ClusterCleanupPolicy, error) {
|
func (c *withTracing) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2beta1.CleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.CleanupPolicy, error) {
|
||||||
var span trace.Span
|
var span trace.Span
|
||||||
if tracing.IsInSpan(arg0) {
|
if tracing.IsInSpan(arg0) {
|
||||||
arg0, span = tracing.StartChildSpan(
|
arg0, span = tracing.StartChildSpan(
|
||||||
|
@ -329,7 +329,7 @@ func (c *withTracing) Update(arg0 context.Context, arg1 *github_com_kyverno_kyve
|
||||||
}
|
}
|
||||||
return ret0, ret1
|
return ret0, ret1
|
||||||
}
|
}
|
||||||
func (c *withTracing) UpdateStatus(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2alpha1.ClusterCleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.ClusterCleanupPolicy, error) {
|
func (c *withTracing) UpdateStatus(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2beta1.CleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.CleanupPolicy, error) {
|
||||||
var span trace.Span
|
var span trace.Span
|
||||||
if tracing.IsInSpan(arg0) {
|
if tracing.IsInSpan(arg0) {
|
||||||
arg0, span = tracing.StartChildSpan(
|
arg0, span = tracing.StartChildSpan(
|
|
@ -3,6 +3,8 @@ package client
|
||||||
import (
|
import (
|
||||||
"github.com/go-logr/logr"
|
"github.com/go-logr/logr"
|
||||||
github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2beta1 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/kyverno/v2beta1"
|
github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2beta1 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/kyverno/v2beta1"
|
||||||
|
cleanuppolicies "github.com/kyverno/kyverno/pkg/clients/kyverno/kyvernov2beta1/cleanuppolicies"
|
||||||
|
clustercleanuppolicies "github.com/kyverno/kyverno/pkg/clients/kyverno/kyvernov2beta1/clustercleanuppolicies"
|
||||||
clusterpolicies "github.com/kyverno/kyverno/pkg/clients/kyverno/kyvernov2beta1/clusterpolicies"
|
clusterpolicies "github.com/kyverno/kyverno/pkg/clients/kyverno/kyvernov2beta1/clusterpolicies"
|
||||||
policies "github.com/kyverno/kyverno/pkg/clients/kyverno/kyvernov2beta1/policies"
|
policies "github.com/kyverno/kyverno/pkg/clients/kyverno/kyvernov2beta1/policies"
|
||||||
policyexceptions "github.com/kyverno/kyverno/pkg/clients/kyverno/kyvernov2beta1/policyexceptions"
|
policyexceptions "github.com/kyverno/kyverno/pkg/clients/kyverno/kyvernov2beta1/policyexceptions"
|
||||||
|
@ -31,6 +33,14 @@ type withMetrics struct {
|
||||||
func (c *withMetrics) RESTClient() rest.Interface {
|
func (c *withMetrics) RESTClient() rest.Interface {
|
||||||
return c.inner.RESTClient()
|
return c.inner.RESTClient()
|
||||||
}
|
}
|
||||||
|
func (c *withMetrics) CleanupPolicies(namespace string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2beta1.CleanupPolicyInterface {
|
||||||
|
recorder := metrics.NamespacedClientQueryRecorder(c.metrics, namespace, "CleanupPolicy", c.clientType)
|
||||||
|
return cleanuppolicies.WithMetrics(c.inner.CleanupPolicies(namespace), recorder)
|
||||||
|
}
|
||||||
|
func (c *withMetrics) ClusterCleanupPolicies() github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2beta1.ClusterCleanupPolicyInterface {
|
||||||
|
recorder := metrics.ClusteredClientQueryRecorder(c.metrics, "ClusterCleanupPolicy", c.clientType)
|
||||||
|
return clustercleanuppolicies.WithMetrics(c.inner.ClusterCleanupPolicies(), recorder)
|
||||||
|
}
|
||||||
func (c *withMetrics) ClusterPolicies() github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2beta1.ClusterPolicyInterface {
|
func (c *withMetrics) ClusterPolicies() github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2beta1.ClusterPolicyInterface {
|
||||||
recorder := metrics.ClusteredClientQueryRecorder(c.metrics, "ClusterPolicy", c.clientType)
|
recorder := metrics.ClusteredClientQueryRecorder(c.metrics, "ClusterPolicy", c.clientType)
|
||||||
return clusterpolicies.WithMetrics(c.inner.ClusterPolicies(), recorder)
|
return clusterpolicies.WithMetrics(c.inner.ClusterPolicies(), recorder)
|
||||||
|
@ -52,6 +62,12 @@ type withTracing struct {
|
||||||
func (c *withTracing) RESTClient() rest.Interface {
|
func (c *withTracing) RESTClient() rest.Interface {
|
||||||
return c.inner.RESTClient()
|
return c.inner.RESTClient()
|
||||||
}
|
}
|
||||||
|
func (c *withTracing) CleanupPolicies(namespace string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2beta1.CleanupPolicyInterface {
|
||||||
|
return cleanuppolicies.WithTracing(c.inner.CleanupPolicies(namespace), c.client, "CleanupPolicy")
|
||||||
|
}
|
||||||
|
func (c *withTracing) ClusterCleanupPolicies() github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2beta1.ClusterCleanupPolicyInterface {
|
||||||
|
return clustercleanuppolicies.WithTracing(c.inner.ClusterCleanupPolicies(), c.client, "ClusterCleanupPolicy")
|
||||||
|
}
|
||||||
func (c *withTracing) ClusterPolicies() github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2beta1.ClusterPolicyInterface {
|
func (c *withTracing) ClusterPolicies() github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2beta1.ClusterPolicyInterface {
|
||||||
return clusterpolicies.WithTracing(c.inner.ClusterPolicies(), c.client, "ClusterPolicy")
|
return clusterpolicies.WithTracing(c.inner.ClusterPolicies(), c.client, "ClusterPolicy")
|
||||||
}
|
}
|
||||||
|
@ -70,6 +86,12 @@ type withLogging struct {
|
||||||
func (c *withLogging) RESTClient() rest.Interface {
|
func (c *withLogging) RESTClient() rest.Interface {
|
||||||
return c.inner.RESTClient()
|
return c.inner.RESTClient()
|
||||||
}
|
}
|
||||||
|
func (c *withLogging) CleanupPolicies(namespace string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2beta1.CleanupPolicyInterface {
|
||||||
|
return cleanuppolicies.WithLogging(c.inner.CleanupPolicies(namespace), c.logger.WithValues("resource", "CleanupPolicies").WithValues("namespace", namespace))
|
||||||
|
}
|
||||||
|
func (c *withLogging) ClusterCleanupPolicies() github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2beta1.ClusterCleanupPolicyInterface {
|
||||||
|
return clustercleanuppolicies.WithLogging(c.inner.ClusterCleanupPolicies(), c.logger.WithValues("resource", "ClusterCleanupPolicies"))
|
||||||
|
}
|
||||||
func (c *withLogging) ClusterPolicies() github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2beta1.ClusterPolicyInterface {
|
func (c *withLogging) ClusterPolicies() github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2beta1.ClusterPolicyInterface {
|
||||||
return clusterpolicies.WithLogging(c.inner.ClusterPolicies(), c.logger.WithValues("resource", "ClusterPolicies"))
|
return clusterpolicies.WithLogging(c.inner.ClusterPolicies(), c.logger.WithValues("resource", "ClusterPolicies"))
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,8 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/go-logr/logr"
|
"github.com/go-logr/logr"
|
||||||
github_com_kyverno_kyverno_api_kyverno_v2alpha1 "github.com/kyverno/kyverno/api/kyverno/v2alpha1"
|
github_com_kyverno_kyverno_api_kyverno_v2beta1 "github.com/kyverno/kyverno/api/kyverno/v2beta1"
|
||||||
github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2alpha1 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/kyverno/v2alpha1"
|
github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2beta1 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/kyverno/v2beta1"
|
||||||
"github.com/kyverno/kyverno/pkg/metrics"
|
"github.com/kyverno/kyverno/pkg/metrics"
|
||||||
"github.com/kyverno/kyverno/pkg/tracing"
|
"github.com/kyverno/kyverno/pkg/tracing"
|
||||||
"go.opentelemetry.io/otel/trace"
|
"go.opentelemetry.io/otel/trace"
|
||||||
|
@ -17,24 +17,24 @@ import (
|
||||||
k8s_io_apimachinery_pkg_watch "k8s.io/apimachinery/pkg/watch"
|
k8s_io_apimachinery_pkg_watch "k8s.io/apimachinery/pkg/watch"
|
||||||
)
|
)
|
||||||
|
|
||||||
func WithLogging(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2alpha1.CleanupPolicyInterface, logger logr.Logger) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2alpha1.CleanupPolicyInterface {
|
func WithLogging(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2beta1.ClusterCleanupPolicyInterface, logger logr.Logger) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2beta1.ClusterCleanupPolicyInterface {
|
||||||
return &withLogging{inner, logger}
|
return &withLogging{inner, logger}
|
||||||
}
|
}
|
||||||
|
|
||||||
func WithMetrics(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2alpha1.CleanupPolicyInterface, recorder metrics.Recorder) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2alpha1.CleanupPolicyInterface {
|
func WithMetrics(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2beta1.ClusterCleanupPolicyInterface, recorder metrics.Recorder) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2beta1.ClusterCleanupPolicyInterface {
|
||||||
return &withMetrics{inner, recorder}
|
return &withMetrics{inner, recorder}
|
||||||
}
|
}
|
||||||
|
|
||||||
func WithTracing(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2alpha1.CleanupPolicyInterface, client, kind string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2alpha1.CleanupPolicyInterface {
|
func WithTracing(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2beta1.ClusterCleanupPolicyInterface, client, kind string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2beta1.ClusterCleanupPolicyInterface {
|
||||||
return &withTracing{inner, client, kind}
|
return &withTracing{inner, client, kind}
|
||||||
}
|
}
|
||||||
|
|
||||||
type withLogging struct {
|
type withLogging struct {
|
||||||
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2alpha1.CleanupPolicyInterface
|
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2beta1.ClusterCleanupPolicyInterface
|
||||||
logger logr.Logger
|
logger logr.Logger
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *withLogging) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2alpha1.CleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.CleanupPolicy, error) {
|
func (c *withLogging) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2beta1.ClusterCleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.ClusterCleanupPolicy, error) {
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
logger := c.logger.WithValues("operation", "Create")
|
logger := c.logger.WithValues("operation", "Create")
|
||||||
ret0, ret1 := c.inner.Create(arg0, arg1, arg2)
|
ret0, ret1 := c.inner.Create(arg0, arg1, arg2)
|
||||||
|
@ -67,7 +67,7 @@ func (c *withLogging) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimach
|
||||||
}
|
}
|
||||||
return ret0
|
return ret0
|
||||||
}
|
}
|
||||||
func (c *withLogging) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.CleanupPolicy, error) {
|
func (c *withLogging) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.ClusterCleanupPolicy, error) {
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
logger := c.logger.WithValues("operation", "Get")
|
logger := c.logger.WithValues("operation", "Get")
|
||||||
ret0, ret1 := c.inner.Get(arg0, arg1, arg2)
|
ret0, ret1 := c.inner.Get(arg0, arg1, arg2)
|
||||||
|
@ -78,7 +78,7 @@ func (c *withLogging) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimach
|
||||||
}
|
}
|
||||||
return ret0, ret1
|
return ret0, ret1
|
||||||
}
|
}
|
||||||
func (c *withLogging) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.CleanupPolicyList, error) {
|
func (c *withLogging) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.ClusterCleanupPolicyList, error) {
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
logger := c.logger.WithValues("operation", "List")
|
logger := c.logger.WithValues("operation", "List")
|
||||||
ret0, ret1 := c.inner.List(arg0, arg1)
|
ret0, ret1 := c.inner.List(arg0, arg1)
|
||||||
|
@ -89,7 +89,7 @@ func (c *withLogging) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_ap
|
||||||
}
|
}
|
||||||
return ret0, ret1
|
return ret0, ret1
|
||||||
}
|
}
|
||||||
func (c *withLogging) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.CleanupPolicy, error) {
|
func (c *withLogging) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.ClusterCleanupPolicy, error) {
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
logger := c.logger.WithValues("operation", "Patch")
|
logger := c.logger.WithValues("operation", "Patch")
|
||||||
ret0, ret1 := c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...)
|
ret0, ret1 := c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...)
|
||||||
|
@ -100,7 +100,7 @@ func (c *withLogging) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apima
|
||||||
}
|
}
|
||||||
return ret0, ret1
|
return ret0, ret1
|
||||||
}
|
}
|
||||||
func (c *withLogging) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2alpha1.CleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.CleanupPolicy, error) {
|
func (c *withLogging) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2beta1.ClusterCleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.ClusterCleanupPolicy, error) {
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
logger := c.logger.WithValues("operation", "Update")
|
logger := c.logger.WithValues("operation", "Update")
|
||||||
ret0, ret1 := c.inner.Update(arg0, arg1, arg2)
|
ret0, ret1 := c.inner.Update(arg0, arg1, arg2)
|
||||||
|
@ -111,7 +111,7 @@ func (c *withLogging) Update(arg0 context.Context, arg1 *github_com_kyverno_kyve
|
||||||
}
|
}
|
||||||
return ret0, ret1
|
return ret0, ret1
|
||||||
}
|
}
|
||||||
func (c *withLogging) UpdateStatus(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2alpha1.CleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.CleanupPolicy, error) {
|
func (c *withLogging) UpdateStatus(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2beta1.ClusterCleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.ClusterCleanupPolicy, error) {
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
logger := c.logger.WithValues("operation", "UpdateStatus")
|
logger := c.logger.WithValues("operation", "UpdateStatus")
|
||||||
ret0, ret1 := c.inner.UpdateStatus(arg0, arg1, arg2)
|
ret0, ret1 := c.inner.UpdateStatus(arg0, arg1, arg2)
|
||||||
|
@ -135,11 +135,11 @@ func (c *withLogging) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_a
|
||||||
}
|
}
|
||||||
|
|
||||||
type withMetrics struct {
|
type withMetrics struct {
|
||||||
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2alpha1.CleanupPolicyInterface
|
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2beta1.ClusterCleanupPolicyInterface
|
||||||
recorder metrics.Recorder
|
recorder metrics.Recorder
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *withMetrics) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2alpha1.CleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.CleanupPolicy, error) {
|
func (c *withMetrics) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2beta1.ClusterCleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.ClusterCleanupPolicy, error) {
|
||||||
defer c.recorder.RecordWithContext(arg0, "create")
|
defer c.recorder.RecordWithContext(arg0, "create")
|
||||||
return c.inner.Create(arg0, arg1, arg2)
|
return c.inner.Create(arg0, arg1, arg2)
|
||||||
}
|
}
|
||||||
|
@ -151,23 +151,23 @@ func (c *withMetrics) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimach
|
||||||
defer c.recorder.RecordWithContext(arg0, "delete_collection")
|
defer c.recorder.RecordWithContext(arg0, "delete_collection")
|
||||||
return c.inner.DeleteCollection(arg0, arg1, arg2)
|
return c.inner.DeleteCollection(arg0, arg1, arg2)
|
||||||
}
|
}
|
||||||
func (c *withMetrics) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.CleanupPolicy, error) {
|
func (c *withMetrics) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.ClusterCleanupPolicy, error) {
|
||||||
defer c.recorder.RecordWithContext(arg0, "get")
|
defer c.recorder.RecordWithContext(arg0, "get")
|
||||||
return c.inner.Get(arg0, arg1, arg2)
|
return c.inner.Get(arg0, arg1, arg2)
|
||||||
}
|
}
|
||||||
func (c *withMetrics) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.CleanupPolicyList, error) {
|
func (c *withMetrics) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.ClusterCleanupPolicyList, error) {
|
||||||
defer c.recorder.RecordWithContext(arg0, "list")
|
defer c.recorder.RecordWithContext(arg0, "list")
|
||||||
return c.inner.List(arg0, arg1)
|
return c.inner.List(arg0, arg1)
|
||||||
}
|
}
|
||||||
func (c *withMetrics) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.CleanupPolicy, error) {
|
func (c *withMetrics) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.ClusterCleanupPolicy, error) {
|
||||||
defer c.recorder.RecordWithContext(arg0, "patch")
|
defer c.recorder.RecordWithContext(arg0, "patch")
|
||||||
return c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...)
|
return c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...)
|
||||||
}
|
}
|
||||||
func (c *withMetrics) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2alpha1.CleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.CleanupPolicy, error) {
|
func (c *withMetrics) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2beta1.ClusterCleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.ClusterCleanupPolicy, error) {
|
||||||
defer c.recorder.RecordWithContext(arg0, "update")
|
defer c.recorder.RecordWithContext(arg0, "update")
|
||||||
return c.inner.Update(arg0, arg1, arg2)
|
return c.inner.Update(arg0, arg1, arg2)
|
||||||
}
|
}
|
||||||
func (c *withMetrics) UpdateStatus(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2alpha1.CleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.CleanupPolicy, error) {
|
func (c *withMetrics) UpdateStatus(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2beta1.ClusterCleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.ClusterCleanupPolicy, error) {
|
||||||
defer c.recorder.RecordWithContext(arg0, "update_status")
|
defer c.recorder.RecordWithContext(arg0, "update_status")
|
||||||
return c.inner.UpdateStatus(arg0, arg1, arg2)
|
return c.inner.UpdateStatus(arg0, arg1, arg2)
|
||||||
}
|
}
|
||||||
|
@ -177,12 +177,12 @@ func (c *withMetrics) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_a
|
||||||
}
|
}
|
||||||
|
|
||||||
type withTracing struct {
|
type withTracing struct {
|
||||||
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2alpha1.CleanupPolicyInterface
|
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v2beta1.ClusterCleanupPolicyInterface
|
||||||
client string
|
client string
|
||||||
kind string
|
kind string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *withTracing) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2alpha1.CleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.CleanupPolicy, error) {
|
func (c *withTracing) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2beta1.ClusterCleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.ClusterCleanupPolicy, error) {
|
||||||
var span trace.Span
|
var span trace.Span
|
||||||
if tracing.IsInSpan(arg0) {
|
if tracing.IsInSpan(arg0) {
|
||||||
arg0, span = tracing.StartChildSpan(
|
arg0, span = tracing.StartChildSpan(
|
||||||
|
@ -245,7 +245,7 @@ func (c *withTracing) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimach
|
||||||
}
|
}
|
||||||
return ret0
|
return ret0
|
||||||
}
|
}
|
||||||
func (c *withTracing) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.CleanupPolicy, error) {
|
func (c *withTracing) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.ClusterCleanupPolicy, error) {
|
||||||
var span trace.Span
|
var span trace.Span
|
||||||
if tracing.IsInSpan(arg0) {
|
if tracing.IsInSpan(arg0) {
|
||||||
arg0, span = tracing.StartChildSpan(
|
arg0, span = tracing.StartChildSpan(
|
||||||
|
@ -266,7 +266,7 @@ func (c *withTracing) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimach
|
||||||
}
|
}
|
||||||
return ret0, ret1
|
return ret0, ret1
|
||||||
}
|
}
|
||||||
func (c *withTracing) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.CleanupPolicyList, error) {
|
func (c *withTracing) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.ClusterCleanupPolicyList, error) {
|
||||||
var span trace.Span
|
var span trace.Span
|
||||||
if tracing.IsInSpan(arg0) {
|
if tracing.IsInSpan(arg0) {
|
||||||
arg0, span = tracing.StartChildSpan(
|
arg0, span = tracing.StartChildSpan(
|
||||||
|
@ -287,7 +287,7 @@ func (c *withTracing) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_ap
|
||||||
}
|
}
|
||||||
return ret0, ret1
|
return ret0, ret1
|
||||||
}
|
}
|
||||||
func (c *withTracing) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.CleanupPolicy, error) {
|
func (c *withTracing) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.ClusterCleanupPolicy, error) {
|
||||||
var span trace.Span
|
var span trace.Span
|
||||||
if tracing.IsInSpan(arg0) {
|
if tracing.IsInSpan(arg0) {
|
||||||
arg0, span = tracing.StartChildSpan(
|
arg0, span = tracing.StartChildSpan(
|
||||||
|
@ -308,7 +308,7 @@ func (c *withTracing) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apima
|
||||||
}
|
}
|
||||||
return ret0, ret1
|
return ret0, ret1
|
||||||
}
|
}
|
||||||
func (c *withTracing) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2alpha1.CleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.CleanupPolicy, error) {
|
func (c *withTracing) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2beta1.ClusterCleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.ClusterCleanupPolicy, error) {
|
||||||
var span trace.Span
|
var span trace.Span
|
||||||
if tracing.IsInSpan(arg0) {
|
if tracing.IsInSpan(arg0) {
|
||||||
arg0, span = tracing.StartChildSpan(
|
arg0, span = tracing.StartChildSpan(
|
||||||
|
@ -329,7 +329,7 @@ func (c *withTracing) Update(arg0 context.Context, arg1 *github_com_kyverno_kyve
|
||||||
}
|
}
|
||||||
return ret0, ret1
|
return ret0, ret1
|
||||||
}
|
}
|
||||||
func (c *withTracing) UpdateStatus(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2alpha1.CleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2alpha1.CleanupPolicy, error) {
|
func (c *withTracing) UpdateStatus(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v2beta1.ClusterCleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v2beta1.ClusterCleanupPolicy, error) {
|
||||||
var span trace.Span
|
var span trace.Span
|
||||||
if tracing.IsInSpan(arg0) {
|
if tracing.IsInSpan(arg0) {
|
||||||
arg0, span = tracing.StartChildSpan(
|
arg0, span = tracing.StartChildSpan(
|
|
@ -7,10 +7,10 @@ import (
|
||||||
"github.com/go-logr/logr"
|
"github.com/go-logr/logr"
|
||||||
kyvernov1 "github.com/kyverno/kyverno/api/kyverno/v1"
|
kyvernov1 "github.com/kyverno/kyverno/api/kyverno/v1"
|
||||||
kyvernov1beta1 "github.com/kyverno/kyverno/api/kyverno/v1beta1"
|
kyvernov1beta1 "github.com/kyverno/kyverno/api/kyverno/v1beta1"
|
||||||
kyvernov2alpha1 "github.com/kyverno/kyverno/api/kyverno/v2alpha1"
|
kyvernov2beta1 "github.com/kyverno/kyverno/api/kyverno/v2beta1"
|
||||||
"github.com/kyverno/kyverno/pkg/client/clientset/versioned"
|
"github.com/kyverno/kyverno/pkg/client/clientset/versioned"
|
||||||
kyvernov2alpha1informers "github.com/kyverno/kyverno/pkg/client/informers/externalversions/kyverno/v2alpha1"
|
kyvernov2beta1informers "github.com/kyverno/kyverno/pkg/client/informers/externalversions/kyverno/v2beta1"
|
||||||
kyvernov2alpha1listers "github.com/kyverno/kyverno/pkg/client/listers/kyverno/v2alpha1"
|
kyvernov2beta1listers "github.com/kyverno/kyverno/pkg/client/listers/kyverno/v2beta1"
|
||||||
"github.com/kyverno/kyverno/pkg/clients/dclient"
|
"github.com/kyverno/kyverno/pkg/clients/dclient"
|
||||||
"github.com/kyverno/kyverno/pkg/config"
|
"github.com/kyverno/kyverno/pkg/config"
|
||||||
"github.com/kyverno/kyverno/pkg/controllers"
|
"github.com/kyverno/kyverno/pkg/controllers"
|
||||||
|
@ -40,13 +40,13 @@ type controller struct {
|
||||||
kyvernoClient versioned.Interface
|
kyvernoClient versioned.Interface
|
||||||
|
|
||||||
// listers
|
// listers
|
||||||
cpolLister kyvernov2alpha1listers.ClusterCleanupPolicyLister
|
cpolLister kyvernov2beta1listers.ClusterCleanupPolicyLister
|
||||||
polLister kyvernov2alpha1listers.CleanupPolicyLister
|
polLister kyvernov2beta1listers.CleanupPolicyLister
|
||||||
nsLister corev1listers.NamespaceLister
|
nsLister corev1listers.NamespaceLister
|
||||||
|
|
||||||
// queue
|
// queue
|
||||||
queue workqueue.RateLimitingInterface
|
queue workqueue.RateLimitingInterface
|
||||||
enqueue controllerutils.EnqueueFuncT[kyvernov2alpha1.CleanupPolicyInterface]
|
enqueue controllerutils.EnqueueFuncT[kyvernov2beta1.CleanupPolicyInterface]
|
||||||
|
|
||||||
// config
|
// config
|
||||||
configuration config.Configuration
|
configuration config.Configuration
|
||||||
|
@ -70,8 +70,8 @@ const (
|
||||||
func NewController(
|
func NewController(
|
||||||
client dclient.Interface,
|
client dclient.Interface,
|
||||||
kyvernoClient versioned.Interface,
|
kyvernoClient versioned.Interface,
|
||||||
cpolInformer kyvernov2alpha1informers.ClusterCleanupPolicyInformer,
|
cpolInformer kyvernov2beta1informers.ClusterCleanupPolicyInformer,
|
||||||
polInformer kyvernov2alpha1informers.CleanupPolicyInformer,
|
polInformer kyvernov2beta1informers.CleanupPolicyInformer,
|
||||||
nsLister corev1listers.NamespaceLister,
|
nsLister corev1listers.NamespaceLister,
|
||||||
configuration config.Configuration,
|
configuration config.Configuration,
|
||||||
cmResolver engineapi.ConfigmapResolver,
|
cmResolver engineapi.ConfigmapResolver,
|
||||||
|
@ -79,11 +79,11 @@ func NewController(
|
||||||
eventGen event.Interface,
|
eventGen event.Interface,
|
||||||
) controllers.Controller {
|
) controllers.Controller {
|
||||||
queue := workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), ControllerName)
|
queue := workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), ControllerName)
|
||||||
keyFunc := controllerutils.MetaNamespaceKeyT[kyvernov2alpha1.CleanupPolicyInterface]
|
keyFunc := controllerutils.MetaNamespaceKeyT[kyvernov2beta1.CleanupPolicyInterface]
|
||||||
baseEnqueueFunc := controllerutils.LogError(logger, controllerutils.Parse(keyFunc, controllerutils.Queue(queue)))
|
baseEnqueueFunc := controllerutils.LogError(logger, controllerutils.Parse(keyFunc, controllerutils.Queue(queue)))
|
||||||
enqueueFunc := func(logger logr.Logger, operation, kind string) controllerutils.EnqueueFuncT[kyvernov2alpha1.CleanupPolicyInterface] {
|
enqueueFunc := func(logger logr.Logger, operation, kind string) controllerutils.EnqueueFuncT[kyvernov2beta1.CleanupPolicyInterface] {
|
||||||
logger = logger.WithValues("kind", kind, "operation", operation)
|
logger = logger.WithValues("kind", kind, "operation", operation)
|
||||||
return func(obj kyvernov2alpha1.CleanupPolicyInterface) error {
|
return func(obj kyvernov2beta1.CleanupPolicyInterface) error {
|
||||||
logger = logger.WithValues("name", obj.GetName())
|
logger = logger.WithValues("name", obj.GetName())
|
||||||
if obj.GetNamespace() != "" {
|
if obj.GetNamespace() != "" {
|
||||||
logger = logger.WithValues("namespace", obj.GetNamespace())
|
logger = logger.WithValues("namespace", obj.GetNamespace())
|
||||||
|
@ -155,7 +155,7 @@ func (c *controller) Run(ctx context.Context, workers int) {
|
||||||
controllerutils.Run(ctx, logger.V(3), ControllerName, time.Second, c.queue, workers, maxRetries, c.reconcile)
|
controllerutils.Run(ctx, logger.V(3), ControllerName, time.Second, c.queue, workers, maxRetries, c.reconcile)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *controller) getPolicy(namespace, name string) (kyvernov2alpha1.CleanupPolicyInterface, error) {
|
func (c *controller) getPolicy(namespace, name string) (kyvernov2beta1.CleanupPolicyInterface, error) {
|
||||||
if namespace == "" {
|
if namespace == "" {
|
||||||
cpolicy, err := c.cpolLister.Get(name)
|
cpolicy, err := c.cpolLister.Get(name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -171,7 +171,7 @@ func (c *controller) getPolicy(namespace, name string) (kyvernov2alpha1.CleanupP
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *controller) cleanup(ctx context.Context, logger logr.Logger, policy kyvernov2alpha1.CleanupPolicyInterface) error {
|
func (c *controller) cleanup(ctx context.Context, logger logr.Logger, policy kyvernov2beta1.CleanupPolicyInterface) error {
|
||||||
spec := policy.GetSpec()
|
spec := policy.GetSpec()
|
||||||
kinds := sets.New(spec.MatchResources.GetKinds()...)
|
kinds := sets.New(spec.MatchResources.GetKinds()...)
|
||||||
debug := logger.V(4)
|
debug := logger.V(4)
|
||||||
|
@ -356,19 +356,19 @@ func (c *controller) reconcile(ctx context.Context, logger logr.Logger, key, nam
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *controller) updateCleanupPolicyStatus(ctx context.Context, policy kyvernov2alpha1.CleanupPolicyInterface, namespace string, time time.Time) {
|
func (c *controller) updateCleanupPolicyStatus(ctx context.Context, policy kyvernov2beta1.CleanupPolicyInterface, namespace string, time time.Time) {
|
||||||
switch obj := policy.(type) {
|
switch obj := policy.(type) {
|
||||||
case *kyvernov2alpha1.ClusterCleanupPolicy:
|
case *kyvernov2beta1.ClusterCleanupPolicy:
|
||||||
latest := obj.DeepCopy()
|
latest := obj.DeepCopy()
|
||||||
latest.Status.LastExecutionTime.Time = time
|
latest.Status.LastExecutionTime.Time = time
|
||||||
|
|
||||||
new, _ := c.kyvernoClient.KyvernoV2alpha1().ClusterCleanupPolicies().UpdateStatus(ctx, latest, metav1.UpdateOptions{})
|
new, _ := c.kyvernoClient.KyvernoV2beta1().ClusterCleanupPolicies().UpdateStatus(ctx, latest, metav1.UpdateOptions{})
|
||||||
logging.V(3).Info("updated cluster cleanup policy status", "name", policy.GetName(), "status", new.Status)
|
logging.V(3).Info("updated cluster cleanup policy status", "name", policy.GetName(), "status", new.Status)
|
||||||
case *kyvernov2alpha1.CleanupPolicy:
|
case *kyvernov2beta1.CleanupPolicy:
|
||||||
latest := obj.DeepCopy()
|
latest := obj.DeepCopy()
|
||||||
latest.Status.LastExecutionTime.Time = time
|
latest.Status.LastExecutionTime.Time = time
|
||||||
|
|
||||||
new, _ := c.kyvernoClient.KyvernoV2alpha1().CleanupPolicies(namespace).UpdateStatus(ctx, latest, metav1.UpdateOptions{})
|
new, _ := c.kyvernoClient.KyvernoV2beta1().CleanupPolicies(namespace).UpdateStatus(ctx, latest, metav1.UpdateOptions{})
|
||||||
logging.V(3).Info("updated cleanup policy status", "name", policy.GetName(), "namespace", policy.GetNamespace(), "status", new.Status)
|
logging.V(3).Info("updated cleanup policy status", "name", policy.GetName(), "namespace", policy.GetNamespace(), "status", new.Status)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,9 +7,9 @@ import (
|
||||||
|
|
||||||
"github.com/go-logr/logr"
|
"github.com/go-logr/logr"
|
||||||
kyvernov1informers "github.com/kyverno/kyverno/pkg/client/informers/externalversions/kyverno/v1"
|
kyvernov1informers "github.com/kyverno/kyverno/pkg/client/informers/externalversions/kyverno/v1"
|
||||||
kyvernov2alpha1informers "github.com/kyverno/kyverno/pkg/client/informers/externalversions/kyverno/v2alpha1"
|
kyvernov2beta1informers "github.com/kyverno/kyverno/pkg/client/informers/externalversions/kyverno/v2beta1"
|
||||||
kyvernov1listers "github.com/kyverno/kyverno/pkg/client/listers/kyverno/v1"
|
kyvernov1listers "github.com/kyverno/kyverno/pkg/client/listers/kyverno/v1"
|
||||||
kyvernov2alpha1listers "github.com/kyverno/kyverno/pkg/client/listers/kyverno/v2alpha1"
|
kyvernov2beta1listers "github.com/kyverno/kyverno/pkg/client/listers/kyverno/v2beta1"
|
||||||
"github.com/kyverno/kyverno/pkg/clients/dclient"
|
"github.com/kyverno/kyverno/pkg/clients/dclient"
|
||||||
kubeutils "github.com/kyverno/kyverno/pkg/utils/kube"
|
kubeutils "github.com/kyverno/kyverno/pkg/utils/kube"
|
||||||
corev1 "k8s.io/api/core/v1"
|
corev1 "k8s.io/api/core/v1"
|
||||||
|
@ -34,9 +34,9 @@ type generator struct {
|
||||||
// list/get policy
|
// list/get policy
|
||||||
pLister kyvernov1listers.PolicyLister
|
pLister kyvernov1listers.PolicyLister
|
||||||
// list/get cluster cleanup policy
|
// list/get cluster cleanup policy
|
||||||
clustercleanuppolLister kyvernov2alpha1listers.ClusterCleanupPolicyLister
|
clustercleanuppolLister kyvernov2beta1listers.ClusterCleanupPolicyLister
|
||||||
// list/get cleanup policy
|
// list/get cleanup policy
|
||||||
cleanuppolLister kyvernov2alpha1listers.CleanupPolicyLister
|
cleanuppolLister kyvernov2beta1listers.CleanupPolicyLister
|
||||||
// queue to store event generation requests
|
// queue to store event generation requests
|
||||||
queue workqueue.RateLimitingInterface
|
queue workqueue.RateLimitingInterface
|
||||||
// events generated at policy controller
|
// events generated at policy controller
|
||||||
|
@ -98,8 +98,8 @@ func NewEventGenerator(
|
||||||
func NewEventCleanupGenerator(
|
func NewEventCleanupGenerator(
|
||||||
// source Source,
|
// source Source,
|
||||||
client dclient.Interface,
|
client dclient.Interface,
|
||||||
clustercleanuppolInformer kyvernov2alpha1informers.ClusterCleanupPolicyInformer,
|
clustercleanuppolInformer kyvernov2beta1informers.ClusterCleanupPolicyInformer,
|
||||||
cleanuppolInformer kyvernov2alpha1informers.CleanupPolicyInformer,
|
cleanuppolInformer kyvernov2beta1informers.CleanupPolicyInformer,
|
||||||
maxQueuedEvents int,
|
maxQueuedEvents int,
|
||||||
log logr.Logger,
|
log logr.Logger,
|
||||||
) Controller {
|
) Controller {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
kyvernov1 "github.com/kyverno/kyverno/api/kyverno/v1"
|
kyvernov1 "github.com/kyverno/kyverno/api/kyverno/v1"
|
||||||
kyvernov2alpha1 "github.com/kyverno/kyverno/api/kyverno/v2alpha1"
|
kyvernov2beta1 "github.com/kyverno/kyverno/api/kyverno/v2beta1"
|
||||||
engineapi "github.com/kyverno/kyverno/pkg/engine/api"
|
engineapi "github.com/kyverno/kyverno/pkg/engine/api"
|
||||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||||
)
|
)
|
||||||
|
@ -216,7 +216,7 @@ func NewPolicyExceptionEvents(engineResponse engineapi.EngineResponse, ruleResp
|
||||||
return []Info{policyEvent, exceptionEvent}
|
return []Info{policyEvent, exceptionEvent}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewCleanupPolicyEvent(policy kyvernov2alpha1.CleanupPolicyInterface, resource unstructured.Unstructured, err error) Info {
|
func NewCleanupPolicyEvent(policy kyvernov2beta1.CleanupPolicyInterface, resource unstructured.Unstructured, err error) Info {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return Info{
|
return Info{
|
||||||
Kind: policy.GetKind(),
|
Kind: policy.GetKind(),
|
||||||
|
|
|
@ -4,19 +4,19 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
kyvernov2alpha1 "github.com/kyverno/kyverno/api/kyverno/v2alpha1"
|
kyvernov2beta1 "github.com/kyverno/kyverno/api/kyverno/v2beta1"
|
||||||
admissionv1 "k8s.io/api/admission/v1"
|
admissionv1 "k8s.io/api/admission/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
func UnmarshalCleanupPolicy(kind string, raw []byte) (kyvernov2alpha1.CleanupPolicyInterface, error) {
|
func UnmarshalCleanupPolicy(kind string, raw []byte) (kyvernov2beta1.CleanupPolicyInterface, error) {
|
||||||
if kind == "CleanupPolicy" {
|
if kind == "CleanupPolicy" {
|
||||||
var policy *kyvernov2alpha1.CleanupPolicy
|
var policy *kyvernov2beta1.CleanupPolicy
|
||||||
if err := json.Unmarshal(raw, &policy); err != nil {
|
if err := json.Unmarshal(raw, &policy); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return policy, nil
|
return policy, nil
|
||||||
} else if kind == "ClusterCleanupPolicy" {
|
} else if kind == "ClusterCleanupPolicy" {
|
||||||
var policy *kyvernov2alpha1.ClusterCleanupPolicy
|
var policy *kyvernov2beta1.ClusterCleanupPolicy
|
||||||
if err := json.Unmarshal(raw, &policy); err != nil {
|
if err := json.Unmarshal(raw, &policy); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -25,8 +25,8 @@ func UnmarshalCleanupPolicy(kind string, raw []byte) (kyvernov2alpha1.CleanupPol
|
||||||
return nil, fmt.Errorf("admission request does not contain a cleanuppolicy")
|
return nil, fmt.Errorf("admission request does not contain a cleanuppolicy")
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetCleanupPolicies(request admissionv1.AdmissionRequest) (kyvernov2alpha1.CleanupPolicyInterface, kyvernov2alpha1.CleanupPolicyInterface, error) {
|
func GetCleanupPolicies(request admissionv1.AdmissionRequest) (kyvernov2beta1.CleanupPolicyInterface, kyvernov2beta1.CleanupPolicyInterface, error) {
|
||||||
var emptypolicy kyvernov2alpha1.CleanupPolicyInterface
|
var emptypolicy kyvernov2beta1.CleanupPolicyInterface
|
||||||
policy, err := UnmarshalCleanupPolicy(request.Kind.Kind, request.Object.Raw)
|
policy, err := UnmarshalCleanupPolicy(request.Kind.Kind, request.Object.Raw)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return policy, emptypolicy, err
|
return policy, emptypolicy, err
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"regexp"
|
"regexp"
|
||||||
|
|
||||||
"github.com/go-logr/logr"
|
"github.com/go-logr/logr"
|
||||||
kyvernov2alpha1 "github.com/kyverno/kyverno/api/kyverno/v2alpha1"
|
kyvernov2beta1 "github.com/kyverno/kyverno/api/kyverno/v2beta1"
|
||||||
"github.com/kyverno/kyverno/pkg/auth"
|
"github.com/kyverno/kyverno/pkg/auth"
|
||||||
"github.com/kyverno/kyverno/pkg/clients/dclient"
|
"github.com/kyverno/kyverno/pkg/clients/dclient"
|
||||||
"github.com/kyverno/kyverno/pkg/config"
|
"github.com/kyverno/kyverno/pkg/config"
|
||||||
|
@ -42,7 +42,7 @@ func FetchClusteredResources(logger logr.Logger, client dclient.Interface) (sets
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate checks policy is valid
|
// Validate checks policy is valid
|
||||||
func Validate(ctx context.Context, logger logr.Logger, client dclient.Interface, policy kyvernov2alpha1.CleanupPolicyInterface) error {
|
func Validate(ctx context.Context, logger logr.Logger, client dclient.Interface, policy kyvernov2beta1.CleanupPolicyInterface) error {
|
||||||
clusteredResources, err := FetchClusteredResources(logger, client)
|
clusteredResources, err := FetchClusteredResources(logger, client)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -61,13 +61,13 @@ func Validate(ctx context.Context, logger logr.Logger, client dclient.Interface,
|
||||||
}
|
}
|
||||||
|
|
||||||
// validatePolicy checks the policy and rules declarations for required configurations
|
// validatePolicy checks the policy and rules declarations for required configurations
|
||||||
func validatePolicy(clusterResources sets.Set[string], policy kyvernov2alpha1.CleanupPolicyInterface) error {
|
func validatePolicy(clusterResources sets.Set[string], policy kyvernov2beta1.CleanupPolicyInterface) error {
|
||||||
errs := policy.Validate(clusterResources)
|
errs := policy.Validate(clusterResources)
|
||||||
return errs.ToAggregate()
|
return errs.ToAggregate()
|
||||||
}
|
}
|
||||||
|
|
||||||
// validateAuth checks the the delete action is allowed
|
// validateAuth checks the the delete action is allowed
|
||||||
func validateAuth(ctx context.Context, client dclient.Interface, policy kyvernov2alpha1.CleanupPolicyInterface) error {
|
func validateAuth(ctx context.Context, client dclient.Interface, policy kyvernov2beta1.CleanupPolicyInterface) error {
|
||||||
namespace := policy.GetNamespace()
|
namespace := policy.GetNamespace()
|
||||||
spec := policy.GetSpec()
|
spec := policy.GetSpec()
|
||||||
kinds := sets.New(spec.MatchResources.GetKinds()...)
|
kinds := sets.New(spec.MatchResources.GetKinds()...)
|
||||||
|
@ -93,7 +93,7 @@ func validateAuth(ctx context.Context, client dclient.Interface, policy kyvernov
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func validateVariables(logger logr.Logger, policy kyvernov2alpha1.CleanupPolicyInterface) error {
|
func validateVariables(logger logr.Logger, policy kyvernov2beta1.CleanupPolicyInterface) error {
|
||||||
ctx := enginecontext.NewMockContext(allowedVariables)
|
ctx := enginecontext.NewMockContext(allowedVariables)
|
||||||
|
|
||||||
c := policy.GetSpec().Conditions
|
c := policy.GetSpec().Conditions
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
apiVersion: kyverno.io/v2alpha1
|
apiVersion: kyverno.io/v2beta1
|
||||||
kind: ClusterCleanupPolicy
|
kind: ClusterCleanupPolicy
|
||||||
metadata:
|
metadata:
|
||||||
name: cleanup-pod
|
name: cleanup-pod
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
apiVersion: kyverno.io/v2alpha1
|
apiVersion: kyverno.io/v2beta1
|
||||||
kind: ClusterCleanupPolicy
|
kind: ClusterCleanupPolicy
|
||||||
metadata:
|
metadata:
|
||||||
name: cleanup-pod
|
name: cleanup-pod
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
apiVersion: kyverno.io/v2alpha1
|
apiVersion: kyverno.io/v2beta1
|
||||||
kind: CleanupPolicy
|
kind: CleanupPolicy
|
||||||
metadata:
|
metadata:
|
||||||
name: cleanup-pod
|
name: cleanup-pod
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
apiVersion: kyverno.io/v2alpha1
|
apiVersion: kyverno.io/v2beta1
|
||||||
kind: ClusterCleanupPolicy
|
kind: ClusterCleanupPolicy
|
||||||
metadata:
|
metadata:
|
||||||
name: cleanuppolicy
|
name: cleanuppolicy
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
apiVersion: kyverno.io/v2alpha1
|
apiVersion: kyverno.io/v2beta1
|
||||||
kind: CleanupPolicy
|
kind: CleanupPolicy
|
||||||
metadata:
|
metadata:
|
||||||
name: cleanuppolicy
|
name: cleanuppolicy
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
apiVersion: kyverno.io/v2alpha1
|
apiVersion: kyverno.io/v2beta1
|
||||||
kind: CleanupPolicy
|
kind: CleanupPolicy
|
||||||
metadata:
|
metadata:
|
||||||
name: cleanuppolicy
|
name: cleanuppolicy
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
apiVersion: kyverno.io/v2alpha1
|
apiVersion: kyverno.io/v2beta1
|
||||||
kind: ClusterCleanupPolicy
|
kind: ClusterCleanupPolicy
|
||||||
metadata:
|
metadata:
|
||||||
name: cleanuppolicy
|
name: cleanuppolicy
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
apiVersion: kyverno.io/v2alpha1
|
apiVersion: kyverno.io/v2beta1
|
||||||
kind: ClusterCleanupPolicy
|
kind: ClusterCleanupPolicy
|
||||||
metadata:
|
metadata:
|
||||||
name: cleanuppolicy
|
name: cleanuppolicy
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
apiVersion: kyverno.io/v2alpha1
|
apiVersion: kyverno.io/v2beta1
|
||||||
kind: ClusterCleanupPolicy
|
kind: ClusterCleanupPolicy
|
||||||
metadata:
|
metadata:
|
||||||
name: cleanuppolicy
|
name: cleanuppolicy
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
apiVersion: kyverno.io/v2alpha1
|
apiVersion: kyverno.io/v2beta1
|
||||||
kind: ClusterCleanupPolicy
|
kind: ClusterCleanupPolicy
|
||||||
metadata:
|
metadata:
|
||||||
name: cleanup-pod
|
name: cleanup-pod
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
apiVersion: kyverno.io/v2alpha1
|
apiVersion: kyverno.io/v2beta1
|
||||||
kind: ClusterCleanupPolicy
|
kind: ClusterCleanupPolicy
|
||||||
metadata:
|
metadata:
|
||||||
name: cleanup-pod
|
name: cleanup-pod
|
||||||
|
|
|
@ -27,7 +27,7 @@ spec:
|
||||||
kinds:
|
kinds:
|
||||||
- PolicyException
|
- PolicyException
|
||||||
generate:
|
generate:
|
||||||
apiVersion: kyverno.io/v2alpha1
|
apiVersion: kyverno.io/v2beta1
|
||||||
kind: ClusterCleanupPolicy
|
kind: ClusterCleanupPolicy
|
||||||
name: polex-{{ request.namespace }}-{{ request.object.metadata.name }}-{{ random('[0-9a-z]{8}') }}
|
name: polex-{{ request.namespace }}-{{ request.object.metadata.name }}-{{ random('[0-9a-z]{8}') }}
|
||||||
synchronize: false
|
synchronize: false
|
||||||
|
|
Loading…
Add table
Reference in a new issue