From 39753233622c5f68cb769bddf75cefe312885968 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles-Edouard=20Br=C3=A9t=C3=A9ch=C3=A9?= Date: Wed, 21 Dec 2022 23:33:51 +0100 Subject: [PATCH] chore: bump deps including k8s ones (#5751) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: bump deps including k8s ones Signed-off-by: Charles-Edouard Brétéché * fix Signed-off-by: Charles-Edouard Brétéché * fix Signed-off-by: Charles-Edouard Brétéché * fix linter Signed-off-by: Charles-Edouard Brétéché Signed-off-by: Charles-Edouard Brétéché --- Makefile | 4 +- api/kyverno/v1/clusterpolicy_types.go | 2 +- api/kyverno/v1/match_resources_types.go | 2 +- api/kyverno/v1/policy_interface.go | 2 +- api/kyverno/v1/policy_types.go | 2 +- api/kyverno/v1/resource_description_types.go | 2 +- api/kyverno/v1/rule_types.go | 16 +- api/kyverno/v1/spec_types.go | 6 +- .../v2alpha1/cleanup_policy_interface.go | 2 +- api/kyverno/v2alpha1/cleanup_policy_types.go | 6 +- api/kyverno/v2beta1/clusterpolicy_types.go | 2 +- api/kyverno/v2beta1/match_resources_types.go | 2 +- api/kyverno/v2beta1/policy_types.go | 2 +- .../v2beta1/resource_description_types.go | 2 +- api/kyverno/v2beta1/rule_types.go | 2 +- api/kyverno/v2beta1/spec_types.go | 6 +- charts/kyverno/templates/crds.yaml | 26 +- .../handlers/cleanup/handlers.go | 2 +- .../kubectl-kyverno/jp/function/function.go | 2 +- config/crds/kyverno.io_admissionreports.yaml | 2 +- .../kyverno.io_backgroundscanreports.yaml | 2 +- config/crds/kyverno.io_cleanuppolicies.yaml | 2 +- .../kyverno.io_clusteradmissionreports.yaml | 2 +- ...verno.io_clusterbackgroundscanreports.yaml | 2 +- .../kyverno.io_clustercleanuppolicies.yaml | 2 +- config/crds/kyverno.io_clusterpolicies.yaml | 2 +- config/crds/kyverno.io_generaterequests.yaml | 2 +- config/crds/kyverno.io_policies.yaml | 2 +- config/crds/kyverno.io_policyexceptions.yaml | 2 +- config/crds/kyverno.io_updaterequests.yaml | 2 +- .../wgpolicyk8s.io_clusterpolicyreports.yaml | 2 +- config/crds/wgpolicyk8s.io_policyreports.yaml | 2 +- config/install.yaml | 26 +- go.mod | 78 +-- go.sum | 156 +++--- hack/main.go | 4 +- pkg/autogen/autogen.go | 2 +- pkg/background/update_request_controller.go | 6 +- pkg/client/clientset/versioned/clientset.go | 3 +- .../informers/externalversions/factory.go | 79 +++- .../client.generated.go | 70 +++ .../resource.generated.go | 374 +++++++++++++++ .../resource.generated.go | 374 +++++++++++++++ .../client.generated.go | 59 +++ .../selfsubjectreviews/resource.generated.go | 83 ++++ pkg/clients/kube/clientset.generated.go | 412 ++++++++-------- .../kube/discovery/resource.generated.go | 14 + .../flowcontrolv1beta3/client.generated.go | 70 +++ .../flowschemas/resource.generated.go | 446 ++++++++++++++++++ .../resource.generated.go | 446 ++++++++++++++++++ .../kube/resourcev1alpha1/client.generated.go | 92 ++++ .../podschedulings/resource.generated.go | 446 ++++++++++++++++++ .../resourceclaims/resource.generated.go | 446 ++++++++++++++++++ .../resource.generated.go | 374 +++++++++++++++ .../resourceclasses/resource.generated.go | 374 +++++++++++++++ .../kyverno/discovery/resource.generated.go | 14 + .../report/aggregate/controller.go | 8 +- pkg/controllers/report/resource/controller.go | 3 +- pkg/controllers/report/utils/utils.go | 8 +- pkg/controllers/webhook/controller.go | 10 +- pkg/controllers/webhook/utils.go | 4 +- pkg/policy/policy_controller.go | 4 +- pkg/policy/validate.go | 25 +- pkg/policy/validate_test.go | 2 +- pkg/policycache/store.go | 22 +- pkg/utils/controller/handlers.go | 2 +- pkg/utils/controller/utils.go | 2 +- pkg/validation/cleanuppolicy/validate.go | 8 +- pkg/webhooks/handlers/filter.go | 4 +- 69 files changed, 4230 insertions(+), 436 deletions(-) create mode 100644 pkg/clients/kube/admissionregistrationv1alpha1/client.generated.go create mode 100644 pkg/clients/kube/admissionregistrationv1alpha1/validatingadmissionpolicies/resource.generated.go create mode 100644 pkg/clients/kube/admissionregistrationv1alpha1/validatingadmissionpolicybindings/resource.generated.go create mode 100644 pkg/clients/kube/authenticationv1alpha1/client.generated.go create mode 100644 pkg/clients/kube/authenticationv1alpha1/selfsubjectreviews/resource.generated.go create mode 100644 pkg/clients/kube/flowcontrolv1beta3/client.generated.go create mode 100644 pkg/clients/kube/flowcontrolv1beta3/flowschemas/resource.generated.go create mode 100644 pkg/clients/kube/flowcontrolv1beta3/prioritylevelconfigurations/resource.generated.go create mode 100644 pkg/clients/kube/resourcev1alpha1/client.generated.go create mode 100644 pkg/clients/kube/resourcev1alpha1/podschedulings/resource.generated.go create mode 100644 pkg/clients/kube/resourcev1alpha1/resourceclaims/resource.generated.go create mode 100644 pkg/clients/kube/resourcev1alpha1/resourceclaimtemplates/resource.generated.go create mode 100644 pkg/clients/kube/resourcev1alpha1/resourceclasses/resource.generated.go diff --git a/Makefile b/Makefile index e01991f781..6458dc84d5 100644 --- a/Makefile +++ b/Makefile @@ -40,12 +40,12 @@ TOOLS_DIR := $(PWD)/.tools KIND := $(TOOLS_DIR)/kind KIND_VERSION := v0.17.0 CONTROLLER_GEN := $(TOOLS_DIR)/controller-gen -CONTROLLER_GEN_VERSION := v0.10.0 +CONTROLLER_GEN_VERSION := v0.11.1 CLIENT_GEN := $(TOOLS_DIR)/client-gen LISTER_GEN := $(TOOLS_DIR)/lister-gen INFORMER_GEN := $(TOOLS_DIR)/informer-gen OPENAPI_GEN := $(TOOLS_DIR)/openapi-gen -CODE_GEN_VERSION := v0.25.2 +CODE_GEN_VERSION := v0.26.0 GEN_CRD_API_REFERENCE_DOCS := $(TOOLS_DIR)/gen-crd-api-reference-docs GEN_CRD_API_REFERENCE_DOCS_VERSION := latest GO_ACC := $(TOOLS_DIR)/go-acc diff --git a/api/kyverno/v1/clusterpolicy_types.go b/api/kyverno/v1/clusterpolicy_types.go index 3c81fe29b4..97f7ef5772 100644 --- a/api/kyverno/v1/clusterpolicy_types.go +++ b/api/kyverno/v1/clusterpolicy_types.go @@ -110,7 +110,7 @@ func (p *ClusterPolicy) ValidateSchema() bool { // Validate implements programmatic validation // namespaced means that the policy is bound to a namespace and therefore // should not filter/generate cluster wide resources. -func (p *ClusterPolicy) Validate(clusterResources sets.String) (errs field.ErrorList) { +func (p *ClusterPolicy) Validate(clusterResources sets.Set[string]) (errs field.ErrorList) { errs = append(errs, ValidateAutogenAnnotation(field.NewPath("metadata").Child("annotations"), p.GetAnnotations())...) errs = append(errs, ValidatePolicyName(field.NewPath("name"), p.Name)...) errs = append(errs, p.Spec.Validate(field.NewPath("spec"), p.IsNamespaced(), p.Namespace, clusterResources)...) diff --git a/api/kyverno/v1/match_resources_types.go b/api/kyverno/v1/match_resources_types.go index 4ef6f2d0db..7996767dd4 100644 --- a/api/kyverno/v1/match_resources_types.go +++ b/api/kyverno/v1/match_resources_types.go @@ -44,7 +44,7 @@ func (m *MatchResources) GetKinds() []string { } // Validate implements programmatic validation -func (m *MatchResources) Validate(path *field.Path, namespaced bool, clusterResources sets.String) (errs field.ErrorList) { +func (m *MatchResources) Validate(path *field.Path, namespaced bool, clusterResources sets.Set[string]) (errs field.ErrorList) { if len(m.Any) > 0 && len(m.All) > 0 { errs = append(errs, field.Invalid(path, m, "Can't specify any and all together")) } diff --git a/api/kyverno/v1/policy_interface.go b/api/kyverno/v1/policy_interface.go index d450b7e721..aec9b7ef2b 100644 --- a/api/kyverno/v1/policy_interface.go +++ b/api/kyverno/v1/policy_interface.go @@ -15,7 +15,7 @@ type PolicyInterface interface { IsNamespaced() bool GetSpec() *Spec GetStatus() *PolicyStatus - Validate(sets.String) field.ErrorList + Validate(sets.Set[string]) field.ErrorList GetKind() string CreateDeepCopy() PolicyInterface IsReady() bool diff --git a/api/kyverno/v1/policy_types.go b/api/kyverno/v1/policy_types.go index e3638e5e88..37cd3f4af8 100644 --- a/api/kyverno/v1/policy_types.go +++ b/api/kyverno/v1/policy_types.go @@ -111,7 +111,7 @@ func (p *Policy) ValidateSchema() bool { // Validate implements programmatic validation. // namespaced means that the policy is bound to a namespace and therefore // should not filter/generate cluster wide resources. -func (p *Policy) Validate(clusterResources sets.String) (errs field.ErrorList) { +func (p *Policy) Validate(clusterResources sets.Set[string]) (errs field.ErrorList) { errs = append(errs, ValidateAutogenAnnotation(field.NewPath("metadata").Child("annotations"), p.GetAnnotations())...) errs = append(errs, ValidatePolicyName(field.NewPath("name"), p.Name)...) errs = append(errs, p.Spec.Validate(field.NewPath("spec"), p.IsNamespaced(), p.Namespace, clusterResources)...) diff --git a/api/kyverno/v1/resource_description_types.go b/api/kyverno/v1/resource_description_types.go index b531970576..b57139d117 100644 --- a/api/kyverno/v1/resource_description_types.go +++ b/api/kyverno/v1/resource_description_types.go @@ -64,7 +64,7 @@ func (r ResourceDescription) IsEmpty() bool { } // Validate implements programmatic validation -func (r *ResourceDescription) Validate(path *field.Path, namespaced bool, clusterResources sets.String) (errs field.ErrorList) { +func (r *ResourceDescription) Validate(path *field.Path, namespaced bool, clusterResources sets.Set[string]) (errs field.ErrorList) { if r.Name != "" && len(r.Names) > 0 { errs = append(errs, field.Invalid(path, r, "Both name and names can not be specified together")) } diff --git a/api/kyverno/v1/rule_types.go b/api/kyverno/v1/rule_types.go index 501e4dbfcc..0ab5591c52 100644 --- a/api/kyverno/v1/rule_types.go +++ b/api/kyverno/v1/rule_types.go @@ -206,23 +206,23 @@ func (r *Rule) ValidateMatchExcludeConflict(path *field.Path) (errs field.ErrorL if reflect.DeepEqual(r.ExcludeResources, MatchResources{}) { return errs } - excludeRoles := sets.NewString(r.ExcludeResources.Roles...) - excludeClusterRoles := sets.NewString(r.ExcludeResources.ClusterRoles...) - excludeKinds := sets.NewString(r.ExcludeResources.Kinds...) - excludeNamespaces := sets.NewString(r.ExcludeResources.Namespaces...) - excludeSubjects := sets.NewString() + excludeRoles := sets.New(r.ExcludeResources.Roles...) + excludeClusterRoles := sets.New(r.ExcludeResources.ClusterRoles...) + excludeKinds := sets.New(r.ExcludeResources.Kinds...) + excludeNamespaces := sets.New(r.ExcludeResources.Namespaces...) + excludeSubjects := sets.New[string]() for _, subject := range r.ExcludeResources.Subjects { subjectRaw, _ := json.Marshal(subject) excludeSubjects.Insert(string(subjectRaw)) } - excludeSelectorMatchExpressions := sets.NewString() + excludeSelectorMatchExpressions := sets.New[string]() if r.ExcludeResources.Selector != nil { for _, matchExpression := range r.ExcludeResources.Selector.MatchExpressions { matchExpressionRaw, _ := json.Marshal(matchExpression) excludeSelectorMatchExpressions.Insert(string(matchExpressionRaw)) } } - excludeNamespaceSelectorMatchExpressions := sets.NewString() + excludeNamespaceSelectorMatchExpressions := sets.New[string]() if r.ExcludeResources.NamespaceSelector != nil { for _, matchExpression := range r.ExcludeResources.NamespaceSelector.MatchExpressions { matchExpressionRaw, _ := json.Marshal(matchExpression) @@ -397,7 +397,7 @@ func (r *Rule) ValidatePSaControlNames(path *field.Path) (errs field.ErrorList) } // Validate implements programmatic validation -func (r *Rule) Validate(path *field.Path, namespaced bool, policyNamespace string, clusterResources sets.String) (errs field.ErrorList) { +func (r *Rule) Validate(path *field.Path, namespaced bool, policyNamespace string, clusterResources sets.Set[string]) (errs field.ErrorList) { errs = append(errs, r.ValidateRuleType(path)...) errs = append(errs, r.ValidateMatchExcludeConflict(path)...) errs = append(errs, r.MatchResources.Validate(path.Child("match"), namespaced, clusterResources)...) diff --git a/api/kyverno/v1/spec_types.go b/api/kyverno/v1/spec_types.go index de28de8e36..c48232c05d 100644 --- a/api/kyverno/v1/spec_types.go +++ b/api/kyverno/v1/spec_types.go @@ -233,7 +233,7 @@ func (s *Spec) ValidateSchema() bool { // ValidateRuleNames checks if the rule names are unique across a policy func (s *Spec) ValidateRuleNames(path *field.Path) (errs field.ErrorList) { - names := sets.NewString() + names := sets.New[string]() for i, rule := range s.Rules { rulePath := path.Index(i) if names.Has(rule.Name) { @@ -245,7 +245,7 @@ func (s *Spec) ValidateRuleNames(path *field.Path) (errs field.ErrorList) { } // ValidateRules implements programmatic validation of Rules -func (s *Spec) ValidateRules(path *field.Path, namespaced bool, policyNamespace string, clusterResources sets.String) (errs field.ErrorList) { +func (s *Spec) ValidateRules(path *field.Path, namespaced bool, policyNamespace string, clusterResources sets.Set[string]) (errs field.ErrorList) { errs = append(errs, s.ValidateRuleNames(path)...) for i, rule := range s.Rules { errs = append(errs, rule.Validate(path.Index(i), namespaced, policyNamespace, clusterResources)...) @@ -254,7 +254,7 @@ func (s *Spec) ValidateRules(path *field.Path, namespaced bool, policyNamespace } // Validate implements programmatic validation -func (s *Spec) Validate(path *field.Path, namespaced bool, policyNamespace string, clusterResources sets.String) (errs field.ErrorList) { +func (s *Spec) Validate(path *field.Path, namespaced bool, policyNamespace string, clusterResources sets.Set[string]) (errs field.ErrorList) { errs = append(errs, s.ValidateRules(path.Child("rules"), namespaced, policyNamespace, clusterResources)...) if namespaced && len(s.ValidationFailureActionOverrides) > 0 { errs = append(errs, field.Forbidden(path.Child("validationFailureActionOverrides"), "Use of validationFailureActionOverrides is supported only with ClusterPolicy")) diff --git a/api/kyverno/v2alpha1/cleanup_policy_interface.go b/api/kyverno/v2alpha1/cleanup_policy_interface.go index f771c0f3d4..48f4b002ce 100644 --- a/api/kyverno/v2alpha1/cleanup_policy_interface.go +++ b/api/kyverno/v2alpha1/cleanup_policy_interface.go @@ -12,7 +12,7 @@ type CleanupPolicyInterface interface { metav1.Object GetSpec() *CleanupPolicySpec GetStatus() *CleanupPolicyStatus - Validate(sets.String) field.ErrorList + Validate(sets.Set[string]) field.ErrorList GetKind() string GetAPIVersion() string } diff --git a/api/kyverno/v2alpha1/cleanup_policy_types.go b/api/kyverno/v2alpha1/cleanup_policy_types.go index 2140967bb5..8443a9dca4 100644 --- a/api/kyverno/v2alpha1/cleanup_policy_types.go +++ b/api/kyverno/v2alpha1/cleanup_policy_types.go @@ -60,7 +60,7 @@ func (p *CleanupPolicy) GetStatus() *CleanupPolicyStatus { } // Validate implements programmatic validation -func (p *CleanupPolicy) Validate(clusterResources sets.String) (errs field.ErrorList) { +func (p *CleanupPolicy) Validate(clusterResources sets.Set[string]) (errs field.ErrorList) { errs = append(errs, kyvernov1.ValidatePolicyName(field.NewPath("metadata").Child("name"), p.Name)...) errs = append(errs, p.Spec.Validate(field.NewPath("spec"), clusterResources, true)...) return errs @@ -130,7 +130,7 @@ func (p *ClusterCleanupPolicy) GetAPIVersion() string { } // Validate implements programmatic validation -func (p *ClusterCleanupPolicy) Validate(clusterResources sets.String) (errs field.ErrorList) { +func (p *ClusterCleanupPolicy) Validate(clusterResources sets.Set[string]) (errs field.ErrorList) { errs = append(errs, kyvernov1.ValidatePolicyName(field.NewPath("metadata").Child("name"), p.Name)...) errs = append(errs, p.Spec.Validate(field.NewPath("spec"), clusterResources, false)...) return errs @@ -175,7 +175,7 @@ type CleanupPolicyStatus struct { } // Validate implements programmatic validation -func (p *CleanupPolicySpec) Validate(path *field.Path, clusterResources sets.String, namespaced bool) (errs field.ErrorList) { +func (p *CleanupPolicySpec) Validate(path *field.Path, clusterResources sets.Set[string], namespaced bool) (errs field.ErrorList) { errs = append(errs, ValidateSchedule(path.Child("schedule"), p.Schedule)...) errs = append(errs, p.MatchResources.Validate(path.Child("match"), namespaced, clusterResources)...) if p.ExcludeResources != nil { diff --git a/api/kyverno/v2beta1/clusterpolicy_types.go b/api/kyverno/v2beta1/clusterpolicy_types.go index 72e00bec66..ef511f5f84 100644 --- a/api/kyverno/v2beta1/clusterpolicy_types.go +++ b/api/kyverno/v2beta1/clusterpolicy_types.go @@ -101,7 +101,7 @@ func (p *ClusterPolicy) IsReady() bool { // Validate implements programmatic validation // namespaced means that the policy is bound to a namespace and therefore // should not filter/generate cluster wide resources. -func (p *ClusterPolicy) Validate(clusterResources sets.String) (errs field.ErrorList) { +func (p *ClusterPolicy) Validate(clusterResources sets.Set[string]) (errs field.ErrorList) { errs = append(errs, kyvernov1.ValidateAutogenAnnotation(field.NewPath("metadata").Child("annotations"), p.GetAnnotations())...) errs = append(errs, kyvernov1.ValidatePolicyName(field.NewPath("name"), p.Name)...) errs = append(errs, p.Spec.Validate(field.NewPath("spec"), p.IsNamespaced(), clusterResources)...) diff --git a/api/kyverno/v2beta1/match_resources_types.go b/api/kyverno/v2beta1/match_resources_types.go index c08dbba3eb..1bd21d7f4a 100644 --- a/api/kyverno/v2beta1/match_resources_types.go +++ b/api/kyverno/v2beta1/match_resources_types.go @@ -31,7 +31,7 @@ func (m *MatchResources) GetKinds() []string { } // Validate implements programmatic validation -func (m *MatchResources) Validate(path *field.Path, namespaced bool, clusterResources sets.String) (errs field.ErrorList) { +func (m *MatchResources) Validate(path *field.Path, namespaced bool, clusterResources sets.Set[string]) (errs field.ErrorList) { if len(m.Any) > 0 && len(m.All) > 0 { errs = append(errs, field.Invalid(path, m, "Can't specify any and all together")) } diff --git a/api/kyverno/v2beta1/policy_types.go b/api/kyverno/v2beta1/policy_types.go index e01df0269b..d42774053a 100644 --- a/api/kyverno/v2beta1/policy_types.go +++ b/api/kyverno/v2beta1/policy_types.go @@ -101,7 +101,7 @@ func (p *Policy) IsReady() bool { // Validate implements programmatic validation. // namespaced means that the policy is bound to a namespace and therefore // should not filter/generate cluster wide resources. -func (p *Policy) Validate(clusterResources sets.String) (errs field.ErrorList) { +func (p *Policy) Validate(clusterResources sets.Set[string]) (errs field.ErrorList) { errs = append(errs, kyvernov1.ValidateAutogenAnnotation(field.NewPath("metadata").Child("annotations"), p.GetAnnotations())...) errs = append(errs, kyvernov1.ValidatePolicyName(field.NewPath("name"), p.Name)...) errs = append(errs, p.Spec.Validate(field.NewPath("spec"), p.IsNamespaced(), clusterResources)...) diff --git a/api/kyverno/v2beta1/resource_description_types.go b/api/kyverno/v2beta1/resource_description_types.go index 9d246883fd..1083eda69a 100644 --- a/api/kyverno/v2beta1/resource_description_types.go +++ b/api/kyverno/v2beta1/resource_description_types.go @@ -48,7 +48,7 @@ type ResourceDescription struct { } // Validate implements programmatic validation -func (r *ResourceDescription) Validate(path *field.Path, namespaced bool, clusterResources sets.String) (errs field.ErrorList) { +func (r *ResourceDescription) Validate(path *field.Path, namespaced bool, clusterResources sets.Set[string]) (errs field.ErrorList) { if len(r.Names) > 0 { errs = append(errs, field.Invalid(path, r, "Both name and names can not be specified together")) } diff --git a/api/kyverno/v2beta1/rule_types.go b/api/kyverno/v2beta1/rule_types.go index 178f38d96a..0c948cba80 100644 --- a/api/kyverno/v2beta1/rule_types.go +++ b/api/kyverno/v2beta1/rule_types.go @@ -175,7 +175,7 @@ func (r *Rule) ValidateMatchExcludeConflict(path *field.Path) (errs field.ErrorL } // Validate implements programmatic validation -func (r *Rule) Validate(path *field.Path, namespaced bool, clusterResources sets.String) (errs field.ErrorList) { +func (r *Rule) Validate(path *field.Path, namespaced bool, clusterResources sets.Set[string]) (errs field.ErrorList) { errs = append(errs, r.ValidateRuleType(path)...) errs = append(errs, r.ValidateMatchExcludeConflict(path)...) errs = append(errs, r.MatchResources.Validate(path.Child("match"), namespaced, clusterResources)...) diff --git a/api/kyverno/v2beta1/spec_types.go b/api/kyverno/v2beta1/spec_types.go index a1d1bfb201..1e5f3583bd 100644 --- a/api/kyverno/v2beta1/spec_types.go +++ b/api/kyverno/v2beta1/spec_types.go @@ -197,7 +197,7 @@ func (s *Spec) GetApplyRules() kyvernov1.ApplyRulesType { // ValidateRuleNames checks if the rule names are unique across a policy func (s *Spec) ValidateRuleNames(path *field.Path) (errs field.ErrorList) { - names := sets.NewString() + names := sets.New[string]() for i, rule := range s.Rules { rulePath := path.Index(i) if names.Has(rule.Name) { @@ -209,7 +209,7 @@ func (s *Spec) ValidateRuleNames(path *field.Path) (errs field.ErrorList) { } // ValidateRules implements programmatic validation of Rules -func (s *Spec) ValidateRules(path *field.Path, namespaced bool, clusterResources sets.String) (errs field.ErrorList) { +func (s *Spec) ValidateRules(path *field.Path, namespaced bool, clusterResources sets.Set[string]) (errs field.ErrorList) { errs = append(errs, s.ValidateRuleNames(path)...) for i, rule := range s.Rules { errs = append(errs, rule.Validate(path.Index(i), namespaced, clusterResources)...) @@ -218,7 +218,7 @@ func (s *Spec) ValidateRules(path *field.Path, namespaced bool, clusterResources } // Validate implements programmatic validation -func (s *Spec) Validate(path *field.Path, namespaced bool, clusterResources sets.String) (errs field.ErrorList) { +func (s *Spec) Validate(path *field.Path, namespaced bool, clusterResources sets.Set[string]) (errs field.ErrorList) { errs = append(errs, s.ValidateRules(path.Child("rules"), namespaced, clusterResources)...) if namespaced && len(s.ValidationFailureActionOverrides) > 0 { errs = append(errs, field.Forbidden(path.Child("validationFailureActionOverrides"), "Use of validationFailureActionOverrides is supported only with ClusterPolicy")) diff --git a/charts/kyverno/templates/crds.yaml b/charts/kyverno/templates/crds.yaml index 98c2d6506a..b015222ac5 100644 --- a/charts/kyverno/templates/crds.yaml +++ b/charts/kyverno/templates/crds.yaml @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 {{- with .Values.crds.annotations }} {{- toYaml . | nindent 4 }} {{- end }} @@ -349,7 +349,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 {{- with .Values.crds.annotations }} {{- toYaml . | nindent 4 }} {{- end }} @@ -654,7 +654,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 {{- with .Values.crds.annotations }} {{- toYaml . | nindent 4 }} {{- end }} @@ -1702,7 +1702,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 {{- with .Values.crds.annotations }} {{- toYaml . | nindent 4 }} {{- end }} @@ -2048,7 +2048,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 {{- with .Values.crds.annotations }} {{- toYaml . | nindent 4 }} {{- end }} @@ -2353,7 +2353,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 {{- with .Values.crds.annotations }} {{- toYaml . | nindent 4 }} {{- end }} @@ -3401,7 +3401,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 {{- with .Values.crds.annotations }} {{- toYaml . | nindent 4 }} {{- end }} @@ -15791,7 +15791,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 {{- with .Values.crds.annotations }} {{- toYaml . | nindent 4 }} {{- end }} @@ -15979,7 +15979,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 {{- with .Values.crds.annotations }} {{- toYaml . | nindent 4 }} {{- end }} @@ -28372,7 +28372,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 {{- with .Values.crds.annotations }} {{- toYaml . | nindent 4 }} {{- end }} @@ -28858,7 +28858,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 {{- with .Values.crds.annotations }} {{- toYaml . | nindent 4 }} {{- end }} @@ -29249,7 +29249,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 {{- with .Values.crds.annotations }} {{- toYaml . | nindent 4 }} {{- end }} @@ -29616,7 +29616,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 {{- with .Values.crds.annotations }} {{- toYaml . | nindent 4 }} {{- end }} diff --git a/cmd/cleanup-controller/handlers/cleanup/handlers.go b/cmd/cleanup-controller/handlers/cleanup/handlers.go index 3ed1c3ca0d..e18117579d 100644 --- a/cmd/cleanup-controller/handlers/cleanup/handlers.go +++ b/cmd/cleanup-controller/handlers/cleanup/handlers.go @@ -62,7 +62,7 @@ func (h *handlers) lookupPolicy(namespace, name string) (kyvernov2alpha1.Cleanup func (h *handlers) executePolicy(ctx context.Context, logger logr.Logger, policy kyvernov2alpha1.CleanupPolicyInterface) error { spec := policy.GetSpec() - kinds := sets.NewString(spec.MatchResources.GetKinds()...) + kinds := sets.New(spec.MatchResources.GetKinds()...) debug := logger.V(5) var errs []error for kind := range kinds { diff --git a/cmd/cli/kubectl-kyverno/jp/function/function.go b/cmd/cli/kubectl-kyverno/jp/function/function.go index ecd148373f..f3c19e6887 100644 --- a/cmd/cli/kubectl-kyverno/jp/function/function.go +++ b/cmd/cli/kubectl-kyverno/jp/function/function.go @@ -37,7 +37,7 @@ func printFunctions(names ...string) { slices.SortFunc(functions, func(a, b *jmespath.FunctionEntry) bool { return a.String() < b.String() }) - namesSet := sets.NewString(names...) + namesSet := sets.New(names...) for _, function := range functions { if len(namesSet) == 0 || namesSet.Has(function.Entry.Name) { function := *function diff --git a/config/crds/kyverno.io_admissionreports.yaml b/config/crds/kyverno.io_admissionreports.yaml index 1570749520..83d0d3804e 100644 --- a/config/crds/kyverno.io_admissionreports.yaml +++ b/config/crds/kyverno.io_admissionreports.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 creationTimestamp: null name: admissionreports.kyverno.io spec: diff --git a/config/crds/kyverno.io_backgroundscanreports.yaml b/config/crds/kyverno.io_backgroundscanreports.yaml index 5b43e3d040..81b18f4ca3 100644 --- a/config/crds/kyverno.io_backgroundscanreports.yaml +++ b/config/crds/kyverno.io_backgroundscanreports.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 creationTimestamp: null name: backgroundscanreports.kyverno.io spec: diff --git a/config/crds/kyverno.io_cleanuppolicies.yaml b/config/crds/kyverno.io_cleanuppolicies.yaml index aa4f0af34b..98a1d9641c 100644 --- a/config/crds/kyverno.io_cleanuppolicies.yaml +++ b/config/crds/kyverno.io_cleanuppolicies.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 creationTimestamp: null name: cleanuppolicies.kyverno.io spec: diff --git a/config/crds/kyverno.io_clusteradmissionreports.yaml b/config/crds/kyverno.io_clusteradmissionreports.yaml index 54c5c81973..50484be699 100644 --- a/config/crds/kyverno.io_clusteradmissionreports.yaml +++ b/config/crds/kyverno.io_clusteradmissionreports.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 creationTimestamp: null name: clusteradmissionreports.kyverno.io spec: diff --git a/config/crds/kyverno.io_clusterbackgroundscanreports.yaml b/config/crds/kyverno.io_clusterbackgroundscanreports.yaml index c5b454cfb6..c0cc674b7d 100644 --- a/config/crds/kyverno.io_clusterbackgroundscanreports.yaml +++ b/config/crds/kyverno.io_clusterbackgroundscanreports.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 creationTimestamp: null name: clusterbackgroundscanreports.kyverno.io spec: diff --git a/config/crds/kyverno.io_clustercleanuppolicies.yaml b/config/crds/kyverno.io_clustercleanuppolicies.yaml index 03cdddcf58..e5a3ec52f8 100644 --- a/config/crds/kyverno.io_clustercleanuppolicies.yaml +++ b/config/crds/kyverno.io_clustercleanuppolicies.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 creationTimestamp: null name: clustercleanuppolicies.kyverno.io spec: diff --git a/config/crds/kyverno.io_clusterpolicies.yaml b/config/crds/kyverno.io_clusterpolicies.yaml index 3d025eabcb..2b3ff18f9d 100644 --- a/config/crds/kyverno.io_clusterpolicies.yaml +++ b/config/crds/kyverno.io_clusterpolicies.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 creationTimestamp: null name: clusterpolicies.kyverno.io spec: diff --git a/config/crds/kyverno.io_generaterequests.yaml b/config/crds/kyverno.io_generaterequests.yaml index 9c8f69133d..392c05ae79 100644 --- a/config/crds/kyverno.io_generaterequests.yaml +++ b/config/crds/kyverno.io_generaterequests.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 creationTimestamp: null name: generaterequests.kyverno.io spec: diff --git a/config/crds/kyverno.io_policies.yaml b/config/crds/kyverno.io_policies.yaml index 9b1f9fe0d8..dc314255e3 100644 --- a/config/crds/kyverno.io_policies.yaml +++ b/config/crds/kyverno.io_policies.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 creationTimestamp: null name: policies.kyverno.io spec: diff --git a/config/crds/kyverno.io_policyexceptions.yaml b/config/crds/kyverno.io_policyexceptions.yaml index 407de24f0a..4eab7f04ca 100644 --- a/config/crds/kyverno.io_policyexceptions.yaml +++ b/config/crds/kyverno.io_policyexceptions.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 creationTimestamp: null name: policyexceptions.kyverno.io spec: diff --git a/config/crds/kyverno.io_updaterequests.yaml b/config/crds/kyverno.io_updaterequests.yaml index 73a8fc358d..9394aa2038 100644 --- a/config/crds/kyverno.io_updaterequests.yaml +++ b/config/crds/kyverno.io_updaterequests.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 creationTimestamp: null name: updaterequests.kyverno.io spec: diff --git a/config/crds/wgpolicyk8s.io_clusterpolicyreports.yaml b/config/crds/wgpolicyk8s.io_clusterpolicyreports.yaml index c727cabbef..0d55c59c24 100644 --- a/config/crds/wgpolicyk8s.io_clusterpolicyreports.yaml +++ b/config/crds/wgpolicyk8s.io_clusterpolicyreports.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 creationTimestamp: null name: clusterpolicyreports.wgpolicyk8s.io spec: diff --git a/config/crds/wgpolicyk8s.io_policyreports.yaml b/config/crds/wgpolicyk8s.io_policyreports.yaml index c0ef795096..727d8a2885 100644 --- a/config/crds/wgpolicyk8s.io_policyreports.yaml +++ b/config/crds/wgpolicyk8s.io_policyreports.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 creationTimestamp: null name: policyreports.wgpolicyk8s.io spec: diff --git a/config/install.yaml b/config/install.yaml index bf65cd3150..a497a279e7 100644 --- a/config/install.yaml +++ b/config/install.yaml @@ -68,7 +68,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 labels: app.kubernetes.io/component: kyverno app: kyverno @@ -414,7 +414,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 labels: app.kubernetes.io/component: kyverno app: kyverno @@ -720,7 +720,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 labels: app.kubernetes.io/component: kyverno app: kyverno @@ -1769,7 +1769,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 labels: app.kubernetes.io/component: kyverno app: kyverno @@ -2116,7 +2116,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 labels: app.kubernetes.io/component: kyverno app: kyverno @@ -2422,7 +2422,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 labels: app.kubernetes.io/component: kyverno app: kyverno @@ -3471,7 +3471,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 labels: app.kubernetes.io/component: kyverno app: kyverno @@ -15862,7 +15862,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 labels: app.kubernetes.io/component: kyverno app: kyverno @@ -16051,7 +16051,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 labels: app.kubernetes.io/component: kyverno app: kyverno @@ -28445,7 +28445,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 labels: app.kubernetes.io/component: kyverno app: kyverno @@ -28932,7 +28932,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 labels: app.kubernetes.io/component: kyverno app: kyverno @@ -29324,7 +29324,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 labels: app.kubernetes.io/component: kyverno app: kyverno @@ -29692,7 +29692,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 + controller-gen.kubebuilder.io/version: v0.11.1 labels: app.kubernetes.io/component: kyverno app: kyverno diff --git a/go.mod b/go.mod index e3198cbf29..cec16b2243 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( github.com/IGLOU-EU/go-wildcard v1.0.3 github.com/aquilax/truncate v1.0.0 - github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20221206183240-3b42f427f89a + github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20221221165957-55f4180e6214 github.com/blang/semver/v4 v4.0.0 github.com/cenkalti/backoff v2.2.1+incompatible github.com/chrismellard/docker-credential-acr-env v0.0.0-20221129204813-6a4d6ed5d396 @@ -21,7 +21,7 @@ require ( github.com/go-logr/zapr v1.2.3 github.com/google/gnostic v0.6.9 github.com/google/go-containerregistry v0.12.1 - github.com/google/go-containerregistry/pkg/authn/kubernetes v0.0.0-20221213180026-23d895d08035 + github.com/google/go-containerregistry/pkg/authn/kubernetes v0.0.0-20221219204429-9bd82373fd7f github.com/in-toto/in-toto-golang v0.5.0 github.com/jmespath/go-jmespath v0.4.0 github.com/jmoiron/jsonq v0.0.0-20150511023944-e874b168d07e @@ -55,23 +55,23 @@ require ( go.uber.org/multierr v1.9.0 go.uber.org/zap v1.24.0 golang.org/x/crypto v0.4.0 - golang.org/x/exp v0.0.0-20221212164502-fae10dda9338 + golang.org/x/exp v0.0.0-20221217163422-3c43f8badb15 golang.org/x/text v0.5.0 google.golang.org/grpc v1.51.0 gopkg.in/inf.v0 v0.9.1 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 gotest.tools v2.2.0+incompatible - k8s.io/api v0.25.5 - k8s.io/apiextensions-apiserver v0.25.4 - k8s.io/apimachinery v0.25.5 - k8s.io/cli-runtime v0.25.5 - k8s.io/client-go v0.25.5 + k8s.io/api v0.26.0 + k8s.io/apiextensions-apiserver v0.26.0 + k8s.io/apimachinery v0.26.0 + k8s.io/cli-runtime v0.26.0 + k8s.io/client-go v0.26.0 k8s.io/klog/v2 v2.80.1 - k8s.io/kube-openapi v0.0.0-20221205233837-bacb3aba404b - k8s.io/pod-security-admission v0.25.4 + k8s.io/kube-openapi v0.0.0-20221207184640-f3cff1453715 + k8s.io/pod-security-admission v0.26.0 k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 - sigs.k8s.io/controller-runtime v0.13.1 + sigs.k8s.io/controller-runtime v0.14.1 sigs.k8s.io/kustomize/api v0.12.1 sigs.k8s.io/kustomize/kyaml v0.13.9 sigs.k8s.io/yaml v1.3.0 @@ -79,12 +79,12 @@ require ( require ( cloud.google.com/go/compute v1.14.0 // indirect - cloud.google.com/go/compute/metadata v0.2.2 // indirect - cloud.google.com/go/iam v0.8.0 // indirect + cloud.google.com/go/compute/metadata v0.2.3 // indirect + cloud.google.com/go/iam v0.9.0 // indirect cloud.google.com/go/kms v1.7.0 // indirect cuelang.org/go v0.4.3 // indirect github.com/AliyunContainerService/ack-ram-tool/pkg/credentials/alibabacloudsdkgo/helper v0.2.0 // indirect - github.com/Azure/azure-sdk-for-go v67.1.0+incompatible // indirect + github.com/Azure/azure-sdk-for-go v67.2.0+incompatible // indirect github.com/Azure/go-autorest v14.2.0+incompatible // indirect github.com/Azure/go-autorest/autorest v0.11.28 // indirect github.com/Azure/go-autorest/autorest/adal v0.9.21 // indirect @@ -115,20 +115,20 @@ require ( github.com/armon/go-metrics v0.4.1 // indirect github.com/armon/go-radix v1.0.0 // indirect github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect - github.com/aws/aws-sdk-go-v2 v1.17.2 // indirect - github.com/aws/aws-sdk-go-v2/config v1.18.4 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.13.4 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.20 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.26 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.20 // indirect - github.com/aws/aws-sdk-go-v2/internal/ini v1.3.27 // indirect - github.com/aws/aws-sdk-go-v2/service/ecr v1.17.24 // indirect - github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.13.21 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.20 // indirect - github.com/aws/aws-sdk-go-v2/service/kms v1.19.2 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.11.26 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.9 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.17.6 // indirect + github.com/aws/aws-sdk-go-v2 v1.17.3 // indirect + github.com/aws/aws-sdk-go-v2/config v1.18.7 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.13.7 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.21 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.27 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.21 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.3.28 // indirect + github.com/aws/aws-sdk-go-v2/service/ecr v1.17.25 // indirect + github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.13.22 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.21 // indirect + github.com/aws/aws-sdk-go-v2/service/kms v1.19.4 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.11.28 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.11 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.17.7 // indirect github.com/aws/smithy-go v1.13.5 // indirect github.com/benbjohnson/clock v1.3.0 // indirect github.com/beorn7/perks v1.0.1 // indirect @@ -137,7 +137,7 @@ require ( github.com/cenkalti/backoff/v4 v4.2.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/clbanning/mxj/v2 v2.5.7 // indirect - github.com/cloudflare/circl v1.3.0 // indirect + github.com/cloudflare/circl v1.3.1 // indirect github.com/cockroachdb/apd/v2 v2.0.2 // indirect github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be // indirect github.com/containerd/stargz-snapshotter/estargz v0.13.0 // indirect @@ -146,9 +146,9 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/dimchansky/utfbom v1.1.1 // indirect github.com/djherbis/times v1.5.0 // indirect - github.com/docker/cli v20.10.21+incompatible // indirect + github.com/docker/cli v20.10.22+incompatible // indirect github.com/docker/distribution v2.8.1+incompatible // indirect - github.com/docker/docker v20.10.21+incompatible // indirect + github.com/docker/docker v20.10.22+incompatible // indirect github.com/docker/docker-credential-helpers v0.7.0 // indirect github.com/dustin/go-humanize v1.0.0 // indirect github.com/emicklei/go-restful/v3 v3.10.1 // indirect @@ -189,12 +189,12 @@ require ( github.com/google/gofuzz v1.2.0 // indirect github.com/google/gxui v0.0.0-20151028112939-f85e0a97b3a4 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect - github.com/google/trillian v1.5.1-0.20220819043421-0a389c4bb8d9 // indirect + github.com/google/trillian v1.5.1 // indirect github.com/google/uuid v1.3.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.2.1 // indirect github.com/googleapis/gax-go/v2 v2.7.0 // indirect github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.14.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-hclog v1.4.0 // indirect @@ -225,7 +225,7 @@ require ( github.com/kevinburke/ssh_config v1.2.0 // indirect github.com/klauspost/compress v1.15.13 // indirect github.com/leodido/go-urn v1.2.1 // indirect - github.com/letsencrypt/boulder v0.0.0-20221212234844-fe2cf7d13695 // indirect + github.com/letsencrypt/boulder v0.0.0-20221219200647-6c6da7640050 // indirect github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mailru/easyjson v0.7.7 // indirect @@ -251,7 +251,7 @@ require ( github.com/oklog/ulid v1.3.1 // indirect github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 // indirect github.com/open-policy-agent/gatekeeper v0.0.0-20210824170141-dd97b8a7e966 // indirect - github.com/open-policy-agent/opa v0.47.3 // indirect + github.com/open-policy-agent/opa v0.47.4 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0-rc2 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect @@ -288,7 +288,7 @@ require ( github.com/subosito/gotenv v1.4.1 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tchap/go-patricia/v2 v2.3.1 // indirect - github.com/tektoncd/chains v0.13.0 // indirect + github.com/tektoncd/chains v0.14.0 // indirect github.com/tent/canonical-json-go v0.0.0-20130607151641-96e4ba3a7613 // indirect github.com/thales-e-security/pool v0.0.2 // indirect github.com/theupdateframework/go-tuf v0.5.2-0.20220930112810-3890c1e7ace4 // indirect @@ -318,7 +318,7 @@ require ( golang.org/x/term v0.3.0 // indirect golang.org/x/time v0.3.0 // indirect golang.org/x/tools v0.4.0 // indirect - google.golang.org/api v0.104.0 // indirect + google.golang.org/api v0.105.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20221207170731-23e4bf6bdc37 // indirect google.golang.org/protobuf v1.28.1 // indirect @@ -326,8 +326,8 @@ require ( gopkg.in/square/go-jose.v2 v2.6.0 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect - k8s.io/component-base v0.25.4 // indirect - k8s.io/kubectl v0.25.4 // indirect + k8s.io/component-base v0.26.0 // indirect + k8s.io/kubectl v0.26.0 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/release-utils v0.7.3 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect diff --git a/go.sum b/go.sum index 7069e3d8e5..3de461e4d6 100644 --- a/go.sum +++ b/go.sum @@ -33,7 +33,7 @@ cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Ud cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= -cloud.google.com/go v0.105.0 h1:DNtEKRBAAzeS4KyIory52wWHuClNaXJ5x1F7xa4q+5Y= +cloud.google.com/go v0.107.0 h1:qkj22L7bgkl6vIeZDlOY2po43Mx/TIa2Wsa7VR+PEww= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -48,14 +48,14 @@ cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLq cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/compute v1.14.0 h1:hfm2+FfxVmnRlh6LpB7cg1ZNU+5edAHmW679JePztk0= cloud.google.com/go/compute v1.14.0/go.mod h1:YfLtxrj9sU4Yxv+sXzZkyPjEyPBZfXHUvjxega5vAdo= -cloud.google.com/go/compute/metadata v0.2.2 h1:aWKAjYaBaOSrpKl57+jnS/3fJRQnxL7TvR/u1VVbt6k= -cloud.google.com/go/compute/metadata v0.2.2/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= +cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= +cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= -cloud.google.com/go/iam v0.8.0 h1:E2osAkZzxI/+8pZcxVLcDtAQx/u+hZXVryUaYQ5O0Kk= -cloud.google.com/go/iam v0.8.0/go.mod h1:lga0/y3iH6CX7sYqypWJ33hf7kkfXJag67naqGESjkE= +cloud.google.com/go/iam v0.9.0 h1:bK6Or6mxhuL8lnj1i9j0yMo2wE/IeTO2cWlfUrf/TZs= +cloud.google.com/go/iam v0.9.0/go.mod h1:nXAECrMt2qHpF6RZUZseteD6QyanL68reN4OXPw0UWM= cloud.google.com/go/kms v1.7.0 h1:8FCf8C7qfOuSr6YzOQ4RGjJvswSRFeOpur3nHOlJbio= cloud.google.com/go/kms v1.7.0/go.mod h1:k2UdVoNIHLJi/Rnng6dN0vlq7lS3jHSDiZasft+gmYE= cloud.google.com/go/longrunning v0.3.0 h1:NjljC+FYPV3uh5/OwWT6pVU+doBqMg2x/rZlE+CamDs= @@ -79,8 +79,8 @@ cuelang.org/go v0.4.3/go.mod h1:7805vR9H+VoBNdWFdI7jyDR3QLUPp4+naHfbcgp55HI= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/AliyunContainerService/ack-ram-tool/pkg/credentials/alibabacloudsdkgo/helper v0.2.0 h1:8+4G8JaejP8Xa6W46PzJEwisNgBXMvFcz78N6zG/ARw= github.com/AliyunContainerService/ack-ram-tool/pkg/credentials/alibabacloudsdkgo/helper v0.2.0/go.mod h1:GgeIE+1be8Ivm7Sh4RgwI42aTtC9qrcj+Y9Y6CjJhJs= -github.com/Azure/azure-sdk-for-go v67.1.0+incompatible h1:oziYcaopbnIKfM69DL05wXdypiqfrUKdxUKrKpynJTw= -github.com/Azure/azure-sdk-for-go v67.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/azure-sdk-for-go v67.2.0+incompatible h1:Uu/Ww6ernvPTrpq31kITVTIm/I5jlJ1wjtEH/bmSB2k= +github.com/Azure/azure-sdk-for-go v67.2.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= @@ -230,38 +230,38 @@ github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN github.com/aws/aws-sdk-go v1.36.30/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go v1.44.155 h1:PMHMuUS0atPD4LhiXuYrLasrlIm4u3lpNQBl9h+Lr2s= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/aws/aws-sdk-go-v2 v1.17.2 h1:r0yRZInwiPBNpQ4aDy/Ssh3ROWsGtKDwar2JS8Lm+N8= -github.com/aws/aws-sdk-go-v2 v1.17.2/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= -github.com/aws/aws-sdk-go-v2/config v1.18.4 h1:VZKhr3uAADXHStS/Gf9xSYVmmaluTUfkc0dcbPiDsKE= -github.com/aws/aws-sdk-go-v2/config v1.18.4/go.mod h1:EZxMPLSdGAZ3eAmkqXfYbRppZJTzFTkv8VyEzJhKko4= -github.com/aws/aws-sdk-go-v2/credentials v1.13.4 h1:nEbHIyJy7mCvQ/kzGG7VWHSBpRB4H6sJy3bWierWUtg= -github.com/aws/aws-sdk-go-v2/credentials v1.13.4/go.mod h1:/Cj5w9LRsNTLSwexsohwDME32OzJ6U81Zs33zr2ZWOM= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.20 h1:tpNOglTZ8kg9T38NpcGBxudqfUAwUzyUnLQ4XSd0CHE= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.20/go.mod h1:d9xFpWd3qYwdIXM0fvu7deD08vvdRXyc/ueV+0SqaWE= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.26 h1:5WU31cY7m0tG+AiaXuXGoMzo2GBQ1IixtWa8Yywsgco= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.26/go.mod h1:2E0LdbJW6lbeU4uxjum99GZzI0ZjDpAb0CoSCM0oeEY= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.20 h1:WW0qSzDWoiWU2FS5DbKpxGilFVlCEJPwx4YtjdfI0Jw= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.20/go.mod h1:/+6lSiby8TBFpTVXZgKiN/rCfkYXEGvhlM4zCgPpt7w= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.27 h1:N2eKFw2S+JWRCtTt0IhIX7uoGGQciD4p6ba+SJv4WEU= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.27/go.mod h1:RdwFVc7PBYWY33fa2+8T1mSqQ7ZEK4ILpM0wfioDC3w= -github.com/aws/aws-sdk-go-v2/service/ecr v1.17.24 h1:Ax6tsTbbkkVFewkarjAuV50m3T9SdVNyngnQgrumYnE= -github.com/aws/aws-sdk-go-v2/service/ecr v1.17.24/go.mod h1:p0ME1/7PG+Gn6fUcBaXGyeuI+gL6JCD7aM1/EfwxmWo= -github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.13.21 h1:MDdhSMk2TImYUtVmgjgdNHnMEUXHlQrKJV7wfxSupjg= -github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.13.21/go.mod h1:q9zznamieyKrNWiI4gaPMmjni3r2MDyb+509ukpOrJk= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.20 h1:jlgyHbkZQAgAc7VIxJDmtouH8eNjOk2REVAQfVhdaiQ= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.20/go.mod h1:Xs52xaLBqDEKRcAfX/hgjmD3YQ7c/W+BEyfamlO/W2E= -github.com/aws/aws-sdk-go-v2/service/kms v1.19.2 h1:pgOVfu7E6zBddKGks4TvL4YuFsL/oTpiWDIzs4WPLjY= -github.com/aws/aws-sdk-go-v2/service/kms v1.19.2/go.mod h1:XH60PhgtbXDXFBzJ2auE6bpIELxAYTnoVFFwPtG8JwY= -github.com/aws/aws-sdk-go-v2/service/sso v1.11.26 h1:ActQgdTNQej/RuUJjB9uxYVLDOvRGtUreXF8L3c8wyg= -github.com/aws/aws-sdk-go-v2/service/sso v1.11.26/go.mod h1:uB9tV79ULEZUXc6Ob18A46KSQ0JDlrplPni9XW6Ot60= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.9 h1:wihKuqYUlA2T/Rx+yu2s6NDAns8B9DgnRooB1PVhY+Q= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.9/go.mod h1:2E/3D/mB8/r2J7nK42daoKP/ooCwbf0q1PznNc+DZTU= -github.com/aws/aws-sdk-go-v2/service/sts v1.17.6 h1:VQFOLQVL3BrKM/NLO/7FiS4vcp5bqK0mGMyk09xLoAY= -github.com/aws/aws-sdk-go-v2/service/sts v1.17.6/go.mod h1:Az3OXXYGyfNwQNsK/31L4R75qFYnO641RZGAoV3uH1c= +github.com/aws/aws-sdk-go-v2 v1.17.3 h1:shN7NlnVzvDUgPQ+1rLMSxY8OWRNDRYtiqe0p/PgrhY= +github.com/aws/aws-sdk-go-v2 v1.17.3/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= +github.com/aws/aws-sdk-go-v2/config v1.18.7 h1:V94lTcix6jouwmAsgQMAEBozVAGJMFhVj+6/++xfe3E= +github.com/aws/aws-sdk-go-v2/config v1.18.7/go.mod h1:OZYsyHFL5PB9UpyS78NElgKs11qI/B5KJau2XOJDXHA= +github.com/aws/aws-sdk-go-v2/credentials v1.13.7 h1:qUUcNS5Z1092XBFT66IJM7mYkMwgZ8fcC8YDIbEwXck= +github.com/aws/aws-sdk-go-v2/credentials v1.13.7/go.mod h1:AdCcbZXHQCjJh6NaH3pFaw8LUeBFn5+88BZGMVGuBT8= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.21 h1:j9wi1kQ8b+e0FBVHxCqCGo4kxDU175hoDHcWAi0sauU= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.21/go.mod h1:ugwW57Z5Z48bpvUyZuaPy4Kv+vEfJWnIrky7RmkBvJg= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.27 h1:I3cakv2Uy1vNmmhRQmFptYDxOvBnwCdNwyw63N0RaRU= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.27/go.mod h1:a1/UpzeyBBerajpnP5nGZa9mGzsBn5cOKxm6NWQsvoI= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.21 h1:5NbbMrIzmUn/TXFqAle6mgrH5m9cOvMLRGL7pnG8tRE= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.21/go.mod h1:+Gxn8jYn5k9ebfHEqlhrMirFjSW0v0C9fI+KN5vk2kE= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.28 h1:KeTxcGdNnQudb46oOl4d90f2I33DF/c6q3RnZAmvQdQ= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.28/go.mod h1:yRZVr/iT0AqyHeep00SZ4YfBAKojXz08w3XMBscdi0c= +github.com/aws/aws-sdk-go-v2/service/ecr v1.17.25 h1:1bido4Jtd8CG9JcheRITQMQ820RE6mw+ool5ln9jbtY= +github.com/aws/aws-sdk-go-v2/service/ecr v1.17.25/go.mod h1:9yGOFsa2OcdyePojE89xNGtdBusTyc8ocjpiuFtFc0g= +github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.13.22 h1:mAfbm9OuaKTQ/KweojB47hTHSRxf1Z3h721bOxLJjNY= +github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.13.22/go.mod h1:bBy8YiBBFd549EeySGjb0vHWg80XeMSigv/dr/2HFjE= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.21 h1:5C6XgTViSb0bunmU57b3CT+MhxULqHH2721FVA+/kDM= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.21/go.mod h1:lRToEJsn+DRA9lW4O9L9+/3hjTkUzlzyzHqn8MTds5k= +github.com/aws/aws-sdk-go-v2/service/kms v1.19.4 h1:bX+nEwdukfDdfGPUjNNqs7NwZyqyMjIy5YpZda9Gcu4= +github.com/aws/aws-sdk-go-v2/service/kms v1.19.4/go.mod h1:13sjgMH7Xu4e46+0BEDhSnNh+cImHSYS5PpBjV3oXcU= +github.com/aws/aws-sdk-go-v2/service/sso v1.11.28 h1:gItLq3zBYyRDPmqAClgzTH8PBjDQGeyptYGHIwtYYNA= +github.com/aws/aws-sdk-go-v2/service/sso v1.11.28/go.mod h1:wo/B7uUm/7zw/dWhBJ4FXuw1sySU5lyIhVg1Bu2yL9A= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.11 h1:KCacyVSs/wlcPGx37hcbT3IGYO8P8Jx+TgSDhAXtQMY= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.11/go.mod h1:TZSH7xLO7+phDtViY/KUp9WGCJMQkLJ/VpgkTFd5gh8= +github.com/aws/aws-sdk-go-v2/service/sts v1.17.7 h1:9Mtq1KM6nD8/+HStvWcvYnixJ5N85DX+P+OY3kI3W2k= +github.com/aws/aws-sdk-go-v2/service/sts v1.17.7/go.mod h1:+lGbb3+1ugwKrNTWcf2RT05Xmp543B06zDFTwiTLp7I= github.com/aws/smithy-go v1.13.5 h1:hgz0X/DX0dGqTYpGALqXJoRKRj5oQ7150i5FdTePzO8= github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= -github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20221206183240-3b42f427f89a h1:DslzSBlwyazvXLynfTaXNkCrWvp2dKzREVnc4X0M0D8= -github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20221206183240-3b42f427f89a/go.mod h1:Bcd0EEV5vE4ojP1hujLy9SLb42nMtG8Z0M3lGpfbJEY= +github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20221221165957-55f4180e6214 h1:/nfZgDR5yCbw2RyVRtM63vshAO8TmKRWHQF7Uc7cayo= +github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20221221165957-55f4180e6214/go.mod h1:Qaw92j/vBjGDv0p+6y7BtOAHJ4IoLXu98sW5A1PW1to= github.com/beevik/etree v1.1.0/go.mod h1:r8Aw8JqVegEf0w2fDnATrX9VpkMcyFeM0FhwO62wh+A= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= @@ -312,8 +312,8 @@ github.com/clbanning/mxj/v2 v2.5.7/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= -github.com/cloudflare/circl v1.3.0 h1:Anq00jxDtoyX3+aCaYUZ0vXC5r4k4epberfWGDXV1zE= -github.com/cloudflare/circl v1.3.0/go.mod h1:+CauBF6R70Jqcyl8N2hC8pAXYbWkGIezuSbuGLtRhnw= +github.com/cloudflare/circl v1.3.1 h1:4OVCZRL62ijwEwxnF6I7hLwxvIYi3VaZt8TflkqtrtA= +github.com/cloudflare/circl v1.3.1/go.mod h1:+CauBF6R70Jqcyl8N2hC8pAXYbWkGIezuSbuGLtRhnw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -380,8 +380,8 @@ github.com/docker/cli v20.10.9+incompatible h1:OJ7YkwQA+k2Oi51lmCojpjiygKpi76P7b github.com/docker/cli v20.10.9+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v20.10.21+incompatible h1:UTLdBmHk3bEY+w8qeO5KttOhy6OmXWsl/FEet9Uswog= -github.com/docker/docker v20.10.21+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v20.10.22+incompatible h1:6jX4yB+NtcbldT90k7vBSaWJDB3i+zkVJT9BEK8kQkk= +github.com/docker/docker v20.10.22+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A= github.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNkFR1R1V12OJRRO5lzt2D1b5X0= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= @@ -687,8 +687,8 @@ github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-containerregistry v0.12.1 h1:W1mzdNUTx4Zla4JaixCRLhORcR7G6KxE5hHl5fkPsp8= github.com/google/go-containerregistry v0.12.1/go.mod h1:sdIK+oHQO7B93xI8UweYdl887YhuIwg9vz8BSLH3+8k= -github.com/google/go-containerregistry/pkg/authn/kubernetes v0.0.0-20221213180026-23d895d08035 h1:J5i+026/q7u8OFsr+Rh0J8Eg1GdncySPYEK4i8YKiw4= -github.com/google/go-containerregistry/pkg/authn/kubernetes v0.0.0-20221213180026-23d895d08035/go.mod h1:6pjZpt+0dg+Z0kUEn53qLtD57raiZo/bqWzsuX6dDjo= +github.com/google/go-containerregistry/pkg/authn/kubernetes v0.0.0-20221219204429-9bd82373fd7f h1:B+VVRz3nwmvQi5chfbyIADYmrRUN4PDFeJ55hUq4F80= +github.com/google/go-containerregistry/pkg/authn/kubernetes v0.0.0-20221219204429-9bd82373fd7f/go.mod h1:6pjZpt+0dg+Z0kUEn53qLtD57raiZo/bqWzsuX6dDjo= github.com/google/go-github/v45 v45.2.0 h1:5oRLszbrkvxDDqBCNj2hjDZMKmvexaZ1xw/FCD+K3FI= github.com/google/go-github/v45 v45.2.0/go.mod h1:FObaZJEDSTa/WGCzZ2Z3eoCDXWJKMenWWTrd8jrta28= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= @@ -724,8 +724,8 @@ github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm4 github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/trillian v1.3.11/go.mod h1:0tPraVHrSDkA3BO6vKX67zgLXs6SsOAbHEivX+9mPgw= -github.com/google/trillian v1.5.1-0.20220819043421-0a389c4bb8d9 h1:GFmzYtwUMi1S2mjLxfrJ/CZ9gWDG+zeLtZByg/QEBkk= -github.com/google/trillian v1.5.1-0.20220819043421-0a389c4bb8d9/go.mod h1:vywkS3p2SgNmPL7oAWqU5PiiknzRMp+ol3a19jfY2PQ= +github.com/google/trillian v1.5.1 h1:2p1l13f0eWd7eOShwarwIxutYYnGzY/5S+xYewQIPkU= +github.com/google/trillian v1.5.1/go.mod h1:EcDttN8nf+EoAiyLigBAp9ebncZI6rhJPyxZ+dQ6HSo= github.com/google/uuid v0.0.0-20161128191214-064e2069ce9c/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -784,8 +784,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t github.com/grpc-ecosystem/grpc-gateway v1.12.1/go.mod h1:8XEsbTttt/W+VvjtQhLACqCisSPWTxCZ7sBRjU6iH9c= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.14.0 h1:t7uX3JBHdVwAi3G7sSSdbsk8NfgA+LnUS88V/2EKaA0= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.14.0/go.mod h1:4OGVnY4qf2+gw+ssiHbW+pq4mo2yko94YxxMmXZ7jCA= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0 h1:1JYBfzqrWPcCclBwxFCPAou9n+q86mfnu7NAeHfte7A= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0/go.mod h1:YDZoGHuwE+ov0c8smSH49WLF3F2LaWnYYuDVd+EWrc0= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= @@ -964,13 +964,13 @@ github.com/lensesio/tableprinter v0.0.0-20201125135848-89e81fc956e7 h1:k/1ku0yeh github.com/lensesio/tableprinter v0.0.0-20201125135848-89e81fc956e7/go.mod h1:YR/zYthNdWfO8+0IOyHDcIDBBBS2JMnYUIwSsnwmRqU= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= -github.com/letsencrypt/boulder v0.0.0-20221212234844-fe2cf7d13695 h1:OHG4m295IFJQb8GtAvnuI+U03rewgSLZnHi8UHQlzkI= -github.com/letsencrypt/boulder v0.0.0-20221212234844-fe2cf7d13695/go.mod h1:tZMrPFyo8oDWc1p1aj5l0C8KY1R35D1qQ8ur3bADi9w= +github.com/letsencrypt/boulder v0.0.0-20221219200647-6c6da7640050 h1:xlTE6TuKGM9WdD+MsNFHdmWjkFTOMSLfW8UWWZjypVQ= +github.com/letsencrypt/boulder v0.0.0-20221219200647-6c6da7640050/go.mod h1:PP1uqWBNbdS1h/T09AcOs/y/vlkNn+Qgymf0XgDwQn8= github.com/letsencrypt/pkcs11key/v4 v4.0.0/go.mod h1:EFUvBDay26dErnNb70Nd0/VW3tJiIbETBPTl9ATXQag= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.9.0 h1:L8nSXQQzAYByakOFMTwpjRoHsMJklur4Gi59b6VivR8= github.com/lib/pq v1.9.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= @@ -1147,8 +1147,8 @@ github.com/open-policy-agent/gatekeeper v0.0.0-20210824170141-dd97b8a7e966 h1:p8 github.com/open-policy-agent/gatekeeper v0.0.0-20210824170141-dd97b8a7e966/go.mod h1:JO6AV/tyZ/MsNGsvnjTK6lGpiJyMLtt7UxkT6Eq9kDE= github.com/open-policy-agent/opa v0.24.0/go.mod h1:qEyD/i8j+RQettHGp4f86yjrjvv+ZYia+JHCMv2G7wA= github.com/open-policy-agent/opa v0.29.4/go.mod h1:ZCOTD3yyFR8JvF8ETdWdiSPn9WcF1dXeQWOv7VoPorU= -github.com/open-policy-agent/opa v0.47.3 h1:Uj8zw+q6Cvv1iiQFh704Q6sl3fKVvk35WZNJLsd6mgk= -github.com/open-policy-agent/opa v0.47.3/go.mod h1:I5DbT677OGqfk9gvu5i54oIt0rrVf4B5pedpqDquAXo= +github.com/open-policy-agent/opa v0.47.4 h1:CTPIoAv6/UJX+BkSkqytbofWrZHyfQ/A0ESE4FSKR9A= +github.com/open-policy-agent/opa v0.47.4/go.mod h1:I5DbT677OGqfk9gvu5i54oIt0rrVf4B5pedpqDquAXo= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= @@ -1416,8 +1416,8 @@ github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJ github.com/tchap/go-patricia/v2 v2.3.1 h1:6rQp39lgIYZ+MHmdEq4xzuk1t7OdC35z/xm0BGhTkes= github.com/tchap/go-patricia/v2 v2.3.1/go.mod h1:VZRHKAb53DLaG+nA9EaYYiaEx6YztwDlLElMsnSHD4k= github.com/tdakkota/asciicheck v0.0.0-20200416200610-e657995f937b/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM= -github.com/tektoncd/chains v0.13.0 h1:sS1AN/LBHkg3/XC9blFAvvkssyJx9I+WXOR7NRdZwYU= -github.com/tektoncd/chains v0.13.0/go.mod h1:h8/jCr1JA12/kuOMRCmNclURrFZERPaXCsklrBA4dLE= +github.com/tektoncd/chains v0.14.0 h1:tKp9nzfflcZ4GJIIEXTHM6qePRhN7YGrpOq/dzop/sA= +github.com/tektoncd/chains v0.14.0/go.mod h1:Ak0so5jzpntoVtJkD7JedDePkvWG+LPhL6kBfnpgGsk= github.com/tent/canonical-json-go v0.0.0-20130607151641-96e4ba3a7613 h1:iGnD/q9160NWqKZZ5vY4p0dMiYMRknzctfSkqA4nBDw= github.com/tent/canonical-json-go v0.0.0-20130607151641-96e4ba3a7613/go.mod h1:g6AnIpDSYMcphz193otpSIzN+11Rs+AAIIC6rm1enug= github.com/tetafro/godot v1.4.6/go.mod h1:LR3CJpxDVGlYOWn3ZZg1PgNZdTUvzsZWu8xaEohUpn8= @@ -1628,8 +1628,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20221212164502-fae10dda9338 h1:OvjRkcNHnf6/W5FZXSxODbxwD+X7fspczG7Jn/xQVD4= -golang.org/x/exp v0.0.0-20221212164502-fae10dda9338/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/exp v0.0.0-20221217163422-3c43f8badb15 h1:5oN1Pz/eDhCpbMbLstvIPa0b/BEQo6g6nwV3pLjfM6w= +golang.org/x/exp v0.0.0-20221217163422-3c43f8badb15/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181023182221-1baf3a9d7d67/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -2077,8 +2077,8 @@ google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69 google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= -google.golang.org/api v0.104.0 h1:KBfmLRqdZEbwQleFlSLnzpQJwhjpmNOk4cKQIBDZ9mg= -google.golang.org/api v0.104.0/go.mod h1:JCspTXJbBxa5ySXw4UgUqVer7DfVxbvc/CTUFqAED5U= +google.golang.org/api v0.105.0 h1:t6P9Jj+6XTn4U9I2wycQai6Q/Kz7iOT+QzjJ3G2V4x8= +google.golang.org/api v0.105.0/go.mod h1:qh7eD5FJks5+BcE+cjBIm6Gz8vioK7EHvnlniqXBnqI= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -2304,30 +2304,30 @@ honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.1.4/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= k8s.io/api v0.20.2/go.mod h1:d7n6Ehyzx+S+cE3VhTGfVNNqtGc/oL9DCdYYahlurV8= -k8s.io/api v0.25.5 h1:mqyHf7aoaYMpdvO87mqpol+Qnsmo+y09S0PMIXwiZKo= -k8s.io/api v0.25.5/go.mod h1:RzplZX0Z8rV/WhSTfEvnyd91bBhBQTRWo85qBQwRmb8= +k8s.io/api v0.26.0 h1:IpPlZnxBpV1xl7TGk/X6lFtpgjgntCg8PJ+qrPHAC7I= +k8s.io/api v0.26.0/go.mod h1:k6HDTaIFC8yn1i6pSClSqIwLABIcLV9l5Q4EcngKnQg= k8s.io/apiextensions-apiserver v0.20.1/go.mod h1:ntnrZV+6a3dB504qwC5PN/Yg9PBiDNt1EVqbW2kORVk= k8s.io/apiextensions-apiserver v0.20.2/go.mod h1:F6TXp389Xntt+LUq3vw6HFOLttPa0V8821ogLGwb6Zs= -k8s.io/apiextensions-apiserver v0.25.4 h1:7hu9pF+xikxQuQZ7/30z/qxIPZc2J1lFElPtr7f+B6U= -k8s.io/apiextensions-apiserver v0.25.4/go.mod h1:bkSGki5YBoZWdn5pWtNIdGvDrrsRWlmnvl9a+tAw5vQ= +k8s.io/apiextensions-apiserver v0.26.0 h1:Gy93Xo1eg2ZIkNX/8vy5xviVSxwQulsnUdQ00nEdpDo= +k8s.io/apiextensions-apiserver v0.26.0/go.mod h1:7ez0LTiyW5nq3vADtK6C3kMESxadD51Bh6uz3JOlqWQ= k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= k8s.io/apimachinery v0.20.2/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= -k8s.io/apimachinery v0.25.5 h1:SQomYHvv+aO43qdu3QKRf9YuI0oI8w3RrOQ1qPbAUGY= -k8s.io/apimachinery v0.25.5/go.mod h1:1S2i1QHkmxc8+EZCIxe/fX5hpldVXk4gvnJInMEb8D4= +k8s.io/apimachinery v0.26.0 h1:1feANjElT7MvPqp0JT6F3Ss6TWDwmcjLypwoPpEf7zg= +k8s.io/apimachinery v0.26.0/go.mod h1:tnPmbONNJ7ByJNz9+n9kMjNP8ON+1qoAIIC70lztu74= k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU= k8s.io/apiserver v0.20.2/go.mod h1:2nKd93WyMhZx4Hp3RfgH2K5PhwyTrprrkWYnI7id7jA= -k8s.io/cli-runtime v0.25.5 h1:5Q37ITYtPtSw2JQcN6EBsdOQBnGvvo/D1g93Da4ceYI= -k8s.io/cli-runtime v0.25.5/go.mod h1:o7lT2rFyfbLrQOzTFsV828OyxKsTE/FmVc3ag1nx0IU= +k8s.io/cli-runtime v0.26.0 h1:aQHa1SyUhpqxAw1fY21x2z2OS5RLtMJOCj7tN4oq8mw= +k8s.io/cli-runtime v0.26.0/go.mod h1:o+4KmwHzO/UK0wepE1qpRk6l3o60/txUZ1fEXWGIKTY= k8s.io/client-go v0.20.1/go.mod h1:/zcHdt1TeWSd5HoUe6elJmHSQ6uLLgp4bIJHVEuy+/Y= k8s.io/client-go v0.20.2/go.mod h1:kH5brqWqp7HDxUFKoEgiI4v8G1xzbe9giaCenUWJzgE= -k8s.io/client-go v0.25.5 h1:7QWVK0Ph4bLn0UwotPTc2FTgm8shreQXyvXnnHDd8rE= -k8s.io/client-go v0.25.5/go.mod h1:bOeoaUUdpyz3WDFGo+Xm3nOQFh2KuYXRDwrvbAPtFQA= +k8s.io/client-go v0.26.0 h1:lT1D3OfO+wIi9UFolCrifbjUUgu7CpLca0AD8ghRLI8= +k8s.io/client-go v0.26.0/go.mod h1:I2Sh57A79EQsDmn7F7ASpmru1cceh3ocVT9KlX2jEZg= k8s.io/code-generator v0.20.1/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbWHJg= k8s.io/code-generator v0.20.2/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbWHJg= k8s.io/component-base v0.20.1/go.mod h1:guxkoJnNoh8LNrbtiQOlyp2Y2XFCZQmrcg2n/DeYNLk= k8s.io/component-base v0.20.2/go.mod h1:pzFtCiwe/ASD0iV7ySMu8SYVJjCapNM9bjvk7ptpKh0= -k8s.io/component-base v0.25.4 h1:n1bjg9Yt+G1C0WnIDJmg2fo6wbEU1UGMRiQSjmj7hNQ= -k8s.io/component-base v0.25.4/go.mod h1:nnZJU8OP13PJEm6/p5V2ztgX2oyteIaAGKGMYb2L2cY= +k8s.io/component-base v0.26.0 h1:0IkChOCohtDHttmKuz+EP3j3+qKmV55rM9gIFTXA7Vs= +k8s.io/component-base v0.26.0/go.mod h1:lqHwlfV1/haa14F/Z5Zizk5QmzaVf23nQzCwVOQpfC8= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20201113003025-83324d819ded/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= @@ -2338,12 +2338,12 @@ k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4= k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= -k8s.io/kube-openapi v0.0.0-20221205233837-bacb3aba404b h1:PaCbMEW4UY9baOEpW6dFfV5p/+UWMwtem9i7IlENS+o= -k8s.io/kube-openapi v0.0.0-20221205233837-bacb3aba404b/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4= -k8s.io/kubectl v0.25.4 h1:O3OA1z4V1ZyvxCvScjq0pxAP7ABgznr8UvnVObgI6Dc= -k8s.io/kubectl v0.25.4/go.mod h1:CKMrQ67Bn2YCP26tZStPQGq62zr9pvzEf65A0navm8k= -k8s.io/pod-security-admission v0.25.4 h1:jUjWkuYPnuZo7HNj0FkiPjcoj0ERULXGSTCMiDM91A8= -k8s.io/pod-security-admission v0.25.4/go.mod h1:0xthTisMu4TTzHrzM5SCeaRoFwqBjM54DqdHVcwk62k= +k8s.io/kube-openapi v0.0.0-20221207184640-f3cff1453715 h1:tBEbstoM+K0FiBV5KGAKQ0kuvf54v/hwpldiJt69w1s= +k8s.io/kube-openapi v0.0.0-20221207184640-f3cff1453715/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4= +k8s.io/kubectl v0.26.0 h1:xmrzoKR9CyNdzxBmXV7jW9Ln8WMrwRK6hGbbf69o4T0= +k8s.io/kubectl v0.26.0/go.mod h1:eInP0b+U9XUJWSYeU9XZnTA+cVYuWyl3iYPGtru0qhQ= +k8s.io/pod-security-admission v0.26.0 h1:XBG/uyP2cYwSFr5IWAQ1IIArxMYARJKzEzSmP4ZbC1s= +k8s.io/pod-security-admission v0.26.0/go.mod h1:HQHvpCrn6KQLKRUqFvWkHCVKet3X62fn2F3j5anYiEM= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20210111153108-fddb29f9d009/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 h1:KTgPnR10d5zhztWptI952TNtt/4u5h3IzDXkdIMuo2Y= @@ -2358,8 +2358,8 @@ rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.14/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/controller-runtime v0.8.2/go.mod h1:U/l+DUopBc1ecfRZ5aviA9JDmGFQKvLf5YkZNx2e0sU= sigs.k8s.io/controller-runtime v0.8.3/go.mod h1:U/l+DUopBc1ecfRZ5aviA9JDmGFQKvLf5YkZNx2e0sU= -sigs.k8s.io/controller-runtime v0.13.1 h1:tUsRCSJVM1QQOOeViGeX3GMT3dQF1eePPw6sEE3xSlg= -sigs.k8s.io/controller-runtime v0.13.1/go.mod h1:Zbz+el8Yg31jubvAEyglRZGdLAjplZl+PgtYNI6WNTI= +sigs.k8s.io/controller-runtime v0.14.1 h1:vThDes9pzg0Y+UbCPY3Wj34CGIYPgdmspPm2GIpxpzM= +sigs.k8s.io/controller-runtime v0.14.1/go.mod h1:GaRkrY8a7UZF0kqFFbUKG7n9ICiTY5T55P1RiE3UZlU= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/kustomize/api v0.12.1 h1:7YM7gW3kYBwtKvoY216ZzY+8hM+lV53LUayghNRJ0vM= diff --git a/hack/main.go b/hack/main.go index 3e3de523d6..a79a14cc4f 100644 --- a/hack/main.go +++ b/hack/main.go @@ -625,7 +625,7 @@ func parseClientset(in reflect.Type) clientset { } func parseImports(in reflect.Type) []string { - imports := sets.NewString(in.PkgPath()) + imports := sets.New(in.PkgPath()) for _, m := range getMethods(in) { for _, i := range getIns(m) { if i.Kind() == reflect.Pointer { @@ -645,7 +645,7 @@ func parseImports(in reflect.Type) []string { } } } - return imports.List() + return sets.List(imports) } func executeTemplate(tpl string, data interface{}, folder string, file string) { diff --git a/pkg/autogen/autogen.go b/pkg/autogen/autogen.go index 0a524f4557..5271dc7b77 100644 --- a/pkg/autogen/autogen.go +++ b/pkg/autogen/autogen.go @@ -21,7 +21,7 @@ const ( PodControllers = "DaemonSet,Deployment,Job,StatefulSet,ReplicaSet,ReplicationController,CronJob" ) -var podControllersKindsSet = sets.NewString(append(strings.Split(PodControllers, ","), "Pod")...) +var podControllersKindsSet = sets.New(append(strings.Split(PodControllers, ","), "Pod")...) func isKindOtherthanPod(kinds []string) bool { if len(kinds) > 1 && kubeutils.ContainsKind(kinds, "Pod") { diff --git a/pkg/background/update_request_controller.go b/pkg/background/update_request_controller.go index 32a088f37c..41801d56fc 100644 --- a/pkg/background/update_request_controller.go +++ b/pkg/background/update_request_controller.go @@ -97,16 +97,16 @@ func NewController( configuration: dynamicConfig, informerCacheResolvers: informerCacheResolvers, } - urInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ + _, _ = urInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ AddFunc: c.addUR, UpdateFunc: c.updateUR, DeleteFunc: c.deleteUR, }) - cpolInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ + _, _ = cpolInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ UpdateFunc: c.updatePolicy, DeleteFunc: c.deletePolicy, }) - polInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ + _, _ = polInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ UpdateFunc: c.updatePolicy, DeleteFunc: c.deletePolicy, }) diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index 132cc1830a..824c2eea3a 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -41,8 +41,7 @@ type Interface interface { Wgpolicyk8sV1alpha2() wgpolicyk8sv1alpha2.Wgpolicyk8sV1alpha2Interface } -// Clientset contains the clients for groups. Each group has exactly one -// version included in a Clientset. +// Clientset contains the clients for groups. type Clientset struct { *discovery.DiscoveryClient kyvernoV1 *kyvernov1.KyvernoV1Client diff --git a/pkg/client/informers/externalversions/factory.go b/pkg/client/informers/externalversions/factory.go index caac25bb52..af7313c900 100644 --- a/pkg/client/informers/externalversions/factory.go +++ b/pkg/client/informers/externalversions/factory.go @@ -48,6 +48,11 @@ type sharedInformerFactory struct { // startedInformers is used for tracking which informers have been started. // This allows Start() to be called multiple times safely. startedInformers map[reflect.Type]bool + // wg tracks how many goroutines were started. + wg sync.WaitGroup + // shuttingDown is true when Shutdown has been called. It may still be running + // because it needs to wait for goroutines. + shuttingDown bool } // WithCustomResyncConfig sets a custom resync period for the specified informer types. @@ -108,20 +113,39 @@ func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResy return factory } -// Start initializes all requested informers. func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { f.lock.Lock() defer f.lock.Unlock() + if f.shuttingDown { + return + } + for informerType, informer := range f.informers { if !f.startedInformers[informerType] { - go informer.Run(stopCh) + f.wg.Add(1) + // We need a new variable in each loop iteration, + // otherwise the goroutine would use the loop variable + // and that keeps changing. + informer := informer + go func() { + defer f.wg.Done() + informer.Run(stopCh) + }() f.startedInformers[informerType] = true } } } -// WaitForCacheSync waits for all started informers' cache were synced. +func (f *sharedInformerFactory) Shutdown() { + f.lock.Lock() + f.shuttingDown = true + f.lock.Unlock() + + // Will return immediately if there is nothing to wait for. + f.wg.Wait() +} + func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { informers := func() map[reflect.Type]cache.SharedIndexInformer { f.lock.Lock() @@ -168,11 +192,58 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal // SharedInformerFactory provides shared informers for resources in all known // API group versions. +// +// It is typically used like this: +// +// ctx, cancel := context.Background() +// defer cancel() +// factory := NewSharedInformerFactory(client, resyncPeriod) +// defer factory.WaitForStop() // Returns immediately if nothing was started. +// genericInformer := factory.ForResource(resource) +// typedInformer := factory.SomeAPIGroup().V1().SomeType() +// factory.Start(ctx.Done()) // Start processing these informers. +// synced := factory.WaitForCacheSync(ctx.Done()) +// for v, ok := range synced { +// if !ok { +// fmt.Fprintf(os.Stderr, "caches failed to sync: %v", v) +// return +// } +// } +// +// // Creating informers can also be created after Start, but then +// // Start must be called again: +// anotherGenericInformer := factory.ForResource(resource) +// factory.Start(ctx.Done()) type SharedInformerFactory interface { internalinterfaces.SharedInformerFactory - ForResource(resource schema.GroupVersionResource) (GenericInformer, error) + + // Start initializes all requested informers. They are handled in goroutines + // which run until the stop channel gets closed. + Start(stopCh <-chan struct{}) + + // Shutdown marks a factory as shutting down. At that point no new + // informers can be started anymore and Start will return without + // doing anything. + // + // In addition, Shutdown blocks until all goroutines have terminated. For that + // to happen, the close channel(s) that they were started with must be closed, + // either before Shutdown gets called or while it is waiting. + // + // Shutdown may be called multiple times, even concurrently. All such calls will + // block until all goroutines have terminated. + Shutdown() + + // WaitForCacheSync blocks until all started informers' caches were synced + // or the stop channel gets closed. WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool + // ForResource gives generic access to a shared informer of the matching type. + ForResource(resource schema.GroupVersionResource) (GenericInformer, error) + + // InternalInformerFor returns the SharedIndexInformer for obj using an internal + // client. + InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer + Kyverno() kyverno.Interface Wgpolicyk8s() policyreport.Interface } diff --git a/pkg/clients/kube/admissionregistrationv1alpha1/client.generated.go b/pkg/clients/kube/admissionregistrationv1alpha1/client.generated.go new file mode 100644 index 0000000000..63dbd0de9a --- /dev/null +++ b/pkg/clients/kube/admissionregistrationv1alpha1/client.generated.go @@ -0,0 +1,70 @@ +package client + +import ( + "github.com/go-logr/logr" + validatingadmissionpolicies "github.com/kyverno/kyverno/pkg/clients/kube/admissionregistrationv1alpha1/validatingadmissionpolicies" + validatingadmissionpolicybindings "github.com/kyverno/kyverno/pkg/clients/kube/admissionregistrationv1alpha1/validatingadmissionpolicybindings" + "github.com/kyverno/kyverno/pkg/metrics" + k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1" + "k8s.io/client-go/rest" +) + +func WithMetrics(inner k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1.AdmissionregistrationV1alpha1Interface, metrics metrics.MetricsConfigManager, clientType metrics.ClientType) k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1.AdmissionregistrationV1alpha1Interface { + return &withMetrics{inner, metrics, clientType} +} + +func WithTracing(inner k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1.AdmissionregistrationV1alpha1Interface, client string) k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1.AdmissionregistrationV1alpha1Interface { + return &withTracing{inner, client} +} + +func WithLogging(inner k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1.AdmissionregistrationV1alpha1Interface, logger logr.Logger) k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1.AdmissionregistrationV1alpha1Interface { + return &withLogging{inner, logger} +} + +type withMetrics struct { + inner k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1.AdmissionregistrationV1alpha1Interface + metrics metrics.MetricsConfigManager + clientType metrics.ClientType +} + +func (c *withMetrics) RESTClient() rest.Interface { + return c.inner.RESTClient() +} +func (c *withMetrics) ValidatingAdmissionPolicies() k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1.ValidatingAdmissionPolicyInterface { + recorder := metrics.ClusteredClientQueryRecorder(c.metrics, "ValidatingAdmissionPolicy", c.clientType) + return validatingadmissionpolicies.WithMetrics(c.inner.ValidatingAdmissionPolicies(), recorder) +} +func (c *withMetrics) ValidatingAdmissionPolicyBindings() k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBindingInterface { + recorder := metrics.ClusteredClientQueryRecorder(c.metrics, "ValidatingAdmissionPolicyBinding", c.clientType) + return validatingadmissionpolicybindings.WithMetrics(c.inner.ValidatingAdmissionPolicyBindings(), recorder) +} + +type withTracing struct { + inner k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1.AdmissionregistrationV1alpha1Interface + client string +} + +func (c *withTracing) RESTClient() rest.Interface { + return c.inner.RESTClient() +} +func (c *withTracing) ValidatingAdmissionPolicies() k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1.ValidatingAdmissionPolicyInterface { + return validatingadmissionpolicies.WithTracing(c.inner.ValidatingAdmissionPolicies(), c.client, "ValidatingAdmissionPolicy") +} +func (c *withTracing) ValidatingAdmissionPolicyBindings() k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBindingInterface { + return validatingadmissionpolicybindings.WithTracing(c.inner.ValidatingAdmissionPolicyBindings(), c.client, "ValidatingAdmissionPolicyBinding") +} + +type withLogging struct { + inner k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1.AdmissionregistrationV1alpha1Interface + logger logr.Logger +} + +func (c *withLogging) RESTClient() rest.Interface { + return c.inner.RESTClient() +} +func (c *withLogging) ValidatingAdmissionPolicies() k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1.ValidatingAdmissionPolicyInterface { + return validatingadmissionpolicies.WithLogging(c.inner.ValidatingAdmissionPolicies(), c.logger.WithValues("resource", "ValidatingAdmissionPolicies")) +} +func (c *withLogging) ValidatingAdmissionPolicyBindings() k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBindingInterface { + return validatingadmissionpolicybindings.WithLogging(c.inner.ValidatingAdmissionPolicyBindings(), c.logger.WithValues("resource", "ValidatingAdmissionPolicyBindings")) +} diff --git a/pkg/clients/kube/admissionregistrationv1alpha1/validatingadmissionpolicies/resource.generated.go b/pkg/clients/kube/admissionregistrationv1alpha1/validatingadmissionpolicies/resource.generated.go new file mode 100644 index 0000000000..4d611164b9 --- /dev/null +++ b/pkg/clients/kube/admissionregistrationv1alpha1/validatingadmissionpolicies/resource.generated.go @@ -0,0 +1,374 @@ +package resource + +import ( + context "context" + "fmt" + "time" + + "github.com/go-logr/logr" + "github.com/kyverno/kyverno/pkg/metrics" + "github.com/kyverno/kyverno/pkg/tracing" + "go.opentelemetry.io/otel/trace" + "go.uber.org/multierr" + k8s_io_api_admissionregistration_v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" + k8s_io_apimachinery_pkg_apis_meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + k8s_io_apimachinery_pkg_types "k8s.io/apimachinery/pkg/types" + k8s_io_apimachinery_pkg_watch "k8s.io/apimachinery/pkg/watch" + k8s_io_client_go_applyconfigurations_admissionregistration_v1alpha1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1" + k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1" +) + +func WithLogging(inner k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1.ValidatingAdmissionPolicyInterface, logger logr.Logger) k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1.ValidatingAdmissionPolicyInterface { + return &withLogging{inner, logger} +} + +func WithMetrics(inner k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1.ValidatingAdmissionPolicyInterface, recorder metrics.Recorder) k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1.ValidatingAdmissionPolicyInterface { + return &withMetrics{inner, recorder} +} + +func WithTracing(inner k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1.ValidatingAdmissionPolicyInterface, client, kind string) k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1.ValidatingAdmissionPolicyInterface { + return &withTracing{inner, client, kind} +} + +type withLogging struct { + inner k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1.ValidatingAdmissionPolicyInterface + logger logr.Logger +} + +func (c *withLogging) Apply(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_admissionregistration_v1alpha1.ValidatingAdmissionPolicyApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicy, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Apply") + ret0, ret1 := c.inner.Apply(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Apply failed", "duration", time.Since(start)) + } else { + logger.Info("Apply done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) Create(arg0 context.Context, arg1 *k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicy, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Create") + ret0, ret1 := c.inner.Create(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Create failed", "duration", time.Since(start)) + } else { + logger.Info("Create done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error { + start := time.Now() + logger := c.logger.WithValues("operation", "Delete") + ret0 := c.inner.Delete(arg0, arg1, arg2) + if err := multierr.Combine(ret0); err != nil { + logger.Error(err, "Delete failed", "duration", time.Since(start)) + } else { + logger.Info("Delete done", "duration", time.Since(start)) + } + return ret0 +} +func (c *withLogging) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) error { + start := time.Now() + logger := c.logger.WithValues("operation", "DeleteCollection") + ret0 := c.inner.DeleteCollection(arg0, arg1, arg2) + if err := multierr.Combine(ret0); err != nil { + logger.Error(err, "DeleteCollection failed", "duration", time.Since(start)) + } else { + logger.Info("DeleteCollection done", "duration", time.Since(start)) + } + return ret0 +} +func (c *withLogging) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicy, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Get") + ret0, ret1 := c.inner.Get(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Get failed", "duration", time.Since(start)) + } else { + logger.Info("Get done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicyList, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "List") + ret0, ret1 := c.inner.List(arg0, arg1) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "List failed", "duration", time.Since(start)) + } else { + logger.Info("List done", "duration", time.Since(start)) + } + 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) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicy, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Patch") + ret0, ret1 := c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Patch failed", "duration", time.Since(start)) + } else { + logger.Info("Patch done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) Update(arg0 context.Context, arg1 *k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicy, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Update") + ret0, ret1 := c.inner.Update(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Update failed", "duration", time.Since(start)) + } else { + logger.Info("Update done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Watch") + ret0, ret1 := c.inner.Watch(arg0, arg1) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Watch failed", "duration", time.Since(start)) + } else { + logger.Info("Watch done", "duration", time.Since(start)) + } + return ret0, ret1 +} + +type withMetrics struct { + inner k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1.ValidatingAdmissionPolicyInterface + recorder metrics.Recorder +} + +func (c *withMetrics) Apply(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_admissionregistration_v1alpha1.ValidatingAdmissionPolicyApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicy, error) { + defer c.recorder.RecordWithContext(arg0, "apply") + return c.inner.Apply(arg0, arg1, arg2) +} +func (c *withMetrics) Create(arg0 context.Context, arg1 *k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicy, error) { + defer c.recorder.RecordWithContext(arg0, "create") + return c.inner.Create(arg0, arg1, arg2) +} +func (c *withMetrics) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error { + defer c.recorder.RecordWithContext(arg0, "delete") + return c.inner.Delete(arg0, arg1, arg2) +} +func (c *withMetrics) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) error { + defer c.recorder.RecordWithContext(arg0, "delete_collection") + 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) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicy, error) { + defer c.recorder.RecordWithContext(arg0, "get") + return c.inner.Get(arg0, arg1, arg2) +} +func (c *withMetrics) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicyList, error) { + defer c.recorder.RecordWithContext(arg0, "list") + 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) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicy, error) { + defer c.recorder.RecordWithContext(arg0, "patch") + return c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...) +} +func (c *withMetrics) Update(arg0 context.Context, arg1 *k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicy, error) { + defer c.recorder.RecordWithContext(arg0, "update") + return c.inner.Update(arg0, arg1, arg2) +} +func (c *withMetrics) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) { + defer c.recorder.RecordWithContext(arg0, "watch") + return c.inner.Watch(arg0, arg1) +} + +type withTracing struct { + inner k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1.ValidatingAdmissionPolicyInterface + client string + kind string +} + +func (c *withTracing) Apply(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_admissionregistration_v1alpha1.ValidatingAdmissionPolicyApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicy, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Apply"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Apply"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Apply(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) Create(arg0 context.Context, arg1 *k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicy, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Create"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Create"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Create(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Delete"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Delete"), + ), + ) + defer span.End() + } + ret0 := c.inner.Delete(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret0) + } + return ret0 +} +func (c *withTracing) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) error { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "DeleteCollection"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("DeleteCollection"), + ), + ) + defer span.End() + } + ret0 := c.inner.DeleteCollection(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret0) + } + return ret0 +} +func (c *withTracing) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicy, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Get"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Get"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Get(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicyList, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "List"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("List"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.List(arg0, arg1) + if span != nil { + tracing.SetSpanStatus(span, 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) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicy, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Patch"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Patch"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) Update(arg0 context.Context, arg1 *k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicy, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Update"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Update"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Update(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Watch"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Watch"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Watch(arg0, arg1) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} diff --git a/pkg/clients/kube/admissionregistrationv1alpha1/validatingadmissionpolicybindings/resource.generated.go b/pkg/clients/kube/admissionregistrationv1alpha1/validatingadmissionpolicybindings/resource.generated.go new file mode 100644 index 0000000000..8c38601c1e --- /dev/null +++ b/pkg/clients/kube/admissionregistrationv1alpha1/validatingadmissionpolicybindings/resource.generated.go @@ -0,0 +1,374 @@ +package resource + +import ( + context "context" + "fmt" + "time" + + "github.com/go-logr/logr" + "github.com/kyverno/kyverno/pkg/metrics" + "github.com/kyverno/kyverno/pkg/tracing" + "go.opentelemetry.io/otel/trace" + "go.uber.org/multierr" + k8s_io_api_admissionregistration_v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" + k8s_io_apimachinery_pkg_apis_meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + k8s_io_apimachinery_pkg_types "k8s.io/apimachinery/pkg/types" + k8s_io_apimachinery_pkg_watch "k8s.io/apimachinery/pkg/watch" + k8s_io_client_go_applyconfigurations_admissionregistration_v1alpha1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1" + k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1" +) + +func WithLogging(inner k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBindingInterface, logger logr.Logger) k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBindingInterface { + return &withLogging{inner, logger} +} + +func WithMetrics(inner k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBindingInterface, recorder metrics.Recorder) k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBindingInterface { + return &withMetrics{inner, recorder} +} + +func WithTracing(inner k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBindingInterface, client, kind string) k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBindingInterface { + return &withTracing{inner, client, kind} +} + +type withLogging struct { + inner k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBindingInterface + logger logr.Logger +} + +func (c *withLogging) Apply(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBindingApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBinding, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Apply") + ret0, ret1 := c.inner.Apply(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Apply failed", "duration", time.Since(start)) + } else { + logger.Info("Apply done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) Create(arg0 context.Context, arg1 *k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBinding, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBinding, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Create") + ret0, ret1 := c.inner.Create(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Create failed", "duration", time.Since(start)) + } else { + logger.Info("Create done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error { + start := time.Now() + logger := c.logger.WithValues("operation", "Delete") + ret0 := c.inner.Delete(arg0, arg1, arg2) + if err := multierr.Combine(ret0); err != nil { + logger.Error(err, "Delete failed", "duration", time.Since(start)) + } else { + logger.Info("Delete done", "duration", time.Since(start)) + } + return ret0 +} +func (c *withLogging) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) error { + start := time.Now() + logger := c.logger.WithValues("operation", "DeleteCollection") + ret0 := c.inner.DeleteCollection(arg0, arg1, arg2) + if err := multierr.Combine(ret0); err != nil { + logger.Error(err, "DeleteCollection failed", "duration", time.Since(start)) + } else { + logger.Info("DeleteCollection done", "duration", time.Since(start)) + } + return ret0 +} +func (c *withLogging) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBinding, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Get") + ret0, ret1 := c.inner.Get(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Get failed", "duration", time.Since(start)) + } else { + logger.Info("Get done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBindingList, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "List") + ret0, ret1 := c.inner.List(arg0, arg1) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "List failed", "duration", time.Since(start)) + } else { + logger.Info("List done", "duration", time.Since(start)) + } + 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) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBinding, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Patch") + ret0, ret1 := c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Patch failed", "duration", time.Since(start)) + } else { + logger.Info("Patch done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) Update(arg0 context.Context, arg1 *k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBinding, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBinding, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Update") + ret0, ret1 := c.inner.Update(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Update failed", "duration", time.Since(start)) + } else { + logger.Info("Update done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Watch") + ret0, ret1 := c.inner.Watch(arg0, arg1) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Watch failed", "duration", time.Since(start)) + } else { + logger.Info("Watch done", "duration", time.Since(start)) + } + return ret0, ret1 +} + +type withMetrics struct { + inner k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBindingInterface + recorder metrics.Recorder +} + +func (c *withMetrics) Apply(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBindingApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBinding, error) { + defer c.recorder.RecordWithContext(arg0, "apply") + return c.inner.Apply(arg0, arg1, arg2) +} +func (c *withMetrics) Create(arg0 context.Context, arg1 *k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBinding, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBinding, error) { + defer c.recorder.RecordWithContext(arg0, "create") + return c.inner.Create(arg0, arg1, arg2) +} +func (c *withMetrics) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error { + defer c.recorder.RecordWithContext(arg0, "delete") + return c.inner.Delete(arg0, arg1, arg2) +} +func (c *withMetrics) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) error { + defer c.recorder.RecordWithContext(arg0, "delete_collection") + 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) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBinding, error) { + defer c.recorder.RecordWithContext(arg0, "get") + return c.inner.Get(arg0, arg1, arg2) +} +func (c *withMetrics) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBindingList, error) { + defer c.recorder.RecordWithContext(arg0, "list") + 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) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBinding, error) { + defer c.recorder.RecordWithContext(arg0, "patch") + return c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...) +} +func (c *withMetrics) Update(arg0 context.Context, arg1 *k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBinding, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBinding, error) { + defer c.recorder.RecordWithContext(arg0, "update") + return c.inner.Update(arg0, arg1, arg2) +} +func (c *withMetrics) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) { + defer c.recorder.RecordWithContext(arg0, "watch") + return c.inner.Watch(arg0, arg1) +} + +type withTracing struct { + inner k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBindingInterface + client string + kind string +} + +func (c *withTracing) Apply(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBindingApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBinding, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Apply"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Apply"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Apply(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) Create(arg0 context.Context, arg1 *k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBinding, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBinding, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Create"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Create"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Create(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Delete"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Delete"), + ), + ) + defer span.End() + } + ret0 := c.inner.Delete(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret0) + } + return ret0 +} +func (c *withTracing) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) error { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "DeleteCollection"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("DeleteCollection"), + ), + ) + defer span.End() + } + ret0 := c.inner.DeleteCollection(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret0) + } + return ret0 +} +func (c *withTracing) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBinding, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Get"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Get"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Get(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBindingList, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "List"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("List"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.List(arg0, arg1) + if span != nil { + tracing.SetSpanStatus(span, 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) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBinding, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Patch"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Patch"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) Update(arg0 context.Context, arg1 *k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBinding, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_admissionregistration_v1alpha1.ValidatingAdmissionPolicyBinding, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Update"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Update"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Update(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Watch"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Watch"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Watch(arg0, arg1) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} diff --git a/pkg/clients/kube/authenticationv1alpha1/client.generated.go b/pkg/clients/kube/authenticationv1alpha1/client.generated.go new file mode 100644 index 0000000000..5c9c5df1b3 --- /dev/null +++ b/pkg/clients/kube/authenticationv1alpha1/client.generated.go @@ -0,0 +1,59 @@ +package client + +import ( + "github.com/go-logr/logr" + selfsubjectreviews "github.com/kyverno/kyverno/pkg/clients/kube/authenticationv1alpha1/selfsubjectreviews" + "github.com/kyverno/kyverno/pkg/metrics" + k8s_io_client_go_kubernetes_typed_authentication_v1alpha1 "k8s.io/client-go/kubernetes/typed/authentication/v1alpha1" + "k8s.io/client-go/rest" +) + +func WithMetrics(inner k8s_io_client_go_kubernetes_typed_authentication_v1alpha1.AuthenticationV1alpha1Interface, metrics metrics.MetricsConfigManager, clientType metrics.ClientType) k8s_io_client_go_kubernetes_typed_authentication_v1alpha1.AuthenticationV1alpha1Interface { + return &withMetrics{inner, metrics, clientType} +} + +func WithTracing(inner k8s_io_client_go_kubernetes_typed_authentication_v1alpha1.AuthenticationV1alpha1Interface, client string) k8s_io_client_go_kubernetes_typed_authentication_v1alpha1.AuthenticationV1alpha1Interface { + return &withTracing{inner, client} +} + +func WithLogging(inner k8s_io_client_go_kubernetes_typed_authentication_v1alpha1.AuthenticationV1alpha1Interface, logger logr.Logger) k8s_io_client_go_kubernetes_typed_authentication_v1alpha1.AuthenticationV1alpha1Interface { + return &withLogging{inner, logger} +} + +type withMetrics struct { + inner k8s_io_client_go_kubernetes_typed_authentication_v1alpha1.AuthenticationV1alpha1Interface + metrics metrics.MetricsConfigManager + clientType metrics.ClientType +} + +func (c *withMetrics) RESTClient() rest.Interface { + return c.inner.RESTClient() +} +func (c *withMetrics) SelfSubjectReviews() k8s_io_client_go_kubernetes_typed_authentication_v1alpha1.SelfSubjectReviewInterface { + recorder := metrics.ClusteredClientQueryRecorder(c.metrics, "SelfSubjectReview", c.clientType) + return selfsubjectreviews.WithMetrics(c.inner.SelfSubjectReviews(), recorder) +} + +type withTracing struct { + inner k8s_io_client_go_kubernetes_typed_authentication_v1alpha1.AuthenticationV1alpha1Interface + client string +} + +func (c *withTracing) RESTClient() rest.Interface { + return c.inner.RESTClient() +} +func (c *withTracing) SelfSubjectReviews() k8s_io_client_go_kubernetes_typed_authentication_v1alpha1.SelfSubjectReviewInterface { + return selfsubjectreviews.WithTracing(c.inner.SelfSubjectReviews(), c.client, "SelfSubjectReview") +} + +type withLogging struct { + inner k8s_io_client_go_kubernetes_typed_authentication_v1alpha1.AuthenticationV1alpha1Interface + logger logr.Logger +} + +func (c *withLogging) RESTClient() rest.Interface { + return c.inner.RESTClient() +} +func (c *withLogging) SelfSubjectReviews() k8s_io_client_go_kubernetes_typed_authentication_v1alpha1.SelfSubjectReviewInterface { + return selfsubjectreviews.WithLogging(c.inner.SelfSubjectReviews(), c.logger.WithValues("resource", "SelfSubjectReviews")) +} diff --git a/pkg/clients/kube/authenticationv1alpha1/selfsubjectreviews/resource.generated.go b/pkg/clients/kube/authenticationv1alpha1/selfsubjectreviews/resource.generated.go new file mode 100644 index 0000000000..dad3c32122 --- /dev/null +++ b/pkg/clients/kube/authenticationv1alpha1/selfsubjectreviews/resource.generated.go @@ -0,0 +1,83 @@ +package resource + +import ( + context "context" + "fmt" + "time" + + "github.com/go-logr/logr" + "github.com/kyverno/kyverno/pkg/metrics" + "github.com/kyverno/kyverno/pkg/tracing" + "go.opentelemetry.io/otel/trace" + "go.uber.org/multierr" + k8s_io_api_authentication_v1alpha1 "k8s.io/api/authentication/v1alpha1" + k8s_io_apimachinery_pkg_apis_meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + k8s_io_client_go_kubernetes_typed_authentication_v1alpha1 "k8s.io/client-go/kubernetes/typed/authentication/v1alpha1" +) + +func WithLogging(inner k8s_io_client_go_kubernetes_typed_authentication_v1alpha1.SelfSubjectReviewInterface, logger logr.Logger) k8s_io_client_go_kubernetes_typed_authentication_v1alpha1.SelfSubjectReviewInterface { + return &withLogging{inner, logger} +} + +func WithMetrics(inner k8s_io_client_go_kubernetes_typed_authentication_v1alpha1.SelfSubjectReviewInterface, recorder metrics.Recorder) k8s_io_client_go_kubernetes_typed_authentication_v1alpha1.SelfSubjectReviewInterface { + return &withMetrics{inner, recorder} +} + +func WithTracing(inner k8s_io_client_go_kubernetes_typed_authentication_v1alpha1.SelfSubjectReviewInterface, client, kind string) k8s_io_client_go_kubernetes_typed_authentication_v1alpha1.SelfSubjectReviewInterface { + return &withTracing{inner, client, kind} +} + +type withLogging struct { + inner k8s_io_client_go_kubernetes_typed_authentication_v1alpha1.SelfSubjectReviewInterface + logger logr.Logger +} + +func (c *withLogging) Create(arg0 context.Context, arg1 *k8s_io_api_authentication_v1alpha1.SelfSubjectReview, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*k8s_io_api_authentication_v1alpha1.SelfSubjectReview, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Create") + ret0, ret1 := c.inner.Create(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Create failed", "duration", time.Since(start)) + } else { + logger.Info("Create done", "duration", time.Since(start)) + } + return ret0, ret1 +} + +type withMetrics struct { + inner k8s_io_client_go_kubernetes_typed_authentication_v1alpha1.SelfSubjectReviewInterface + recorder metrics.Recorder +} + +func (c *withMetrics) Create(arg0 context.Context, arg1 *k8s_io_api_authentication_v1alpha1.SelfSubjectReview, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*k8s_io_api_authentication_v1alpha1.SelfSubjectReview, error) { + defer c.recorder.RecordWithContext(arg0, "create") + return c.inner.Create(arg0, arg1, arg2) +} + +type withTracing struct { + inner k8s_io_client_go_kubernetes_typed_authentication_v1alpha1.SelfSubjectReviewInterface + client string + kind string +} + +func (c *withTracing) Create(arg0 context.Context, arg1 *k8s_io_api_authentication_v1alpha1.SelfSubjectReview, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*k8s_io_api_authentication_v1alpha1.SelfSubjectReview, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Create"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Create"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Create(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} diff --git a/pkg/clients/kube/clientset.generated.go b/pkg/clients/kube/clientset.generated.go index eacb3d3fc8..de13fc1345 100644 --- a/pkg/clients/kube/clientset.generated.go +++ b/pkg/clients/kube/clientset.generated.go @@ -3,11 +3,13 @@ package clientset import ( "github.com/go-logr/logr" admissionregistrationv1 "github.com/kyverno/kyverno/pkg/clients/kube/admissionregistrationv1" + admissionregistrationv1alpha1 "github.com/kyverno/kyverno/pkg/clients/kube/admissionregistrationv1alpha1" admissionregistrationv1beta1 "github.com/kyverno/kyverno/pkg/clients/kube/admissionregistrationv1beta1" appsv1 "github.com/kyverno/kyverno/pkg/clients/kube/appsv1" appsv1beta1 "github.com/kyverno/kyverno/pkg/clients/kube/appsv1beta1" appsv1beta2 "github.com/kyverno/kyverno/pkg/clients/kube/appsv1beta2" authenticationv1 "github.com/kyverno/kyverno/pkg/clients/kube/authenticationv1" + authenticationv1alpha1 "github.com/kyverno/kyverno/pkg/clients/kube/authenticationv1alpha1" authenticationv1beta1 "github.com/kyverno/kyverno/pkg/clients/kube/authenticationv1beta1" authorizationv1 "github.com/kyverno/kyverno/pkg/clients/kube/authorizationv1" authorizationv1beta1 "github.com/kyverno/kyverno/pkg/clients/kube/authorizationv1beta1" @@ -31,6 +33,7 @@ import ( flowcontrolv1alpha1 "github.com/kyverno/kyverno/pkg/clients/kube/flowcontrolv1alpha1" flowcontrolv1beta1 "github.com/kyverno/kyverno/pkg/clients/kube/flowcontrolv1beta1" flowcontrolv1beta2 "github.com/kyverno/kyverno/pkg/clients/kube/flowcontrolv1beta2" + flowcontrolv1beta3 "github.com/kyverno/kyverno/pkg/clients/kube/flowcontrolv1beta3" internalv1alpha1 "github.com/kyverno/kyverno/pkg/clients/kube/internalv1alpha1" networkingv1 "github.com/kyverno/kyverno/pkg/clients/kube/networkingv1" networkingv1alpha1 "github.com/kyverno/kyverno/pkg/clients/kube/networkingv1alpha1" @@ -43,6 +46,7 @@ import ( rbacv1 "github.com/kyverno/kyverno/pkg/clients/kube/rbacv1" rbacv1alpha1 "github.com/kyverno/kyverno/pkg/clients/kube/rbacv1alpha1" rbacv1beta1 "github.com/kyverno/kyverno/pkg/clients/kube/rbacv1beta1" + resourcev1alpha1 "github.com/kyverno/kyverno/pkg/clients/kube/resourcev1alpha1" schedulingv1 "github.com/kyverno/kyverno/pkg/clients/kube/schedulingv1" schedulingv1alpha1 "github.com/kyverno/kyverno/pkg/clients/kube/schedulingv1alpha1" schedulingv1beta1 "github.com/kyverno/kyverno/pkg/clients/kube/schedulingv1beta1" @@ -53,12 +57,14 @@ import ( k8s_io_client_go_discovery "k8s.io/client-go/discovery" k8s_io_client_go_kubernetes "k8s.io/client-go/kubernetes" k8s_io_client_go_kubernetes_typed_admissionregistration_v1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1" + k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1" k8s_io_client_go_kubernetes_typed_admissionregistration_v1beta1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1" k8s_io_client_go_kubernetes_typed_apiserverinternal_v1alpha1 "k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1" k8s_io_client_go_kubernetes_typed_apps_v1 "k8s.io/client-go/kubernetes/typed/apps/v1" k8s_io_client_go_kubernetes_typed_apps_v1beta1 "k8s.io/client-go/kubernetes/typed/apps/v1beta1" k8s_io_client_go_kubernetes_typed_apps_v1beta2 "k8s.io/client-go/kubernetes/typed/apps/v1beta2" k8s_io_client_go_kubernetes_typed_authentication_v1 "k8s.io/client-go/kubernetes/typed/authentication/v1" + k8s_io_client_go_kubernetes_typed_authentication_v1alpha1 "k8s.io/client-go/kubernetes/typed/authentication/v1alpha1" k8s_io_client_go_kubernetes_typed_authentication_v1beta1 "k8s.io/client-go/kubernetes/typed/authentication/v1beta1" k8s_io_client_go_kubernetes_typed_authorization_v1 "k8s.io/client-go/kubernetes/typed/authorization/v1" k8s_io_client_go_kubernetes_typed_authorization_v1beta1 "k8s.io/client-go/kubernetes/typed/authorization/v1beta1" @@ -81,6 +87,7 @@ import ( k8s_io_client_go_kubernetes_typed_flowcontrol_v1alpha1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1" k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1" k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta2 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2" + k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3" k8s_io_client_go_kubernetes_typed_networking_v1 "k8s.io/client-go/kubernetes/typed/networking/v1" k8s_io_client_go_kubernetes_typed_networking_v1alpha1 "k8s.io/client-go/kubernetes/typed/networking/v1alpha1" k8s_io_client_go_kubernetes_typed_networking_v1beta1 "k8s.io/client-go/kubernetes/typed/networking/v1beta1" @@ -92,6 +99,7 @@ import ( k8s_io_client_go_kubernetes_typed_rbac_v1 "k8s.io/client-go/kubernetes/typed/rbac/v1" k8s_io_client_go_kubernetes_typed_rbac_v1alpha1 "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1" k8s_io_client_go_kubernetes_typed_rbac_v1beta1 "k8s.io/client-go/kubernetes/typed/rbac/v1beta1" + k8s_io_client_go_kubernetes_typed_resource_v1alpha1 "k8s.io/client-go/kubernetes/typed/resource/v1alpha1" k8s_io_client_go_kubernetes_typed_scheduling_v1 "k8s.io/client-go/kubernetes/typed/scheduling/v1" k8s_io_client_go_kubernetes_typed_scheduling_v1alpha1 "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1" k8s_io_client_go_kubernetes_typed_scheduling_v1beta1 "k8s.io/client-go/kubernetes/typed/scheduling/v1beta1" @@ -101,53 +109,57 @@ import ( ) type clientset struct { - discovery k8s_io_client_go_discovery.DiscoveryInterface - admissionregistrationv1 k8s_io_client_go_kubernetes_typed_admissionregistration_v1.AdmissionregistrationV1Interface - admissionregistrationv1beta1 k8s_io_client_go_kubernetes_typed_admissionregistration_v1beta1.AdmissionregistrationV1beta1Interface - appsv1 k8s_io_client_go_kubernetes_typed_apps_v1.AppsV1Interface - appsv1beta1 k8s_io_client_go_kubernetes_typed_apps_v1beta1.AppsV1beta1Interface - appsv1beta2 k8s_io_client_go_kubernetes_typed_apps_v1beta2.AppsV1beta2Interface - authenticationv1 k8s_io_client_go_kubernetes_typed_authentication_v1.AuthenticationV1Interface - authenticationv1beta1 k8s_io_client_go_kubernetes_typed_authentication_v1beta1.AuthenticationV1beta1Interface - authorizationv1 k8s_io_client_go_kubernetes_typed_authorization_v1.AuthorizationV1Interface - authorizationv1beta1 k8s_io_client_go_kubernetes_typed_authorization_v1beta1.AuthorizationV1beta1Interface - autoscalingv1 k8s_io_client_go_kubernetes_typed_autoscaling_v1.AutoscalingV1Interface - autoscalingv2 k8s_io_client_go_kubernetes_typed_autoscaling_v2.AutoscalingV2Interface - autoscalingv2beta1 k8s_io_client_go_kubernetes_typed_autoscaling_v2beta1.AutoscalingV2beta1Interface - autoscalingv2beta2 k8s_io_client_go_kubernetes_typed_autoscaling_v2beta2.AutoscalingV2beta2Interface - batchv1 k8s_io_client_go_kubernetes_typed_batch_v1.BatchV1Interface - batchv1beta1 k8s_io_client_go_kubernetes_typed_batch_v1beta1.BatchV1beta1Interface - certificatesv1 k8s_io_client_go_kubernetes_typed_certificates_v1.CertificatesV1Interface - certificatesv1beta1 k8s_io_client_go_kubernetes_typed_certificates_v1beta1.CertificatesV1beta1Interface - coordinationv1 k8s_io_client_go_kubernetes_typed_coordination_v1.CoordinationV1Interface - coordinationv1beta1 k8s_io_client_go_kubernetes_typed_coordination_v1beta1.CoordinationV1beta1Interface - corev1 k8s_io_client_go_kubernetes_typed_core_v1.CoreV1Interface - discoveryv1 k8s_io_client_go_kubernetes_typed_discovery_v1.DiscoveryV1Interface - discoveryv1beta1 k8s_io_client_go_kubernetes_typed_discovery_v1beta1.DiscoveryV1beta1Interface - eventsv1 k8s_io_client_go_kubernetes_typed_events_v1.EventsV1Interface - eventsv1beta1 k8s_io_client_go_kubernetes_typed_events_v1beta1.EventsV1beta1Interface - extensionsv1beta1 k8s_io_client_go_kubernetes_typed_extensions_v1beta1.ExtensionsV1beta1Interface - flowcontrolv1alpha1 k8s_io_client_go_kubernetes_typed_flowcontrol_v1alpha1.FlowcontrolV1alpha1Interface - flowcontrolv1beta1 k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta1.FlowcontrolV1beta1Interface - flowcontrolv1beta2 k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta2.FlowcontrolV1beta2Interface - internalv1alpha1 k8s_io_client_go_kubernetes_typed_apiserverinternal_v1alpha1.InternalV1alpha1Interface - networkingv1 k8s_io_client_go_kubernetes_typed_networking_v1.NetworkingV1Interface - networkingv1alpha1 k8s_io_client_go_kubernetes_typed_networking_v1alpha1.NetworkingV1alpha1Interface - networkingv1beta1 k8s_io_client_go_kubernetes_typed_networking_v1beta1.NetworkingV1beta1Interface - nodev1 k8s_io_client_go_kubernetes_typed_node_v1.NodeV1Interface - nodev1alpha1 k8s_io_client_go_kubernetes_typed_node_v1alpha1.NodeV1alpha1Interface - nodev1beta1 k8s_io_client_go_kubernetes_typed_node_v1beta1.NodeV1beta1Interface - policyv1 k8s_io_client_go_kubernetes_typed_policy_v1.PolicyV1Interface - policyv1beta1 k8s_io_client_go_kubernetes_typed_policy_v1beta1.PolicyV1beta1Interface - rbacv1 k8s_io_client_go_kubernetes_typed_rbac_v1.RbacV1Interface - rbacv1alpha1 k8s_io_client_go_kubernetes_typed_rbac_v1alpha1.RbacV1alpha1Interface - rbacv1beta1 k8s_io_client_go_kubernetes_typed_rbac_v1beta1.RbacV1beta1Interface - schedulingv1 k8s_io_client_go_kubernetes_typed_scheduling_v1.SchedulingV1Interface - schedulingv1alpha1 k8s_io_client_go_kubernetes_typed_scheduling_v1alpha1.SchedulingV1alpha1Interface - schedulingv1beta1 k8s_io_client_go_kubernetes_typed_scheduling_v1beta1.SchedulingV1beta1Interface - storagev1 k8s_io_client_go_kubernetes_typed_storage_v1.StorageV1Interface - storagev1alpha1 k8s_io_client_go_kubernetes_typed_storage_v1alpha1.StorageV1alpha1Interface - storagev1beta1 k8s_io_client_go_kubernetes_typed_storage_v1beta1.StorageV1beta1Interface + discovery k8s_io_client_go_discovery.DiscoveryInterface + admissionregistrationv1 k8s_io_client_go_kubernetes_typed_admissionregistration_v1.AdmissionregistrationV1Interface + admissionregistrationv1alpha1 k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1.AdmissionregistrationV1alpha1Interface + admissionregistrationv1beta1 k8s_io_client_go_kubernetes_typed_admissionregistration_v1beta1.AdmissionregistrationV1beta1Interface + appsv1 k8s_io_client_go_kubernetes_typed_apps_v1.AppsV1Interface + appsv1beta1 k8s_io_client_go_kubernetes_typed_apps_v1beta1.AppsV1beta1Interface + appsv1beta2 k8s_io_client_go_kubernetes_typed_apps_v1beta2.AppsV1beta2Interface + authenticationv1 k8s_io_client_go_kubernetes_typed_authentication_v1.AuthenticationV1Interface + authenticationv1alpha1 k8s_io_client_go_kubernetes_typed_authentication_v1alpha1.AuthenticationV1alpha1Interface + authenticationv1beta1 k8s_io_client_go_kubernetes_typed_authentication_v1beta1.AuthenticationV1beta1Interface + authorizationv1 k8s_io_client_go_kubernetes_typed_authorization_v1.AuthorizationV1Interface + authorizationv1beta1 k8s_io_client_go_kubernetes_typed_authorization_v1beta1.AuthorizationV1beta1Interface + autoscalingv1 k8s_io_client_go_kubernetes_typed_autoscaling_v1.AutoscalingV1Interface + autoscalingv2 k8s_io_client_go_kubernetes_typed_autoscaling_v2.AutoscalingV2Interface + autoscalingv2beta1 k8s_io_client_go_kubernetes_typed_autoscaling_v2beta1.AutoscalingV2beta1Interface + autoscalingv2beta2 k8s_io_client_go_kubernetes_typed_autoscaling_v2beta2.AutoscalingV2beta2Interface + batchv1 k8s_io_client_go_kubernetes_typed_batch_v1.BatchV1Interface + batchv1beta1 k8s_io_client_go_kubernetes_typed_batch_v1beta1.BatchV1beta1Interface + certificatesv1 k8s_io_client_go_kubernetes_typed_certificates_v1.CertificatesV1Interface + certificatesv1beta1 k8s_io_client_go_kubernetes_typed_certificates_v1beta1.CertificatesV1beta1Interface + coordinationv1 k8s_io_client_go_kubernetes_typed_coordination_v1.CoordinationV1Interface + coordinationv1beta1 k8s_io_client_go_kubernetes_typed_coordination_v1beta1.CoordinationV1beta1Interface + corev1 k8s_io_client_go_kubernetes_typed_core_v1.CoreV1Interface + discoveryv1 k8s_io_client_go_kubernetes_typed_discovery_v1.DiscoveryV1Interface + discoveryv1beta1 k8s_io_client_go_kubernetes_typed_discovery_v1beta1.DiscoveryV1beta1Interface + eventsv1 k8s_io_client_go_kubernetes_typed_events_v1.EventsV1Interface + eventsv1beta1 k8s_io_client_go_kubernetes_typed_events_v1beta1.EventsV1beta1Interface + extensionsv1beta1 k8s_io_client_go_kubernetes_typed_extensions_v1beta1.ExtensionsV1beta1Interface + flowcontrolv1alpha1 k8s_io_client_go_kubernetes_typed_flowcontrol_v1alpha1.FlowcontrolV1alpha1Interface + flowcontrolv1beta1 k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta1.FlowcontrolV1beta1Interface + flowcontrolv1beta2 k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta2.FlowcontrolV1beta2Interface + flowcontrolv1beta3 k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3.FlowcontrolV1beta3Interface + internalv1alpha1 k8s_io_client_go_kubernetes_typed_apiserverinternal_v1alpha1.InternalV1alpha1Interface + networkingv1 k8s_io_client_go_kubernetes_typed_networking_v1.NetworkingV1Interface + networkingv1alpha1 k8s_io_client_go_kubernetes_typed_networking_v1alpha1.NetworkingV1alpha1Interface + networkingv1beta1 k8s_io_client_go_kubernetes_typed_networking_v1beta1.NetworkingV1beta1Interface + nodev1 k8s_io_client_go_kubernetes_typed_node_v1.NodeV1Interface + nodev1alpha1 k8s_io_client_go_kubernetes_typed_node_v1alpha1.NodeV1alpha1Interface + nodev1beta1 k8s_io_client_go_kubernetes_typed_node_v1beta1.NodeV1beta1Interface + policyv1 k8s_io_client_go_kubernetes_typed_policy_v1.PolicyV1Interface + policyv1beta1 k8s_io_client_go_kubernetes_typed_policy_v1beta1.PolicyV1beta1Interface + rbacv1 k8s_io_client_go_kubernetes_typed_rbac_v1.RbacV1Interface + rbacv1alpha1 k8s_io_client_go_kubernetes_typed_rbac_v1alpha1.RbacV1alpha1Interface + rbacv1beta1 k8s_io_client_go_kubernetes_typed_rbac_v1beta1.RbacV1beta1Interface + resourcev1alpha1 k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceV1alpha1Interface + schedulingv1 k8s_io_client_go_kubernetes_typed_scheduling_v1.SchedulingV1Interface + schedulingv1alpha1 k8s_io_client_go_kubernetes_typed_scheduling_v1alpha1.SchedulingV1alpha1Interface + schedulingv1beta1 k8s_io_client_go_kubernetes_typed_scheduling_v1beta1.SchedulingV1beta1Interface + storagev1 k8s_io_client_go_kubernetes_typed_storage_v1.StorageV1Interface + storagev1alpha1 k8s_io_client_go_kubernetes_typed_storage_v1alpha1.StorageV1alpha1Interface + storagev1beta1 k8s_io_client_go_kubernetes_typed_storage_v1beta1.StorageV1beta1Interface } func (c *clientset) Discovery() k8s_io_client_go_discovery.DiscoveryInterface { @@ -156,6 +168,9 @@ func (c *clientset) Discovery() k8s_io_client_go_discovery.DiscoveryInterface { func (c *clientset) AdmissionregistrationV1() k8s_io_client_go_kubernetes_typed_admissionregistration_v1.AdmissionregistrationV1Interface { return c.admissionregistrationv1 } +func (c *clientset) AdmissionregistrationV1alpha1() k8s_io_client_go_kubernetes_typed_admissionregistration_v1alpha1.AdmissionregistrationV1alpha1Interface { + return c.admissionregistrationv1alpha1 +} func (c *clientset) AdmissionregistrationV1beta1() k8s_io_client_go_kubernetes_typed_admissionregistration_v1beta1.AdmissionregistrationV1beta1Interface { return c.admissionregistrationv1beta1 } @@ -171,6 +186,9 @@ func (c *clientset) AppsV1beta2() k8s_io_client_go_kubernetes_typed_apps_v1beta2 func (c *clientset) AuthenticationV1() k8s_io_client_go_kubernetes_typed_authentication_v1.AuthenticationV1Interface { return c.authenticationv1 } +func (c *clientset) AuthenticationV1alpha1() k8s_io_client_go_kubernetes_typed_authentication_v1alpha1.AuthenticationV1alpha1Interface { + return c.authenticationv1alpha1 +} func (c *clientset) AuthenticationV1beta1() k8s_io_client_go_kubernetes_typed_authentication_v1beta1.AuthenticationV1beta1Interface { return c.authenticationv1beta1 } @@ -237,6 +255,9 @@ func (c *clientset) FlowcontrolV1beta1() k8s_io_client_go_kubernetes_typed_flowc func (c *clientset) FlowcontrolV1beta2() k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta2.FlowcontrolV1beta2Interface { return c.flowcontrolv1beta2 } +func (c *clientset) FlowcontrolV1beta3() k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3.FlowcontrolV1beta3Interface { + return c.flowcontrolv1beta3 +} func (c *clientset) InternalV1alpha1() k8s_io_client_go_kubernetes_typed_apiserverinternal_v1alpha1.InternalV1alpha1Interface { return c.internalv1alpha1 } @@ -273,6 +294,9 @@ func (c *clientset) RbacV1alpha1() k8s_io_client_go_kubernetes_typed_rbac_v1alph func (c *clientset) RbacV1beta1() k8s_io_client_go_kubernetes_typed_rbac_v1beta1.RbacV1beta1Interface { return c.rbacv1beta1 } +func (c *clientset) ResourceV1alpha1() k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceV1alpha1Interface { + return c.resourcev1alpha1 +} func (c *clientset) SchedulingV1() k8s_io_client_go_kubernetes_typed_scheduling_v1.SchedulingV1Interface { return c.schedulingv1 } @@ -294,156 +318,168 @@ func (c *clientset) StorageV1beta1() k8s_io_client_go_kubernetes_typed_storage_v func WrapWithMetrics(inner k8s_io_client_go_kubernetes.Interface, m metrics.MetricsConfigManager, clientType metrics.ClientType) k8s_io_client_go_kubernetes.Interface { return &clientset{ - discovery: discovery.WithMetrics(inner.Discovery(), metrics.ClusteredClientQueryRecorder(m, "Discovery", clientType)), - admissionregistrationv1: admissionregistrationv1.WithMetrics(inner.AdmissionregistrationV1(), m, clientType), - admissionregistrationv1beta1: admissionregistrationv1beta1.WithMetrics(inner.AdmissionregistrationV1beta1(), m, clientType), - appsv1: appsv1.WithMetrics(inner.AppsV1(), m, clientType), - appsv1beta1: appsv1beta1.WithMetrics(inner.AppsV1beta1(), m, clientType), - appsv1beta2: appsv1beta2.WithMetrics(inner.AppsV1beta2(), m, clientType), - authenticationv1: authenticationv1.WithMetrics(inner.AuthenticationV1(), m, clientType), - authenticationv1beta1: authenticationv1beta1.WithMetrics(inner.AuthenticationV1beta1(), m, clientType), - authorizationv1: authorizationv1.WithMetrics(inner.AuthorizationV1(), m, clientType), - authorizationv1beta1: authorizationv1beta1.WithMetrics(inner.AuthorizationV1beta1(), m, clientType), - autoscalingv1: autoscalingv1.WithMetrics(inner.AutoscalingV1(), m, clientType), - autoscalingv2: autoscalingv2.WithMetrics(inner.AutoscalingV2(), m, clientType), - autoscalingv2beta1: autoscalingv2beta1.WithMetrics(inner.AutoscalingV2beta1(), m, clientType), - autoscalingv2beta2: autoscalingv2beta2.WithMetrics(inner.AutoscalingV2beta2(), m, clientType), - batchv1: batchv1.WithMetrics(inner.BatchV1(), m, clientType), - batchv1beta1: batchv1beta1.WithMetrics(inner.BatchV1beta1(), m, clientType), - certificatesv1: certificatesv1.WithMetrics(inner.CertificatesV1(), m, clientType), - certificatesv1beta1: certificatesv1beta1.WithMetrics(inner.CertificatesV1beta1(), m, clientType), - coordinationv1: coordinationv1.WithMetrics(inner.CoordinationV1(), m, clientType), - coordinationv1beta1: coordinationv1beta1.WithMetrics(inner.CoordinationV1beta1(), m, clientType), - corev1: corev1.WithMetrics(inner.CoreV1(), m, clientType), - discoveryv1: discoveryv1.WithMetrics(inner.DiscoveryV1(), m, clientType), - discoveryv1beta1: discoveryv1beta1.WithMetrics(inner.DiscoveryV1beta1(), m, clientType), - eventsv1: eventsv1.WithMetrics(inner.EventsV1(), m, clientType), - eventsv1beta1: eventsv1beta1.WithMetrics(inner.EventsV1beta1(), m, clientType), - extensionsv1beta1: extensionsv1beta1.WithMetrics(inner.ExtensionsV1beta1(), m, clientType), - flowcontrolv1alpha1: flowcontrolv1alpha1.WithMetrics(inner.FlowcontrolV1alpha1(), m, clientType), - flowcontrolv1beta1: flowcontrolv1beta1.WithMetrics(inner.FlowcontrolV1beta1(), m, clientType), - flowcontrolv1beta2: flowcontrolv1beta2.WithMetrics(inner.FlowcontrolV1beta2(), m, clientType), - internalv1alpha1: internalv1alpha1.WithMetrics(inner.InternalV1alpha1(), m, clientType), - networkingv1: networkingv1.WithMetrics(inner.NetworkingV1(), m, clientType), - networkingv1alpha1: networkingv1alpha1.WithMetrics(inner.NetworkingV1alpha1(), m, clientType), - networkingv1beta1: networkingv1beta1.WithMetrics(inner.NetworkingV1beta1(), m, clientType), - nodev1: nodev1.WithMetrics(inner.NodeV1(), m, clientType), - nodev1alpha1: nodev1alpha1.WithMetrics(inner.NodeV1alpha1(), m, clientType), - nodev1beta1: nodev1beta1.WithMetrics(inner.NodeV1beta1(), m, clientType), - policyv1: policyv1.WithMetrics(inner.PolicyV1(), m, clientType), - policyv1beta1: policyv1beta1.WithMetrics(inner.PolicyV1beta1(), m, clientType), - rbacv1: rbacv1.WithMetrics(inner.RbacV1(), m, clientType), - rbacv1alpha1: rbacv1alpha1.WithMetrics(inner.RbacV1alpha1(), m, clientType), - rbacv1beta1: rbacv1beta1.WithMetrics(inner.RbacV1beta1(), m, clientType), - schedulingv1: schedulingv1.WithMetrics(inner.SchedulingV1(), m, clientType), - schedulingv1alpha1: schedulingv1alpha1.WithMetrics(inner.SchedulingV1alpha1(), m, clientType), - schedulingv1beta1: schedulingv1beta1.WithMetrics(inner.SchedulingV1beta1(), m, clientType), - storagev1: storagev1.WithMetrics(inner.StorageV1(), m, clientType), - storagev1alpha1: storagev1alpha1.WithMetrics(inner.StorageV1alpha1(), m, clientType), - storagev1beta1: storagev1beta1.WithMetrics(inner.StorageV1beta1(), m, clientType), + discovery: discovery.WithMetrics(inner.Discovery(), metrics.ClusteredClientQueryRecorder(m, "Discovery", clientType)), + admissionregistrationv1: admissionregistrationv1.WithMetrics(inner.AdmissionregistrationV1(), m, clientType), + admissionregistrationv1alpha1: admissionregistrationv1alpha1.WithMetrics(inner.AdmissionregistrationV1alpha1(), m, clientType), + admissionregistrationv1beta1: admissionregistrationv1beta1.WithMetrics(inner.AdmissionregistrationV1beta1(), m, clientType), + appsv1: appsv1.WithMetrics(inner.AppsV1(), m, clientType), + appsv1beta1: appsv1beta1.WithMetrics(inner.AppsV1beta1(), m, clientType), + appsv1beta2: appsv1beta2.WithMetrics(inner.AppsV1beta2(), m, clientType), + authenticationv1: authenticationv1.WithMetrics(inner.AuthenticationV1(), m, clientType), + authenticationv1alpha1: authenticationv1alpha1.WithMetrics(inner.AuthenticationV1alpha1(), m, clientType), + authenticationv1beta1: authenticationv1beta1.WithMetrics(inner.AuthenticationV1beta1(), m, clientType), + authorizationv1: authorizationv1.WithMetrics(inner.AuthorizationV1(), m, clientType), + authorizationv1beta1: authorizationv1beta1.WithMetrics(inner.AuthorizationV1beta1(), m, clientType), + autoscalingv1: autoscalingv1.WithMetrics(inner.AutoscalingV1(), m, clientType), + autoscalingv2: autoscalingv2.WithMetrics(inner.AutoscalingV2(), m, clientType), + autoscalingv2beta1: autoscalingv2beta1.WithMetrics(inner.AutoscalingV2beta1(), m, clientType), + autoscalingv2beta2: autoscalingv2beta2.WithMetrics(inner.AutoscalingV2beta2(), m, clientType), + batchv1: batchv1.WithMetrics(inner.BatchV1(), m, clientType), + batchv1beta1: batchv1beta1.WithMetrics(inner.BatchV1beta1(), m, clientType), + certificatesv1: certificatesv1.WithMetrics(inner.CertificatesV1(), m, clientType), + certificatesv1beta1: certificatesv1beta1.WithMetrics(inner.CertificatesV1beta1(), m, clientType), + coordinationv1: coordinationv1.WithMetrics(inner.CoordinationV1(), m, clientType), + coordinationv1beta1: coordinationv1beta1.WithMetrics(inner.CoordinationV1beta1(), m, clientType), + corev1: corev1.WithMetrics(inner.CoreV1(), m, clientType), + discoveryv1: discoveryv1.WithMetrics(inner.DiscoveryV1(), m, clientType), + discoveryv1beta1: discoveryv1beta1.WithMetrics(inner.DiscoveryV1beta1(), m, clientType), + eventsv1: eventsv1.WithMetrics(inner.EventsV1(), m, clientType), + eventsv1beta1: eventsv1beta1.WithMetrics(inner.EventsV1beta1(), m, clientType), + extensionsv1beta1: extensionsv1beta1.WithMetrics(inner.ExtensionsV1beta1(), m, clientType), + flowcontrolv1alpha1: flowcontrolv1alpha1.WithMetrics(inner.FlowcontrolV1alpha1(), m, clientType), + flowcontrolv1beta1: flowcontrolv1beta1.WithMetrics(inner.FlowcontrolV1beta1(), m, clientType), + flowcontrolv1beta2: flowcontrolv1beta2.WithMetrics(inner.FlowcontrolV1beta2(), m, clientType), + flowcontrolv1beta3: flowcontrolv1beta3.WithMetrics(inner.FlowcontrolV1beta3(), m, clientType), + internalv1alpha1: internalv1alpha1.WithMetrics(inner.InternalV1alpha1(), m, clientType), + networkingv1: networkingv1.WithMetrics(inner.NetworkingV1(), m, clientType), + networkingv1alpha1: networkingv1alpha1.WithMetrics(inner.NetworkingV1alpha1(), m, clientType), + networkingv1beta1: networkingv1beta1.WithMetrics(inner.NetworkingV1beta1(), m, clientType), + nodev1: nodev1.WithMetrics(inner.NodeV1(), m, clientType), + nodev1alpha1: nodev1alpha1.WithMetrics(inner.NodeV1alpha1(), m, clientType), + nodev1beta1: nodev1beta1.WithMetrics(inner.NodeV1beta1(), m, clientType), + policyv1: policyv1.WithMetrics(inner.PolicyV1(), m, clientType), + policyv1beta1: policyv1beta1.WithMetrics(inner.PolicyV1beta1(), m, clientType), + rbacv1: rbacv1.WithMetrics(inner.RbacV1(), m, clientType), + rbacv1alpha1: rbacv1alpha1.WithMetrics(inner.RbacV1alpha1(), m, clientType), + rbacv1beta1: rbacv1beta1.WithMetrics(inner.RbacV1beta1(), m, clientType), + resourcev1alpha1: resourcev1alpha1.WithMetrics(inner.ResourceV1alpha1(), m, clientType), + schedulingv1: schedulingv1.WithMetrics(inner.SchedulingV1(), m, clientType), + schedulingv1alpha1: schedulingv1alpha1.WithMetrics(inner.SchedulingV1alpha1(), m, clientType), + schedulingv1beta1: schedulingv1beta1.WithMetrics(inner.SchedulingV1beta1(), m, clientType), + storagev1: storagev1.WithMetrics(inner.StorageV1(), m, clientType), + storagev1alpha1: storagev1alpha1.WithMetrics(inner.StorageV1alpha1(), m, clientType), + storagev1beta1: storagev1beta1.WithMetrics(inner.StorageV1beta1(), m, clientType), } } func WrapWithTracing(inner k8s_io_client_go_kubernetes.Interface) k8s_io_client_go_kubernetes.Interface { return &clientset{ - discovery: discovery.WithTracing(inner.Discovery(), "Discovery", ""), - admissionregistrationv1: admissionregistrationv1.WithTracing(inner.AdmissionregistrationV1(), "AdmissionregistrationV1"), - admissionregistrationv1beta1: admissionregistrationv1beta1.WithTracing(inner.AdmissionregistrationV1beta1(), "AdmissionregistrationV1beta1"), - appsv1: appsv1.WithTracing(inner.AppsV1(), "AppsV1"), - appsv1beta1: appsv1beta1.WithTracing(inner.AppsV1beta1(), "AppsV1beta1"), - appsv1beta2: appsv1beta2.WithTracing(inner.AppsV1beta2(), "AppsV1beta2"), - authenticationv1: authenticationv1.WithTracing(inner.AuthenticationV1(), "AuthenticationV1"), - authenticationv1beta1: authenticationv1beta1.WithTracing(inner.AuthenticationV1beta1(), "AuthenticationV1beta1"), - authorizationv1: authorizationv1.WithTracing(inner.AuthorizationV1(), "AuthorizationV1"), - authorizationv1beta1: authorizationv1beta1.WithTracing(inner.AuthorizationV1beta1(), "AuthorizationV1beta1"), - autoscalingv1: autoscalingv1.WithTracing(inner.AutoscalingV1(), "AutoscalingV1"), - autoscalingv2: autoscalingv2.WithTracing(inner.AutoscalingV2(), "AutoscalingV2"), - autoscalingv2beta1: autoscalingv2beta1.WithTracing(inner.AutoscalingV2beta1(), "AutoscalingV2beta1"), - autoscalingv2beta2: autoscalingv2beta2.WithTracing(inner.AutoscalingV2beta2(), "AutoscalingV2beta2"), - batchv1: batchv1.WithTracing(inner.BatchV1(), "BatchV1"), - batchv1beta1: batchv1beta1.WithTracing(inner.BatchV1beta1(), "BatchV1beta1"), - certificatesv1: certificatesv1.WithTracing(inner.CertificatesV1(), "CertificatesV1"), - certificatesv1beta1: certificatesv1beta1.WithTracing(inner.CertificatesV1beta1(), "CertificatesV1beta1"), - coordinationv1: coordinationv1.WithTracing(inner.CoordinationV1(), "CoordinationV1"), - coordinationv1beta1: coordinationv1beta1.WithTracing(inner.CoordinationV1beta1(), "CoordinationV1beta1"), - corev1: corev1.WithTracing(inner.CoreV1(), "CoreV1"), - discoveryv1: discoveryv1.WithTracing(inner.DiscoveryV1(), "DiscoveryV1"), - discoveryv1beta1: discoveryv1beta1.WithTracing(inner.DiscoveryV1beta1(), "DiscoveryV1beta1"), - eventsv1: eventsv1.WithTracing(inner.EventsV1(), "EventsV1"), - eventsv1beta1: eventsv1beta1.WithTracing(inner.EventsV1beta1(), "EventsV1beta1"), - extensionsv1beta1: extensionsv1beta1.WithTracing(inner.ExtensionsV1beta1(), "ExtensionsV1beta1"), - flowcontrolv1alpha1: flowcontrolv1alpha1.WithTracing(inner.FlowcontrolV1alpha1(), "FlowcontrolV1alpha1"), - flowcontrolv1beta1: flowcontrolv1beta1.WithTracing(inner.FlowcontrolV1beta1(), "FlowcontrolV1beta1"), - flowcontrolv1beta2: flowcontrolv1beta2.WithTracing(inner.FlowcontrolV1beta2(), "FlowcontrolV1beta2"), - internalv1alpha1: internalv1alpha1.WithTracing(inner.InternalV1alpha1(), "InternalV1alpha1"), - networkingv1: networkingv1.WithTracing(inner.NetworkingV1(), "NetworkingV1"), - networkingv1alpha1: networkingv1alpha1.WithTracing(inner.NetworkingV1alpha1(), "NetworkingV1alpha1"), - networkingv1beta1: networkingv1beta1.WithTracing(inner.NetworkingV1beta1(), "NetworkingV1beta1"), - nodev1: nodev1.WithTracing(inner.NodeV1(), "NodeV1"), - nodev1alpha1: nodev1alpha1.WithTracing(inner.NodeV1alpha1(), "NodeV1alpha1"), - nodev1beta1: nodev1beta1.WithTracing(inner.NodeV1beta1(), "NodeV1beta1"), - policyv1: policyv1.WithTracing(inner.PolicyV1(), "PolicyV1"), - policyv1beta1: policyv1beta1.WithTracing(inner.PolicyV1beta1(), "PolicyV1beta1"), - rbacv1: rbacv1.WithTracing(inner.RbacV1(), "RbacV1"), - rbacv1alpha1: rbacv1alpha1.WithTracing(inner.RbacV1alpha1(), "RbacV1alpha1"), - rbacv1beta1: rbacv1beta1.WithTracing(inner.RbacV1beta1(), "RbacV1beta1"), - schedulingv1: schedulingv1.WithTracing(inner.SchedulingV1(), "SchedulingV1"), - schedulingv1alpha1: schedulingv1alpha1.WithTracing(inner.SchedulingV1alpha1(), "SchedulingV1alpha1"), - schedulingv1beta1: schedulingv1beta1.WithTracing(inner.SchedulingV1beta1(), "SchedulingV1beta1"), - storagev1: storagev1.WithTracing(inner.StorageV1(), "StorageV1"), - storagev1alpha1: storagev1alpha1.WithTracing(inner.StorageV1alpha1(), "StorageV1alpha1"), - storagev1beta1: storagev1beta1.WithTracing(inner.StorageV1beta1(), "StorageV1beta1"), + discovery: discovery.WithTracing(inner.Discovery(), "Discovery", ""), + admissionregistrationv1: admissionregistrationv1.WithTracing(inner.AdmissionregistrationV1(), "AdmissionregistrationV1"), + admissionregistrationv1alpha1: admissionregistrationv1alpha1.WithTracing(inner.AdmissionregistrationV1alpha1(), "AdmissionregistrationV1alpha1"), + admissionregistrationv1beta1: admissionregistrationv1beta1.WithTracing(inner.AdmissionregistrationV1beta1(), "AdmissionregistrationV1beta1"), + appsv1: appsv1.WithTracing(inner.AppsV1(), "AppsV1"), + appsv1beta1: appsv1beta1.WithTracing(inner.AppsV1beta1(), "AppsV1beta1"), + appsv1beta2: appsv1beta2.WithTracing(inner.AppsV1beta2(), "AppsV1beta2"), + authenticationv1: authenticationv1.WithTracing(inner.AuthenticationV1(), "AuthenticationV1"), + authenticationv1alpha1: authenticationv1alpha1.WithTracing(inner.AuthenticationV1alpha1(), "AuthenticationV1alpha1"), + authenticationv1beta1: authenticationv1beta1.WithTracing(inner.AuthenticationV1beta1(), "AuthenticationV1beta1"), + authorizationv1: authorizationv1.WithTracing(inner.AuthorizationV1(), "AuthorizationV1"), + authorizationv1beta1: authorizationv1beta1.WithTracing(inner.AuthorizationV1beta1(), "AuthorizationV1beta1"), + autoscalingv1: autoscalingv1.WithTracing(inner.AutoscalingV1(), "AutoscalingV1"), + autoscalingv2: autoscalingv2.WithTracing(inner.AutoscalingV2(), "AutoscalingV2"), + autoscalingv2beta1: autoscalingv2beta1.WithTracing(inner.AutoscalingV2beta1(), "AutoscalingV2beta1"), + autoscalingv2beta2: autoscalingv2beta2.WithTracing(inner.AutoscalingV2beta2(), "AutoscalingV2beta2"), + batchv1: batchv1.WithTracing(inner.BatchV1(), "BatchV1"), + batchv1beta1: batchv1beta1.WithTracing(inner.BatchV1beta1(), "BatchV1beta1"), + certificatesv1: certificatesv1.WithTracing(inner.CertificatesV1(), "CertificatesV1"), + certificatesv1beta1: certificatesv1beta1.WithTracing(inner.CertificatesV1beta1(), "CertificatesV1beta1"), + coordinationv1: coordinationv1.WithTracing(inner.CoordinationV1(), "CoordinationV1"), + coordinationv1beta1: coordinationv1beta1.WithTracing(inner.CoordinationV1beta1(), "CoordinationV1beta1"), + corev1: corev1.WithTracing(inner.CoreV1(), "CoreV1"), + discoveryv1: discoveryv1.WithTracing(inner.DiscoveryV1(), "DiscoveryV1"), + discoveryv1beta1: discoveryv1beta1.WithTracing(inner.DiscoveryV1beta1(), "DiscoveryV1beta1"), + eventsv1: eventsv1.WithTracing(inner.EventsV1(), "EventsV1"), + eventsv1beta1: eventsv1beta1.WithTracing(inner.EventsV1beta1(), "EventsV1beta1"), + extensionsv1beta1: extensionsv1beta1.WithTracing(inner.ExtensionsV1beta1(), "ExtensionsV1beta1"), + flowcontrolv1alpha1: flowcontrolv1alpha1.WithTracing(inner.FlowcontrolV1alpha1(), "FlowcontrolV1alpha1"), + flowcontrolv1beta1: flowcontrolv1beta1.WithTracing(inner.FlowcontrolV1beta1(), "FlowcontrolV1beta1"), + flowcontrolv1beta2: flowcontrolv1beta2.WithTracing(inner.FlowcontrolV1beta2(), "FlowcontrolV1beta2"), + flowcontrolv1beta3: flowcontrolv1beta3.WithTracing(inner.FlowcontrolV1beta3(), "FlowcontrolV1beta3"), + internalv1alpha1: internalv1alpha1.WithTracing(inner.InternalV1alpha1(), "InternalV1alpha1"), + networkingv1: networkingv1.WithTracing(inner.NetworkingV1(), "NetworkingV1"), + networkingv1alpha1: networkingv1alpha1.WithTracing(inner.NetworkingV1alpha1(), "NetworkingV1alpha1"), + networkingv1beta1: networkingv1beta1.WithTracing(inner.NetworkingV1beta1(), "NetworkingV1beta1"), + nodev1: nodev1.WithTracing(inner.NodeV1(), "NodeV1"), + nodev1alpha1: nodev1alpha1.WithTracing(inner.NodeV1alpha1(), "NodeV1alpha1"), + nodev1beta1: nodev1beta1.WithTracing(inner.NodeV1beta1(), "NodeV1beta1"), + policyv1: policyv1.WithTracing(inner.PolicyV1(), "PolicyV1"), + policyv1beta1: policyv1beta1.WithTracing(inner.PolicyV1beta1(), "PolicyV1beta1"), + rbacv1: rbacv1.WithTracing(inner.RbacV1(), "RbacV1"), + rbacv1alpha1: rbacv1alpha1.WithTracing(inner.RbacV1alpha1(), "RbacV1alpha1"), + rbacv1beta1: rbacv1beta1.WithTracing(inner.RbacV1beta1(), "RbacV1beta1"), + resourcev1alpha1: resourcev1alpha1.WithTracing(inner.ResourceV1alpha1(), "ResourceV1alpha1"), + schedulingv1: schedulingv1.WithTracing(inner.SchedulingV1(), "SchedulingV1"), + schedulingv1alpha1: schedulingv1alpha1.WithTracing(inner.SchedulingV1alpha1(), "SchedulingV1alpha1"), + schedulingv1beta1: schedulingv1beta1.WithTracing(inner.SchedulingV1beta1(), "SchedulingV1beta1"), + storagev1: storagev1.WithTracing(inner.StorageV1(), "StorageV1"), + storagev1alpha1: storagev1alpha1.WithTracing(inner.StorageV1alpha1(), "StorageV1alpha1"), + storagev1beta1: storagev1beta1.WithTracing(inner.StorageV1beta1(), "StorageV1beta1"), } } func WrapWithLogging(inner k8s_io_client_go_kubernetes.Interface, logger logr.Logger) k8s_io_client_go_kubernetes.Interface { return &clientset{ - discovery: discovery.WithLogging(inner.Discovery(), logger.WithValues("group", "Discovery")), - admissionregistrationv1: admissionregistrationv1.WithLogging(inner.AdmissionregistrationV1(), logger.WithValues("group", "AdmissionregistrationV1")), - admissionregistrationv1beta1: admissionregistrationv1beta1.WithLogging(inner.AdmissionregistrationV1beta1(), logger.WithValues("group", "AdmissionregistrationV1beta1")), - appsv1: appsv1.WithLogging(inner.AppsV1(), logger.WithValues("group", "AppsV1")), - appsv1beta1: appsv1beta1.WithLogging(inner.AppsV1beta1(), logger.WithValues("group", "AppsV1beta1")), - appsv1beta2: appsv1beta2.WithLogging(inner.AppsV1beta2(), logger.WithValues("group", "AppsV1beta2")), - authenticationv1: authenticationv1.WithLogging(inner.AuthenticationV1(), logger.WithValues("group", "AuthenticationV1")), - authenticationv1beta1: authenticationv1beta1.WithLogging(inner.AuthenticationV1beta1(), logger.WithValues("group", "AuthenticationV1beta1")), - authorizationv1: authorizationv1.WithLogging(inner.AuthorizationV1(), logger.WithValues("group", "AuthorizationV1")), - authorizationv1beta1: authorizationv1beta1.WithLogging(inner.AuthorizationV1beta1(), logger.WithValues("group", "AuthorizationV1beta1")), - autoscalingv1: autoscalingv1.WithLogging(inner.AutoscalingV1(), logger.WithValues("group", "AutoscalingV1")), - autoscalingv2: autoscalingv2.WithLogging(inner.AutoscalingV2(), logger.WithValues("group", "AutoscalingV2")), - autoscalingv2beta1: autoscalingv2beta1.WithLogging(inner.AutoscalingV2beta1(), logger.WithValues("group", "AutoscalingV2beta1")), - autoscalingv2beta2: autoscalingv2beta2.WithLogging(inner.AutoscalingV2beta2(), logger.WithValues("group", "AutoscalingV2beta2")), - batchv1: batchv1.WithLogging(inner.BatchV1(), logger.WithValues("group", "BatchV1")), - batchv1beta1: batchv1beta1.WithLogging(inner.BatchV1beta1(), logger.WithValues("group", "BatchV1beta1")), - certificatesv1: certificatesv1.WithLogging(inner.CertificatesV1(), logger.WithValues("group", "CertificatesV1")), - certificatesv1beta1: certificatesv1beta1.WithLogging(inner.CertificatesV1beta1(), logger.WithValues("group", "CertificatesV1beta1")), - coordinationv1: coordinationv1.WithLogging(inner.CoordinationV1(), logger.WithValues("group", "CoordinationV1")), - coordinationv1beta1: coordinationv1beta1.WithLogging(inner.CoordinationV1beta1(), logger.WithValues("group", "CoordinationV1beta1")), - corev1: corev1.WithLogging(inner.CoreV1(), logger.WithValues("group", "CoreV1")), - discoveryv1: discoveryv1.WithLogging(inner.DiscoveryV1(), logger.WithValues("group", "DiscoveryV1")), - discoveryv1beta1: discoveryv1beta1.WithLogging(inner.DiscoveryV1beta1(), logger.WithValues("group", "DiscoveryV1beta1")), - eventsv1: eventsv1.WithLogging(inner.EventsV1(), logger.WithValues("group", "EventsV1")), - eventsv1beta1: eventsv1beta1.WithLogging(inner.EventsV1beta1(), logger.WithValues("group", "EventsV1beta1")), - extensionsv1beta1: extensionsv1beta1.WithLogging(inner.ExtensionsV1beta1(), logger.WithValues("group", "ExtensionsV1beta1")), - flowcontrolv1alpha1: flowcontrolv1alpha1.WithLogging(inner.FlowcontrolV1alpha1(), logger.WithValues("group", "FlowcontrolV1alpha1")), - flowcontrolv1beta1: flowcontrolv1beta1.WithLogging(inner.FlowcontrolV1beta1(), logger.WithValues("group", "FlowcontrolV1beta1")), - flowcontrolv1beta2: flowcontrolv1beta2.WithLogging(inner.FlowcontrolV1beta2(), logger.WithValues("group", "FlowcontrolV1beta2")), - internalv1alpha1: internalv1alpha1.WithLogging(inner.InternalV1alpha1(), logger.WithValues("group", "InternalV1alpha1")), - networkingv1: networkingv1.WithLogging(inner.NetworkingV1(), logger.WithValues("group", "NetworkingV1")), - networkingv1alpha1: networkingv1alpha1.WithLogging(inner.NetworkingV1alpha1(), logger.WithValues("group", "NetworkingV1alpha1")), - networkingv1beta1: networkingv1beta1.WithLogging(inner.NetworkingV1beta1(), logger.WithValues("group", "NetworkingV1beta1")), - nodev1: nodev1.WithLogging(inner.NodeV1(), logger.WithValues("group", "NodeV1")), - nodev1alpha1: nodev1alpha1.WithLogging(inner.NodeV1alpha1(), logger.WithValues("group", "NodeV1alpha1")), - nodev1beta1: nodev1beta1.WithLogging(inner.NodeV1beta1(), logger.WithValues("group", "NodeV1beta1")), - policyv1: policyv1.WithLogging(inner.PolicyV1(), logger.WithValues("group", "PolicyV1")), - policyv1beta1: policyv1beta1.WithLogging(inner.PolicyV1beta1(), logger.WithValues("group", "PolicyV1beta1")), - rbacv1: rbacv1.WithLogging(inner.RbacV1(), logger.WithValues("group", "RbacV1")), - rbacv1alpha1: rbacv1alpha1.WithLogging(inner.RbacV1alpha1(), logger.WithValues("group", "RbacV1alpha1")), - rbacv1beta1: rbacv1beta1.WithLogging(inner.RbacV1beta1(), logger.WithValues("group", "RbacV1beta1")), - schedulingv1: schedulingv1.WithLogging(inner.SchedulingV1(), logger.WithValues("group", "SchedulingV1")), - schedulingv1alpha1: schedulingv1alpha1.WithLogging(inner.SchedulingV1alpha1(), logger.WithValues("group", "SchedulingV1alpha1")), - schedulingv1beta1: schedulingv1beta1.WithLogging(inner.SchedulingV1beta1(), logger.WithValues("group", "SchedulingV1beta1")), - storagev1: storagev1.WithLogging(inner.StorageV1(), logger.WithValues("group", "StorageV1")), - storagev1alpha1: storagev1alpha1.WithLogging(inner.StorageV1alpha1(), logger.WithValues("group", "StorageV1alpha1")), - storagev1beta1: storagev1beta1.WithLogging(inner.StorageV1beta1(), logger.WithValues("group", "StorageV1beta1")), + discovery: discovery.WithLogging(inner.Discovery(), logger.WithValues("group", "Discovery")), + admissionregistrationv1: admissionregistrationv1.WithLogging(inner.AdmissionregistrationV1(), logger.WithValues("group", "AdmissionregistrationV1")), + admissionregistrationv1alpha1: admissionregistrationv1alpha1.WithLogging(inner.AdmissionregistrationV1alpha1(), logger.WithValues("group", "AdmissionregistrationV1alpha1")), + admissionregistrationv1beta1: admissionregistrationv1beta1.WithLogging(inner.AdmissionregistrationV1beta1(), logger.WithValues("group", "AdmissionregistrationV1beta1")), + appsv1: appsv1.WithLogging(inner.AppsV1(), logger.WithValues("group", "AppsV1")), + appsv1beta1: appsv1beta1.WithLogging(inner.AppsV1beta1(), logger.WithValues("group", "AppsV1beta1")), + appsv1beta2: appsv1beta2.WithLogging(inner.AppsV1beta2(), logger.WithValues("group", "AppsV1beta2")), + authenticationv1: authenticationv1.WithLogging(inner.AuthenticationV1(), logger.WithValues("group", "AuthenticationV1")), + authenticationv1alpha1: authenticationv1alpha1.WithLogging(inner.AuthenticationV1alpha1(), logger.WithValues("group", "AuthenticationV1alpha1")), + authenticationv1beta1: authenticationv1beta1.WithLogging(inner.AuthenticationV1beta1(), logger.WithValues("group", "AuthenticationV1beta1")), + authorizationv1: authorizationv1.WithLogging(inner.AuthorizationV1(), logger.WithValues("group", "AuthorizationV1")), + authorizationv1beta1: authorizationv1beta1.WithLogging(inner.AuthorizationV1beta1(), logger.WithValues("group", "AuthorizationV1beta1")), + autoscalingv1: autoscalingv1.WithLogging(inner.AutoscalingV1(), logger.WithValues("group", "AutoscalingV1")), + autoscalingv2: autoscalingv2.WithLogging(inner.AutoscalingV2(), logger.WithValues("group", "AutoscalingV2")), + autoscalingv2beta1: autoscalingv2beta1.WithLogging(inner.AutoscalingV2beta1(), logger.WithValues("group", "AutoscalingV2beta1")), + autoscalingv2beta2: autoscalingv2beta2.WithLogging(inner.AutoscalingV2beta2(), logger.WithValues("group", "AutoscalingV2beta2")), + batchv1: batchv1.WithLogging(inner.BatchV1(), logger.WithValues("group", "BatchV1")), + batchv1beta1: batchv1beta1.WithLogging(inner.BatchV1beta1(), logger.WithValues("group", "BatchV1beta1")), + certificatesv1: certificatesv1.WithLogging(inner.CertificatesV1(), logger.WithValues("group", "CertificatesV1")), + certificatesv1beta1: certificatesv1beta1.WithLogging(inner.CertificatesV1beta1(), logger.WithValues("group", "CertificatesV1beta1")), + coordinationv1: coordinationv1.WithLogging(inner.CoordinationV1(), logger.WithValues("group", "CoordinationV1")), + coordinationv1beta1: coordinationv1beta1.WithLogging(inner.CoordinationV1beta1(), logger.WithValues("group", "CoordinationV1beta1")), + corev1: corev1.WithLogging(inner.CoreV1(), logger.WithValues("group", "CoreV1")), + discoveryv1: discoveryv1.WithLogging(inner.DiscoveryV1(), logger.WithValues("group", "DiscoveryV1")), + discoveryv1beta1: discoveryv1beta1.WithLogging(inner.DiscoveryV1beta1(), logger.WithValues("group", "DiscoveryV1beta1")), + eventsv1: eventsv1.WithLogging(inner.EventsV1(), logger.WithValues("group", "EventsV1")), + eventsv1beta1: eventsv1beta1.WithLogging(inner.EventsV1beta1(), logger.WithValues("group", "EventsV1beta1")), + extensionsv1beta1: extensionsv1beta1.WithLogging(inner.ExtensionsV1beta1(), logger.WithValues("group", "ExtensionsV1beta1")), + flowcontrolv1alpha1: flowcontrolv1alpha1.WithLogging(inner.FlowcontrolV1alpha1(), logger.WithValues("group", "FlowcontrolV1alpha1")), + flowcontrolv1beta1: flowcontrolv1beta1.WithLogging(inner.FlowcontrolV1beta1(), logger.WithValues("group", "FlowcontrolV1beta1")), + flowcontrolv1beta2: flowcontrolv1beta2.WithLogging(inner.FlowcontrolV1beta2(), logger.WithValues("group", "FlowcontrolV1beta2")), + flowcontrolv1beta3: flowcontrolv1beta3.WithLogging(inner.FlowcontrolV1beta3(), logger.WithValues("group", "FlowcontrolV1beta3")), + internalv1alpha1: internalv1alpha1.WithLogging(inner.InternalV1alpha1(), logger.WithValues("group", "InternalV1alpha1")), + networkingv1: networkingv1.WithLogging(inner.NetworkingV1(), logger.WithValues("group", "NetworkingV1")), + networkingv1alpha1: networkingv1alpha1.WithLogging(inner.NetworkingV1alpha1(), logger.WithValues("group", "NetworkingV1alpha1")), + networkingv1beta1: networkingv1beta1.WithLogging(inner.NetworkingV1beta1(), logger.WithValues("group", "NetworkingV1beta1")), + nodev1: nodev1.WithLogging(inner.NodeV1(), logger.WithValues("group", "NodeV1")), + nodev1alpha1: nodev1alpha1.WithLogging(inner.NodeV1alpha1(), logger.WithValues("group", "NodeV1alpha1")), + nodev1beta1: nodev1beta1.WithLogging(inner.NodeV1beta1(), logger.WithValues("group", "NodeV1beta1")), + policyv1: policyv1.WithLogging(inner.PolicyV1(), logger.WithValues("group", "PolicyV1")), + policyv1beta1: policyv1beta1.WithLogging(inner.PolicyV1beta1(), logger.WithValues("group", "PolicyV1beta1")), + rbacv1: rbacv1.WithLogging(inner.RbacV1(), logger.WithValues("group", "RbacV1")), + rbacv1alpha1: rbacv1alpha1.WithLogging(inner.RbacV1alpha1(), logger.WithValues("group", "RbacV1alpha1")), + rbacv1beta1: rbacv1beta1.WithLogging(inner.RbacV1beta1(), logger.WithValues("group", "RbacV1beta1")), + resourcev1alpha1: resourcev1alpha1.WithLogging(inner.ResourceV1alpha1(), logger.WithValues("group", "ResourceV1alpha1")), + schedulingv1: schedulingv1.WithLogging(inner.SchedulingV1(), logger.WithValues("group", "SchedulingV1")), + schedulingv1alpha1: schedulingv1alpha1.WithLogging(inner.SchedulingV1alpha1(), logger.WithValues("group", "SchedulingV1alpha1")), + schedulingv1beta1: schedulingv1beta1.WithLogging(inner.SchedulingV1beta1(), logger.WithValues("group", "SchedulingV1beta1")), + storagev1: storagev1.WithLogging(inner.StorageV1(), logger.WithValues("group", "StorageV1")), + storagev1alpha1: storagev1alpha1.WithLogging(inner.StorageV1alpha1(), logger.WithValues("group", "StorageV1alpha1")), + storagev1beta1: storagev1beta1.WithLogging(inner.StorageV1beta1(), logger.WithValues("group", "StorageV1beta1")), } } diff --git a/pkg/clients/kube/discovery/resource.generated.go b/pkg/clients/kube/discovery/resource.generated.go index 95f17a290e..fa3e8de23e 100644 --- a/pkg/clients/kube/discovery/resource.generated.go +++ b/pkg/clients/kube/discovery/resource.generated.go @@ -122,6 +122,13 @@ func (c *withLogging) ServerVersion() (*k8s_io_apimachinery_pkg_version.Info, er } return ret0, ret1 } +func (c *withLogging) WithLegacy() k8s_io_client_go_discovery.DiscoveryInterface { + start := time.Now() + logger := c.logger.WithValues("operation", "WithLegacy") + ret0 := c.inner.WithLegacy() + logger.Info("WithLegacy done", "duration", time.Since(start)) + return ret0 +} type withMetrics struct { inner k8s_io_client_go_discovery.DiscoveryInterface @@ -164,6 +171,10 @@ func (c *withMetrics) ServerVersion() (*k8s_io_apimachinery_pkg_version.Info, er defer c.recorder.Record("server_version") return c.inner.ServerVersion() } +func (c *withMetrics) WithLegacy() k8s_io_client_go_discovery.DiscoveryInterface { + defer c.recorder.Record("with_legacy") + return c.inner.WithLegacy() +} type withTracing struct { inner k8s_io_client_go_discovery.DiscoveryInterface @@ -198,3 +209,6 @@ func (c *withTracing) ServerResourcesForGroupVersion(arg0 string) (*k8s_io_apima func (c *withTracing) ServerVersion() (*k8s_io_apimachinery_pkg_version.Info, error) { return c.inner.ServerVersion() } +func (c *withTracing) WithLegacy() k8s_io_client_go_discovery.DiscoveryInterface { + return c.inner.WithLegacy() +} diff --git a/pkg/clients/kube/flowcontrolv1beta3/client.generated.go b/pkg/clients/kube/flowcontrolv1beta3/client.generated.go new file mode 100644 index 0000000000..a0be5332c0 --- /dev/null +++ b/pkg/clients/kube/flowcontrolv1beta3/client.generated.go @@ -0,0 +1,70 @@ +package client + +import ( + "github.com/go-logr/logr" + flowschemas "github.com/kyverno/kyverno/pkg/clients/kube/flowcontrolv1beta3/flowschemas" + prioritylevelconfigurations "github.com/kyverno/kyverno/pkg/clients/kube/flowcontrolv1beta3/prioritylevelconfigurations" + "github.com/kyverno/kyverno/pkg/metrics" + k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3" + "k8s.io/client-go/rest" +) + +func WithMetrics(inner k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3.FlowcontrolV1beta3Interface, metrics metrics.MetricsConfigManager, clientType metrics.ClientType) k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3.FlowcontrolV1beta3Interface { + return &withMetrics{inner, metrics, clientType} +} + +func WithTracing(inner k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3.FlowcontrolV1beta3Interface, client string) k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3.FlowcontrolV1beta3Interface { + return &withTracing{inner, client} +} + +func WithLogging(inner k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3.FlowcontrolV1beta3Interface, logger logr.Logger) k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3.FlowcontrolV1beta3Interface { + return &withLogging{inner, logger} +} + +type withMetrics struct { + inner k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3.FlowcontrolV1beta3Interface + metrics metrics.MetricsConfigManager + clientType metrics.ClientType +} + +func (c *withMetrics) RESTClient() rest.Interface { + return c.inner.RESTClient() +} +func (c *withMetrics) FlowSchemas() k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3.FlowSchemaInterface { + recorder := metrics.ClusteredClientQueryRecorder(c.metrics, "FlowSchema", c.clientType) + return flowschemas.WithMetrics(c.inner.FlowSchemas(), recorder) +} +func (c *withMetrics) PriorityLevelConfigurations() k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3.PriorityLevelConfigurationInterface { + recorder := metrics.ClusteredClientQueryRecorder(c.metrics, "PriorityLevelConfiguration", c.clientType) + return prioritylevelconfigurations.WithMetrics(c.inner.PriorityLevelConfigurations(), recorder) +} + +type withTracing struct { + inner k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3.FlowcontrolV1beta3Interface + client string +} + +func (c *withTracing) RESTClient() rest.Interface { + return c.inner.RESTClient() +} +func (c *withTracing) FlowSchemas() k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3.FlowSchemaInterface { + return flowschemas.WithTracing(c.inner.FlowSchemas(), c.client, "FlowSchema") +} +func (c *withTracing) PriorityLevelConfigurations() k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3.PriorityLevelConfigurationInterface { + return prioritylevelconfigurations.WithTracing(c.inner.PriorityLevelConfigurations(), c.client, "PriorityLevelConfiguration") +} + +type withLogging struct { + inner k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3.FlowcontrolV1beta3Interface + logger logr.Logger +} + +func (c *withLogging) RESTClient() rest.Interface { + return c.inner.RESTClient() +} +func (c *withLogging) FlowSchemas() k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3.FlowSchemaInterface { + return flowschemas.WithLogging(c.inner.FlowSchemas(), c.logger.WithValues("resource", "FlowSchemas")) +} +func (c *withLogging) PriorityLevelConfigurations() k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3.PriorityLevelConfigurationInterface { + return prioritylevelconfigurations.WithLogging(c.inner.PriorityLevelConfigurations(), c.logger.WithValues("resource", "PriorityLevelConfigurations")) +} diff --git a/pkg/clients/kube/flowcontrolv1beta3/flowschemas/resource.generated.go b/pkg/clients/kube/flowcontrolv1beta3/flowschemas/resource.generated.go new file mode 100644 index 0000000000..45cd7eb136 --- /dev/null +++ b/pkg/clients/kube/flowcontrolv1beta3/flowschemas/resource.generated.go @@ -0,0 +1,446 @@ +package resource + +import ( + context "context" + "fmt" + "time" + + "github.com/go-logr/logr" + "github.com/kyverno/kyverno/pkg/metrics" + "github.com/kyverno/kyverno/pkg/tracing" + "go.opentelemetry.io/otel/trace" + "go.uber.org/multierr" + k8s_io_api_flowcontrol_v1beta3 "k8s.io/api/flowcontrol/v1beta3" + k8s_io_apimachinery_pkg_apis_meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + k8s_io_apimachinery_pkg_types "k8s.io/apimachinery/pkg/types" + k8s_io_apimachinery_pkg_watch "k8s.io/apimachinery/pkg/watch" + k8s_io_client_go_applyconfigurations_flowcontrol_v1beta3 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3" + k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3" +) + +func WithLogging(inner k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3.FlowSchemaInterface, logger logr.Logger) k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3.FlowSchemaInterface { + return &withLogging{inner, logger} +} + +func WithMetrics(inner k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3.FlowSchemaInterface, recorder metrics.Recorder) k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3.FlowSchemaInterface { + return &withMetrics{inner, recorder} +} + +func WithTracing(inner k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3.FlowSchemaInterface, client, kind string) k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3.FlowSchemaInterface { + return &withTracing{inner, client, kind} +} + +type withLogging struct { + inner k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3.FlowSchemaInterface + logger logr.Logger +} + +func (c *withLogging) Apply(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_flowcontrol_v1beta3.FlowSchemaApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_flowcontrol_v1beta3.FlowSchema, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Apply") + ret0, ret1 := c.inner.Apply(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Apply failed", "duration", time.Since(start)) + } else { + logger.Info("Apply done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) ApplyStatus(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_flowcontrol_v1beta3.FlowSchemaApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_flowcontrol_v1beta3.FlowSchema, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "ApplyStatus") + ret0, ret1 := c.inner.ApplyStatus(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "ApplyStatus failed", "duration", time.Since(start)) + } else { + logger.Info("ApplyStatus done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) Create(arg0 context.Context, arg1 *k8s_io_api_flowcontrol_v1beta3.FlowSchema, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*k8s_io_api_flowcontrol_v1beta3.FlowSchema, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Create") + ret0, ret1 := c.inner.Create(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Create failed", "duration", time.Since(start)) + } else { + logger.Info("Create done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error { + start := time.Now() + logger := c.logger.WithValues("operation", "Delete") + ret0 := c.inner.Delete(arg0, arg1, arg2) + if err := multierr.Combine(ret0); err != nil { + logger.Error(err, "Delete failed", "duration", time.Since(start)) + } else { + logger.Info("Delete done", "duration", time.Since(start)) + } + return ret0 +} +func (c *withLogging) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) error { + start := time.Now() + logger := c.logger.WithValues("operation", "DeleteCollection") + ret0 := c.inner.DeleteCollection(arg0, arg1, arg2) + if err := multierr.Combine(ret0); err != nil { + logger.Error(err, "DeleteCollection failed", "duration", time.Since(start)) + } else { + logger.Info("DeleteCollection done", "duration", time.Since(start)) + } + return ret0 +} +func (c *withLogging) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*k8s_io_api_flowcontrol_v1beta3.FlowSchema, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Get") + ret0, ret1 := c.inner.Get(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Get failed", "duration", time.Since(start)) + } else { + logger.Info("Get done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*k8s_io_api_flowcontrol_v1beta3.FlowSchemaList, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "List") + ret0, ret1 := c.inner.List(arg0, arg1) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "List failed", "duration", time.Since(start)) + } else { + logger.Info("List done", "duration", time.Since(start)) + } + 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) (*k8s_io_api_flowcontrol_v1beta3.FlowSchema, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Patch") + ret0, ret1 := c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Patch failed", "duration", time.Since(start)) + } else { + logger.Info("Patch done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) Update(arg0 context.Context, arg1 *k8s_io_api_flowcontrol_v1beta3.FlowSchema, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_flowcontrol_v1beta3.FlowSchema, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Update") + ret0, ret1 := c.inner.Update(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Update failed", "duration", time.Since(start)) + } else { + logger.Info("Update done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) UpdateStatus(arg0 context.Context, arg1 *k8s_io_api_flowcontrol_v1beta3.FlowSchema, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_flowcontrol_v1beta3.FlowSchema, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "UpdateStatus") + ret0, ret1 := c.inner.UpdateStatus(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "UpdateStatus failed", "duration", time.Since(start)) + } else { + logger.Info("UpdateStatus done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Watch") + ret0, ret1 := c.inner.Watch(arg0, arg1) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Watch failed", "duration", time.Since(start)) + } else { + logger.Info("Watch done", "duration", time.Since(start)) + } + return ret0, ret1 +} + +type withMetrics struct { + inner k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3.FlowSchemaInterface + recorder metrics.Recorder +} + +func (c *withMetrics) Apply(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_flowcontrol_v1beta3.FlowSchemaApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_flowcontrol_v1beta3.FlowSchema, error) { + defer c.recorder.RecordWithContext(arg0, "apply") + return c.inner.Apply(arg0, arg1, arg2) +} +func (c *withMetrics) ApplyStatus(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_flowcontrol_v1beta3.FlowSchemaApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_flowcontrol_v1beta3.FlowSchema, error) { + defer c.recorder.RecordWithContext(arg0, "apply_status") + return c.inner.ApplyStatus(arg0, arg1, arg2) +} +func (c *withMetrics) Create(arg0 context.Context, arg1 *k8s_io_api_flowcontrol_v1beta3.FlowSchema, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*k8s_io_api_flowcontrol_v1beta3.FlowSchema, error) { + defer c.recorder.RecordWithContext(arg0, "create") + return c.inner.Create(arg0, arg1, arg2) +} +func (c *withMetrics) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error { + defer c.recorder.RecordWithContext(arg0, "delete") + return c.inner.Delete(arg0, arg1, arg2) +} +func (c *withMetrics) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) error { + defer c.recorder.RecordWithContext(arg0, "delete_collection") + 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) (*k8s_io_api_flowcontrol_v1beta3.FlowSchema, error) { + defer c.recorder.RecordWithContext(arg0, "get") + return c.inner.Get(arg0, arg1, arg2) +} +func (c *withMetrics) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*k8s_io_api_flowcontrol_v1beta3.FlowSchemaList, error) { + defer c.recorder.RecordWithContext(arg0, "list") + 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) (*k8s_io_api_flowcontrol_v1beta3.FlowSchema, error) { + defer c.recorder.RecordWithContext(arg0, "patch") + return c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...) +} +func (c *withMetrics) Update(arg0 context.Context, arg1 *k8s_io_api_flowcontrol_v1beta3.FlowSchema, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_flowcontrol_v1beta3.FlowSchema, error) { + defer c.recorder.RecordWithContext(arg0, "update") + return c.inner.Update(arg0, arg1, arg2) +} +func (c *withMetrics) UpdateStatus(arg0 context.Context, arg1 *k8s_io_api_flowcontrol_v1beta3.FlowSchema, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_flowcontrol_v1beta3.FlowSchema, error) { + defer c.recorder.RecordWithContext(arg0, "update_status") + return c.inner.UpdateStatus(arg0, arg1, arg2) +} +func (c *withMetrics) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) { + defer c.recorder.RecordWithContext(arg0, "watch") + return c.inner.Watch(arg0, arg1) +} + +type withTracing struct { + inner k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3.FlowSchemaInterface + client string + kind string +} + +func (c *withTracing) Apply(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_flowcontrol_v1beta3.FlowSchemaApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_flowcontrol_v1beta3.FlowSchema, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Apply"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Apply"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Apply(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) ApplyStatus(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_flowcontrol_v1beta3.FlowSchemaApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_flowcontrol_v1beta3.FlowSchema, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "ApplyStatus"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("ApplyStatus"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.ApplyStatus(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) Create(arg0 context.Context, arg1 *k8s_io_api_flowcontrol_v1beta3.FlowSchema, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*k8s_io_api_flowcontrol_v1beta3.FlowSchema, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Create"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Create"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Create(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Delete"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Delete"), + ), + ) + defer span.End() + } + ret0 := c.inner.Delete(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret0) + } + return ret0 +} +func (c *withTracing) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) error { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "DeleteCollection"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("DeleteCollection"), + ), + ) + defer span.End() + } + ret0 := c.inner.DeleteCollection(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret0) + } + return ret0 +} +func (c *withTracing) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*k8s_io_api_flowcontrol_v1beta3.FlowSchema, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Get"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Get"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Get(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*k8s_io_api_flowcontrol_v1beta3.FlowSchemaList, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "List"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("List"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.List(arg0, arg1) + if span != nil { + tracing.SetSpanStatus(span, 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) (*k8s_io_api_flowcontrol_v1beta3.FlowSchema, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Patch"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Patch"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) Update(arg0 context.Context, arg1 *k8s_io_api_flowcontrol_v1beta3.FlowSchema, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_flowcontrol_v1beta3.FlowSchema, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Update"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Update"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Update(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) UpdateStatus(arg0 context.Context, arg1 *k8s_io_api_flowcontrol_v1beta3.FlowSchema, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_flowcontrol_v1beta3.FlowSchema, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "UpdateStatus"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("UpdateStatus"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.UpdateStatus(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Watch"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Watch"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Watch(arg0, arg1) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} diff --git a/pkg/clients/kube/flowcontrolv1beta3/prioritylevelconfigurations/resource.generated.go b/pkg/clients/kube/flowcontrolv1beta3/prioritylevelconfigurations/resource.generated.go new file mode 100644 index 0000000000..f35b8954af --- /dev/null +++ b/pkg/clients/kube/flowcontrolv1beta3/prioritylevelconfigurations/resource.generated.go @@ -0,0 +1,446 @@ +package resource + +import ( + context "context" + "fmt" + "time" + + "github.com/go-logr/logr" + "github.com/kyverno/kyverno/pkg/metrics" + "github.com/kyverno/kyverno/pkg/tracing" + "go.opentelemetry.io/otel/trace" + "go.uber.org/multierr" + k8s_io_api_flowcontrol_v1beta3 "k8s.io/api/flowcontrol/v1beta3" + k8s_io_apimachinery_pkg_apis_meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + k8s_io_apimachinery_pkg_types "k8s.io/apimachinery/pkg/types" + k8s_io_apimachinery_pkg_watch "k8s.io/apimachinery/pkg/watch" + k8s_io_client_go_applyconfigurations_flowcontrol_v1beta3 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3" + k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3" +) + +func WithLogging(inner k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3.PriorityLevelConfigurationInterface, logger logr.Logger) k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3.PriorityLevelConfigurationInterface { + return &withLogging{inner, logger} +} + +func WithMetrics(inner k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3.PriorityLevelConfigurationInterface, recorder metrics.Recorder) k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3.PriorityLevelConfigurationInterface { + return &withMetrics{inner, recorder} +} + +func WithTracing(inner k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3.PriorityLevelConfigurationInterface, client, kind string) k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3.PriorityLevelConfigurationInterface { + return &withTracing{inner, client, kind} +} + +type withLogging struct { + inner k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3.PriorityLevelConfigurationInterface + logger logr.Logger +} + +func (c *withLogging) Apply(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_flowcontrol_v1beta3.PriorityLevelConfigurationApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_flowcontrol_v1beta3.PriorityLevelConfiguration, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Apply") + ret0, ret1 := c.inner.Apply(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Apply failed", "duration", time.Since(start)) + } else { + logger.Info("Apply done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) ApplyStatus(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_flowcontrol_v1beta3.PriorityLevelConfigurationApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_flowcontrol_v1beta3.PriorityLevelConfiguration, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "ApplyStatus") + ret0, ret1 := c.inner.ApplyStatus(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "ApplyStatus failed", "duration", time.Since(start)) + } else { + logger.Info("ApplyStatus done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) Create(arg0 context.Context, arg1 *k8s_io_api_flowcontrol_v1beta3.PriorityLevelConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*k8s_io_api_flowcontrol_v1beta3.PriorityLevelConfiguration, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Create") + ret0, ret1 := c.inner.Create(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Create failed", "duration", time.Since(start)) + } else { + logger.Info("Create done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error { + start := time.Now() + logger := c.logger.WithValues("operation", "Delete") + ret0 := c.inner.Delete(arg0, arg1, arg2) + if err := multierr.Combine(ret0); err != nil { + logger.Error(err, "Delete failed", "duration", time.Since(start)) + } else { + logger.Info("Delete done", "duration", time.Since(start)) + } + return ret0 +} +func (c *withLogging) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) error { + start := time.Now() + logger := c.logger.WithValues("operation", "DeleteCollection") + ret0 := c.inner.DeleteCollection(arg0, arg1, arg2) + if err := multierr.Combine(ret0); err != nil { + logger.Error(err, "DeleteCollection failed", "duration", time.Since(start)) + } else { + logger.Info("DeleteCollection done", "duration", time.Since(start)) + } + return ret0 +} +func (c *withLogging) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*k8s_io_api_flowcontrol_v1beta3.PriorityLevelConfiguration, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Get") + ret0, ret1 := c.inner.Get(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Get failed", "duration", time.Since(start)) + } else { + logger.Info("Get done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*k8s_io_api_flowcontrol_v1beta3.PriorityLevelConfigurationList, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "List") + ret0, ret1 := c.inner.List(arg0, arg1) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "List failed", "duration", time.Since(start)) + } else { + logger.Info("List done", "duration", time.Since(start)) + } + 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) (*k8s_io_api_flowcontrol_v1beta3.PriorityLevelConfiguration, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Patch") + ret0, ret1 := c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Patch failed", "duration", time.Since(start)) + } else { + logger.Info("Patch done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) Update(arg0 context.Context, arg1 *k8s_io_api_flowcontrol_v1beta3.PriorityLevelConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_flowcontrol_v1beta3.PriorityLevelConfiguration, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Update") + ret0, ret1 := c.inner.Update(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Update failed", "duration", time.Since(start)) + } else { + logger.Info("Update done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) UpdateStatus(arg0 context.Context, arg1 *k8s_io_api_flowcontrol_v1beta3.PriorityLevelConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_flowcontrol_v1beta3.PriorityLevelConfiguration, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "UpdateStatus") + ret0, ret1 := c.inner.UpdateStatus(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "UpdateStatus failed", "duration", time.Since(start)) + } else { + logger.Info("UpdateStatus done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Watch") + ret0, ret1 := c.inner.Watch(arg0, arg1) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Watch failed", "duration", time.Since(start)) + } else { + logger.Info("Watch done", "duration", time.Since(start)) + } + return ret0, ret1 +} + +type withMetrics struct { + inner k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3.PriorityLevelConfigurationInterface + recorder metrics.Recorder +} + +func (c *withMetrics) Apply(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_flowcontrol_v1beta3.PriorityLevelConfigurationApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_flowcontrol_v1beta3.PriorityLevelConfiguration, error) { + defer c.recorder.RecordWithContext(arg0, "apply") + return c.inner.Apply(arg0, arg1, arg2) +} +func (c *withMetrics) ApplyStatus(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_flowcontrol_v1beta3.PriorityLevelConfigurationApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_flowcontrol_v1beta3.PriorityLevelConfiguration, error) { + defer c.recorder.RecordWithContext(arg0, "apply_status") + return c.inner.ApplyStatus(arg0, arg1, arg2) +} +func (c *withMetrics) Create(arg0 context.Context, arg1 *k8s_io_api_flowcontrol_v1beta3.PriorityLevelConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*k8s_io_api_flowcontrol_v1beta3.PriorityLevelConfiguration, error) { + defer c.recorder.RecordWithContext(arg0, "create") + return c.inner.Create(arg0, arg1, arg2) +} +func (c *withMetrics) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error { + defer c.recorder.RecordWithContext(arg0, "delete") + return c.inner.Delete(arg0, arg1, arg2) +} +func (c *withMetrics) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) error { + defer c.recorder.RecordWithContext(arg0, "delete_collection") + 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) (*k8s_io_api_flowcontrol_v1beta3.PriorityLevelConfiguration, error) { + defer c.recorder.RecordWithContext(arg0, "get") + return c.inner.Get(arg0, arg1, arg2) +} +func (c *withMetrics) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*k8s_io_api_flowcontrol_v1beta3.PriorityLevelConfigurationList, error) { + defer c.recorder.RecordWithContext(arg0, "list") + 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) (*k8s_io_api_flowcontrol_v1beta3.PriorityLevelConfiguration, error) { + defer c.recorder.RecordWithContext(arg0, "patch") + return c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...) +} +func (c *withMetrics) Update(arg0 context.Context, arg1 *k8s_io_api_flowcontrol_v1beta3.PriorityLevelConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_flowcontrol_v1beta3.PriorityLevelConfiguration, error) { + defer c.recorder.RecordWithContext(arg0, "update") + return c.inner.Update(arg0, arg1, arg2) +} +func (c *withMetrics) UpdateStatus(arg0 context.Context, arg1 *k8s_io_api_flowcontrol_v1beta3.PriorityLevelConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_flowcontrol_v1beta3.PriorityLevelConfiguration, error) { + defer c.recorder.RecordWithContext(arg0, "update_status") + return c.inner.UpdateStatus(arg0, arg1, arg2) +} +func (c *withMetrics) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) { + defer c.recorder.RecordWithContext(arg0, "watch") + return c.inner.Watch(arg0, arg1) +} + +type withTracing struct { + inner k8s_io_client_go_kubernetes_typed_flowcontrol_v1beta3.PriorityLevelConfigurationInterface + client string + kind string +} + +func (c *withTracing) Apply(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_flowcontrol_v1beta3.PriorityLevelConfigurationApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_flowcontrol_v1beta3.PriorityLevelConfiguration, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Apply"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Apply"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Apply(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) ApplyStatus(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_flowcontrol_v1beta3.PriorityLevelConfigurationApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_flowcontrol_v1beta3.PriorityLevelConfiguration, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "ApplyStatus"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("ApplyStatus"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.ApplyStatus(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) Create(arg0 context.Context, arg1 *k8s_io_api_flowcontrol_v1beta3.PriorityLevelConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*k8s_io_api_flowcontrol_v1beta3.PriorityLevelConfiguration, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Create"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Create"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Create(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Delete"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Delete"), + ), + ) + defer span.End() + } + ret0 := c.inner.Delete(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret0) + } + return ret0 +} +func (c *withTracing) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) error { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "DeleteCollection"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("DeleteCollection"), + ), + ) + defer span.End() + } + ret0 := c.inner.DeleteCollection(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret0) + } + return ret0 +} +func (c *withTracing) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*k8s_io_api_flowcontrol_v1beta3.PriorityLevelConfiguration, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Get"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Get"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Get(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*k8s_io_api_flowcontrol_v1beta3.PriorityLevelConfigurationList, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "List"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("List"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.List(arg0, arg1) + if span != nil { + tracing.SetSpanStatus(span, 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) (*k8s_io_api_flowcontrol_v1beta3.PriorityLevelConfiguration, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Patch"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Patch"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) Update(arg0 context.Context, arg1 *k8s_io_api_flowcontrol_v1beta3.PriorityLevelConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_flowcontrol_v1beta3.PriorityLevelConfiguration, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Update"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Update"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Update(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) UpdateStatus(arg0 context.Context, arg1 *k8s_io_api_flowcontrol_v1beta3.PriorityLevelConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_flowcontrol_v1beta3.PriorityLevelConfiguration, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "UpdateStatus"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("UpdateStatus"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.UpdateStatus(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Watch"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Watch"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Watch(arg0, arg1) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} diff --git a/pkg/clients/kube/resourcev1alpha1/client.generated.go b/pkg/clients/kube/resourcev1alpha1/client.generated.go new file mode 100644 index 0000000000..7d960e169b --- /dev/null +++ b/pkg/clients/kube/resourcev1alpha1/client.generated.go @@ -0,0 +1,92 @@ +package client + +import ( + "github.com/go-logr/logr" + podschedulings "github.com/kyverno/kyverno/pkg/clients/kube/resourcev1alpha1/podschedulings" + resourceclaims "github.com/kyverno/kyverno/pkg/clients/kube/resourcev1alpha1/resourceclaims" + resourceclaimtemplates "github.com/kyverno/kyverno/pkg/clients/kube/resourcev1alpha1/resourceclaimtemplates" + resourceclasses "github.com/kyverno/kyverno/pkg/clients/kube/resourcev1alpha1/resourceclasses" + "github.com/kyverno/kyverno/pkg/metrics" + k8s_io_client_go_kubernetes_typed_resource_v1alpha1 "k8s.io/client-go/kubernetes/typed/resource/v1alpha1" + "k8s.io/client-go/rest" +) + +func WithMetrics(inner k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceV1alpha1Interface, metrics metrics.MetricsConfigManager, clientType metrics.ClientType) k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceV1alpha1Interface { + return &withMetrics{inner, metrics, clientType} +} + +func WithTracing(inner k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceV1alpha1Interface, client string) k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceV1alpha1Interface { + return &withTracing{inner, client} +} + +func WithLogging(inner k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceV1alpha1Interface, logger logr.Logger) k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceV1alpha1Interface { + return &withLogging{inner, logger} +} + +type withMetrics struct { + inner k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceV1alpha1Interface + metrics metrics.MetricsConfigManager + clientType metrics.ClientType +} + +func (c *withMetrics) RESTClient() rest.Interface { + return c.inner.RESTClient() +} +func (c *withMetrics) PodSchedulings(namespace string) k8s_io_client_go_kubernetes_typed_resource_v1alpha1.PodSchedulingInterface { + recorder := metrics.NamespacedClientQueryRecorder(c.metrics, namespace, "PodScheduling", c.clientType) + return podschedulings.WithMetrics(c.inner.PodSchedulings(namespace), recorder) +} +func (c *withMetrics) ResourceClaimTemplates(namespace string) k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClaimTemplateInterface { + recorder := metrics.NamespacedClientQueryRecorder(c.metrics, namespace, "ResourceClaimTemplate", c.clientType) + return resourceclaimtemplates.WithMetrics(c.inner.ResourceClaimTemplates(namespace), recorder) +} +func (c *withMetrics) ResourceClaims(namespace string) k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClaimInterface { + recorder := metrics.NamespacedClientQueryRecorder(c.metrics, namespace, "ResourceClaim", c.clientType) + return resourceclaims.WithMetrics(c.inner.ResourceClaims(namespace), recorder) +} +func (c *withMetrics) ResourceClasses() k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClassInterface { + recorder := metrics.ClusteredClientQueryRecorder(c.metrics, "ResourceClass", c.clientType) + return resourceclasses.WithMetrics(c.inner.ResourceClasses(), recorder) +} + +type withTracing struct { + inner k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceV1alpha1Interface + client string +} + +func (c *withTracing) RESTClient() rest.Interface { + return c.inner.RESTClient() +} +func (c *withTracing) PodSchedulings(namespace string) k8s_io_client_go_kubernetes_typed_resource_v1alpha1.PodSchedulingInterface { + return podschedulings.WithTracing(c.inner.PodSchedulings(namespace), c.client, "PodScheduling") +} +func (c *withTracing) ResourceClaimTemplates(namespace string) k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClaimTemplateInterface { + return resourceclaimtemplates.WithTracing(c.inner.ResourceClaimTemplates(namespace), c.client, "ResourceClaimTemplate") +} +func (c *withTracing) ResourceClaims(namespace string) k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClaimInterface { + return resourceclaims.WithTracing(c.inner.ResourceClaims(namespace), c.client, "ResourceClaim") +} +func (c *withTracing) ResourceClasses() k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClassInterface { + return resourceclasses.WithTracing(c.inner.ResourceClasses(), c.client, "ResourceClass") +} + +type withLogging struct { + inner k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceV1alpha1Interface + logger logr.Logger +} + +func (c *withLogging) RESTClient() rest.Interface { + return c.inner.RESTClient() +} +func (c *withLogging) PodSchedulings(namespace string) k8s_io_client_go_kubernetes_typed_resource_v1alpha1.PodSchedulingInterface { + return podschedulings.WithLogging(c.inner.PodSchedulings(namespace), c.logger.WithValues("resource", "PodSchedulings").WithValues("namespace", namespace)) +} +func (c *withLogging) ResourceClaimTemplates(namespace string) k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClaimTemplateInterface { + return resourceclaimtemplates.WithLogging(c.inner.ResourceClaimTemplates(namespace), c.logger.WithValues("resource", "ResourceClaimTemplates").WithValues("namespace", namespace)) +} +func (c *withLogging) ResourceClaims(namespace string) k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClaimInterface { + return resourceclaims.WithLogging(c.inner.ResourceClaims(namespace), c.logger.WithValues("resource", "ResourceClaims").WithValues("namespace", namespace)) +} +func (c *withLogging) ResourceClasses() k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClassInterface { + return resourceclasses.WithLogging(c.inner.ResourceClasses(), c.logger.WithValues("resource", "ResourceClasses")) +} diff --git a/pkg/clients/kube/resourcev1alpha1/podschedulings/resource.generated.go b/pkg/clients/kube/resourcev1alpha1/podschedulings/resource.generated.go new file mode 100644 index 0000000000..e88e33c034 --- /dev/null +++ b/pkg/clients/kube/resourcev1alpha1/podschedulings/resource.generated.go @@ -0,0 +1,446 @@ +package resource + +import ( + context "context" + "fmt" + "time" + + "github.com/go-logr/logr" + "github.com/kyverno/kyverno/pkg/metrics" + "github.com/kyverno/kyverno/pkg/tracing" + "go.opentelemetry.io/otel/trace" + "go.uber.org/multierr" + k8s_io_api_resource_v1alpha1 "k8s.io/api/resource/v1alpha1" + k8s_io_apimachinery_pkg_apis_meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + k8s_io_apimachinery_pkg_types "k8s.io/apimachinery/pkg/types" + k8s_io_apimachinery_pkg_watch "k8s.io/apimachinery/pkg/watch" + k8s_io_client_go_applyconfigurations_resource_v1alpha1 "k8s.io/client-go/applyconfigurations/resource/v1alpha1" + k8s_io_client_go_kubernetes_typed_resource_v1alpha1 "k8s.io/client-go/kubernetes/typed/resource/v1alpha1" +) + +func WithLogging(inner k8s_io_client_go_kubernetes_typed_resource_v1alpha1.PodSchedulingInterface, logger logr.Logger) k8s_io_client_go_kubernetes_typed_resource_v1alpha1.PodSchedulingInterface { + return &withLogging{inner, logger} +} + +func WithMetrics(inner k8s_io_client_go_kubernetes_typed_resource_v1alpha1.PodSchedulingInterface, recorder metrics.Recorder) k8s_io_client_go_kubernetes_typed_resource_v1alpha1.PodSchedulingInterface { + return &withMetrics{inner, recorder} +} + +func WithTracing(inner k8s_io_client_go_kubernetes_typed_resource_v1alpha1.PodSchedulingInterface, client, kind string) k8s_io_client_go_kubernetes_typed_resource_v1alpha1.PodSchedulingInterface { + return &withTracing{inner, client, kind} +} + +type withLogging struct { + inner k8s_io_client_go_kubernetes_typed_resource_v1alpha1.PodSchedulingInterface + logger logr.Logger +} + +func (c *withLogging) Apply(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_resource_v1alpha1.PodSchedulingApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_resource_v1alpha1.PodScheduling, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Apply") + ret0, ret1 := c.inner.Apply(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Apply failed", "duration", time.Since(start)) + } else { + logger.Info("Apply done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) ApplyStatus(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_resource_v1alpha1.PodSchedulingApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_resource_v1alpha1.PodScheduling, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "ApplyStatus") + ret0, ret1 := c.inner.ApplyStatus(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "ApplyStatus failed", "duration", time.Since(start)) + } else { + logger.Info("ApplyStatus done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) Create(arg0 context.Context, arg1 *k8s_io_api_resource_v1alpha1.PodScheduling, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*k8s_io_api_resource_v1alpha1.PodScheduling, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Create") + ret0, ret1 := c.inner.Create(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Create failed", "duration", time.Since(start)) + } else { + logger.Info("Create done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error { + start := time.Now() + logger := c.logger.WithValues("operation", "Delete") + ret0 := c.inner.Delete(arg0, arg1, arg2) + if err := multierr.Combine(ret0); err != nil { + logger.Error(err, "Delete failed", "duration", time.Since(start)) + } else { + logger.Info("Delete done", "duration", time.Since(start)) + } + return ret0 +} +func (c *withLogging) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) error { + start := time.Now() + logger := c.logger.WithValues("operation", "DeleteCollection") + ret0 := c.inner.DeleteCollection(arg0, arg1, arg2) + if err := multierr.Combine(ret0); err != nil { + logger.Error(err, "DeleteCollection failed", "duration", time.Since(start)) + } else { + logger.Info("DeleteCollection done", "duration", time.Since(start)) + } + return ret0 +} +func (c *withLogging) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*k8s_io_api_resource_v1alpha1.PodScheduling, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Get") + ret0, ret1 := c.inner.Get(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Get failed", "duration", time.Since(start)) + } else { + logger.Info("Get done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*k8s_io_api_resource_v1alpha1.PodSchedulingList, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "List") + ret0, ret1 := c.inner.List(arg0, arg1) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "List failed", "duration", time.Since(start)) + } else { + logger.Info("List done", "duration", time.Since(start)) + } + 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) (*k8s_io_api_resource_v1alpha1.PodScheduling, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Patch") + ret0, ret1 := c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Patch failed", "duration", time.Since(start)) + } else { + logger.Info("Patch done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) Update(arg0 context.Context, arg1 *k8s_io_api_resource_v1alpha1.PodScheduling, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_resource_v1alpha1.PodScheduling, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Update") + ret0, ret1 := c.inner.Update(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Update failed", "duration", time.Since(start)) + } else { + logger.Info("Update done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) UpdateStatus(arg0 context.Context, arg1 *k8s_io_api_resource_v1alpha1.PodScheduling, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_resource_v1alpha1.PodScheduling, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "UpdateStatus") + ret0, ret1 := c.inner.UpdateStatus(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "UpdateStatus failed", "duration", time.Since(start)) + } else { + logger.Info("UpdateStatus done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Watch") + ret0, ret1 := c.inner.Watch(arg0, arg1) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Watch failed", "duration", time.Since(start)) + } else { + logger.Info("Watch done", "duration", time.Since(start)) + } + return ret0, ret1 +} + +type withMetrics struct { + inner k8s_io_client_go_kubernetes_typed_resource_v1alpha1.PodSchedulingInterface + recorder metrics.Recorder +} + +func (c *withMetrics) Apply(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_resource_v1alpha1.PodSchedulingApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_resource_v1alpha1.PodScheduling, error) { + defer c.recorder.RecordWithContext(arg0, "apply") + return c.inner.Apply(arg0, arg1, arg2) +} +func (c *withMetrics) ApplyStatus(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_resource_v1alpha1.PodSchedulingApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_resource_v1alpha1.PodScheduling, error) { + defer c.recorder.RecordWithContext(arg0, "apply_status") + return c.inner.ApplyStatus(arg0, arg1, arg2) +} +func (c *withMetrics) Create(arg0 context.Context, arg1 *k8s_io_api_resource_v1alpha1.PodScheduling, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*k8s_io_api_resource_v1alpha1.PodScheduling, error) { + defer c.recorder.RecordWithContext(arg0, "create") + return c.inner.Create(arg0, arg1, arg2) +} +func (c *withMetrics) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error { + defer c.recorder.RecordWithContext(arg0, "delete") + return c.inner.Delete(arg0, arg1, arg2) +} +func (c *withMetrics) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) error { + defer c.recorder.RecordWithContext(arg0, "delete_collection") + 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) (*k8s_io_api_resource_v1alpha1.PodScheduling, error) { + defer c.recorder.RecordWithContext(arg0, "get") + return c.inner.Get(arg0, arg1, arg2) +} +func (c *withMetrics) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*k8s_io_api_resource_v1alpha1.PodSchedulingList, error) { + defer c.recorder.RecordWithContext(arg0, "list") + 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) (*k8s_io_api_resource_v1alpha1.PodScheduling, error) { + defer c.recorder.RecordWithContext(arg0, "patch") + return c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...) +} +func (c *withMetrics) Update(arg0 context.Context, arg1 *k8s_io_api_resource_v1alpha1.PodScheduling, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_resource_v1alpha1.PodScheduling, error) { + defer c.recorder.RecordWithContext(arg0, "update") + return c.inner.Update(arg0, arg1, arg2) +} +func (c *withMetrics) UpdateStatus(arg0 context.Context, arg1 *k8s_io_api_resource_v1alpha1.PodScheduling, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_resource_v1alpha1.PodScheduling, error) { + defer c.recorder.RecordWithContext(arg0, "update_status") + return c.inner.UpdateStatus(arg0, arg1, arg2) +} +func (c *withMetrics) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) { + defer c.recorder.RecordWithContext(arg0, "watch") + return c.inner.Watch(arg0, arg1) +} + +type withTracing struct { + inner k8s_io_client_go_kubernetes_typed_resource_v1alpha1.PodSchedulingInterface + client string + kind string +} + +func (c *withTracing) Apply(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_resource_v1alpha1.PodSchedulingApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_resource_v1alpha1.PodScheduling, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Apply"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Apply"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Apply(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) ApplyStatus(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_resource_v1alpha1.PodSchedulingApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_resource_v1alpha1.PodScheduling, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "ApplyStatus"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("ApplyStatus"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.ApplyStatus(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) Create(arg0 context.Context, arg1 *k8s_io_api_resource_v1alpha1.PodScheduling, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*k8s_io_api_resource_v1alpha1.PodScheduling, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Create"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Create"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Create(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Delete"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Delete"), + ), + ) + defer span.End() + } + ret0 := c.inner.Delete(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret0) + } + return ret0 +} +func (c *withTracing) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) error { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "DeleteCollection"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("DeleteCollection"), + ), + ) + defer span.End() + } + ret0 := c.inner.DeleteCollection(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret0) + } + return ret0 +} +func (c *withTracing) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*k8s_io_api_resource_v1alpha1.PodScheduling, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Get"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Get"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Get(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*k8s_io_api_resource_v1alpha1.PodSchedulingList, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "List"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("List"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.List(arg0, arg1) + if span != nil { + tracing.SetSpanStatus(span, 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) (*k8s_io_api_resource_v1alpha1.PodScheduling, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Patch"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Patch"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) Update(arg0 context.Context, arg1 *k8s_io_api_resource_v1alpha1.PodScheduling, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_resource_v1alpha1.PodScheduling, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Update"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Update"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Update(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) UpdateStatus(arg0 context.Context, arg1 *k8s_io_api_resource_v1alpha1.PodScheduling, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_resource_v1alpha1.PodScheduling, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "UpdateStatus"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("UpdateStatus"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.UpdateStatus(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Watch"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Watch"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Watch(arg0, arg1) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} diff --git a/pkg/clients/kube/resourcev1alpha1/resourceclaims/resource.generated.go b/pkg/clients/kube/resourcev1alpha1/resourceclaims/resource.generated.go new file mode 100644 index 0000000000..31d1dfcf30 --- /dev/null +++ b/pkg/clients/kube/resourcev1alpha1/resourceclaims/resource.generated.go @@ -0,0 +1,446 @@ +package resource + +import ( + context "context" + "fmt" + "time" + + "github.com/go-logr/logr" + "github.com/kyverno/kyverno/pkg/metrics" + "github.com/kyverno/kyverno/pkg/tracing" + "go.opentelemetry.io/otel/trace" + "go.uber.org/multierr" + k8s_io_api_resource_v1alpha1 "k8s.io/api/resource/v1alpha1" + k8s_io_apimachinery_pkg_apis_meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + k8s_io_apimachinery_pkg_types "k8s.io/apimachinery/pkg/types" + k8s_io_apimachinery_pkg_watch "k8s.io/apimachinery/pkg/watch" + k8s_io_client_go_applyconfigurations_resource_v1alpha1 "k8s.io/client-go/applyconfigurations/resource/v1alpha1" + k8s_io_client_go_kubernetes_typed_resource_v1alpha1 "k8s.io/client-go/kubernetes/typed/resource/v1alpha1" +) + +func WithLogging(inner k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClaimInterface, logger logr.Logger) k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClaimInterface { + return &withLogging{inner, logger} +} + +func WithMetrics(inner k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClaimInterface, recorder metrics.Recorder) k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClaimInterface { + return &withMetrics{inner, recorder} +} + +func WithTracing(inner k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClaimInterface, client, kind string) k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClaimInterface { + return &withTracing{inner, client, kind} +} + +type withLogging struct { + inner k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClaimInterface + logger logr.Logger +} + +func (c *withLogging) Apply(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_resource_v1alpha1.ResourceClaimApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_resource_v1alpha1.ResourceClaim, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Apply") + ret0, ret1 := c.inner.Apply(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Apply failed", "duration", time.Since(start)) + } else { + logger.Info("Apply done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) ApplyStatus(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_resource_v1alpha1.ResourceClaimApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_resource_v1alpha1.ResourceClaim, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "ApplyStatus") + ret0, ret1 := c.inner.ApplyStatus(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "ApplyStatus failed", "duration", time.Since(start)) + } else { + logger.Info("ApplyStatus done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) Create(arg0 context.Context, arg1 *k8s_io_api_resource_v1alpha1.ResourceClaim, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*k8s_io_api_resource_v1alpha1.ResourceClaim, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Create") + ret0, ret1 := c.inner.Create(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Create failed", "duration", time.Since(start)) + } else { + logger.Info("Create done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error { + start := time.Now() + logger := c.logger.WithValues("operation", "Delete") + ret0 := c.inner.Delete(arg0, arg1, arg2) + if err := multierr.Combine(ret0); err != nil { + logger.Error(err, "Delete failed", "duration", time.Since(start)) + } else { + logger.Info("Delete done", "duration", time.Since(start)) + } + return ret0 +} +func (c *withLogging) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) error { + start := time.Now() + logger := c.logger.WithValues("operation", "DeleteCollection") + ret0 := c.inner.DeleteCollection(arg0, arg1, arg2) + if err := multierr.Combine(ret0); err != nil { + logger.Error(err, "DeleteCollection failed", "duration", time.Since(start)) + } else { + logger.Info("DeleteCollection done", "duration", time.Since(start)) + } + return ret0 +} +func (c *withLogging) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*k8s_io_api_resource_v1alpha1.ResourceClaim, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Get") + ret0, ret1 := c.inner.Get(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Get failed", "duration", time.Since(start)) + } else { + logger.Info("Get done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*k8s_io_api_resource_v1alpha1.ResourceClaimList, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "List") + ret0, ret1 := c.inner.List(arg0, arg1) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "List failed", "duration", time.Since(start)) + } else { + logger.Info("List done", "duration", time.Since(start)) + } + 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) (*k8s_io_api_resource_v1alpha1.ResourceClaim, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Patch") + ret0, ret1 := c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Patch failed", "duration", time.Since(start)) + } else { + logger.Info("Patch done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) Update(arg0 context.Context, arg1 *k8s_io_api_resource_v1alpha1.ResourceClaim, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_resource_v1alpha1.ResourceClaim, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Update") + ret0, ret1 := c.inner.Update(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Update failed", "duration", time.Since(start)) + } else { + logger.Info("Update done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) UpdateStatus(arg0 context.Context, arg1 *k8s_io_api_resource_v1alpha1.ResourceClaim, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_resource_v1alpha1.ResourceClaim, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "UpdateStatus") + ret0, ret1 := c.inner.UpdateStatus(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "UpdateStatus failed", "duration", time.Since(start)) + } else { + logger.Info("UpdateStatus done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Watch") + ret0, ret1 := c.inner.Watch(arg0, arg1) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Watch failed", "duration", time.Since(start)) + } else { + logger.Info("Watch done", "duration", time.Since(start)) + } + return ret0, ret1 +} + +type withMetrics struct { + inner k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClaimInterface + recorder metrics.Recorder +} + +func (c *withMetrics) Apply(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_resource_v1alpha1.ResourceClaimApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_resource_v1alpha1.ResourceClaim, error) { + defer c.recorder.RecordWithContext(arg0, "apply") + return c.inner.Apply(arg0, arg1, arg2) +} +func (c *withMetrics) ApplyStatus(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_resource_v1alpha1.ResourceClaimApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_resource_v1alpha1.ResourceClaim, error) { + defer c.recorder.RecordWithContext(arg0, "apply_status") + return c.inner.ApplyStatus(arg0, arg1, arg2) +} +func (c *withMetrics) Create(arg0 context.Context, arg1 *k8s_io_api_resource_v1alpha1.ResourceClaim, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*k8s_io_api_resource_v1alpha1.ResourceClaim, error) { + defer c.recorder.RecordWithContext(arg0, "create") + return c.inner.Create(arg0, arg1, arg2) +} +func (c *withMetrics) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error { + defer c.recorder.RecordWithContext(arg0, "delete") + return c.inner.Delete(arg0, arg1, arg2) +} +func (c *withMetrics) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) error { + defer c.recorder.RecordWithContext(arg0, "delete_collection") + 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) (*k8s_io_api_resource_v1alpha1.ResourceClaim, error) { + defer c.recorder.RecordWithContext(arg0, "get") + return c.inner.Get(arg0, arg1, arg2) +} +func (c *withMetrics) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*k8s_io_api_resource_v1alpha1.ResourceClaimList, error) { + defer c.recorder.RecordWithContext(arg0, "list") + 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) (*k8s_io_api_resource_v1alpha1.ResourceClaim, error) { + defer c.recorder.RecordWithContext(arg0, "patch") + return c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...) +} +func (c *withMetrics) Update(arg0 context.Context, arg1 *k8s_io_api_resource_v1alpha1.ResourceClaim, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_resource_v1alpha1.ResourceClaim, error) { + defer c.recorder.RecordWithContext(arg0, "update") + return c.inner.Update(arg0, arg1, arg2) +} +func (c *withMetrics) UpdateStatus(arg0 context.Context, arg1 *k8s_io_api_resource_v1alpha1.ResourceClaim, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_resource_v1alpha1.ResourceClaim, error) { + defer c.recorder.RecordWithContext(arg0, "update_status") + return c.inner.UpdateStatus(arg0, arg1, arg2) +} +func (c *withMetrics) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) { + defer c.recorder.RecordWithContext(arg0, "watch") + return c.inner.Watch(arg0, arg1) +} + +type withTracing struct { + inner k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClaimInterface + client string + kind string +} + +func (c *withTracing) Apply(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_resource_v1alpha1.ResourceClaimApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_resource_v1alpha1.ResourceClaim, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Apply"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Apply"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Apply(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) ApplyStatus(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_resource_v1alpha1.ResourceClaimApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_resource_v1alpha1.ResourceClaim, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "ApplyStatus"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("ApplyStatus"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.ApplyStatus(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) Create(arg0 context.Context, arg1 *k8s_io_api_resource_v1alpha1.ResourceClaim, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*k8s_io_api_resource_v1alpha1.ResourceClaim, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Create"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Create"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Create(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Delete"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Delete"), + ), + ) + defer span.End() + } + ret0 := c.inner.Delete(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret0) + } + return ret0 +} +func (c *withTracing) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) error { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "DeleteCollection"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("DeleteCollection"), + ), + ) + defer span.End() + } + ret0 := c.inner.DeleteCollection(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret0) + } + return ret0 +} +func (c *withTracing) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*k8s_io_api_resource_v1alpha1.ResourceClaim, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Get"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Get"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Get(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*k8s_io_api_resource_v1alpha1.ResourceClaimList, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "List"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("List"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.List(arg0, arg1) + if span != nil { + tracing.SetSpanStatus(span, 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) (*k8s_io_api_resource_v1alpha1.ResourceClaim, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Patch"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Patch"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) Update(arg0 context.Context, arg1 *k8s_io_api_resource_v1alpha1.ResourceClaim, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_resource_v1alpha1.ResourceClaim, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Update"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Update"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Update(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) UpdateStatus(arg0 context.Context, arg1 *k8s_io_api_resource_v1alpha1.ResourceClaim, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_resource_v1alpha1.ResourceClaim, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "UpdateStatus"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("UpdateStatus"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.UpdateStatus(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Watch"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Watch"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Watch(arg0, arg1) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} diff --git a/pkg/clients/kube/resourcev1alpha1/resourceclaimtemplates/resource.generated.go b/pkg/clients/kube/resourcev1alpha1/resourceclaimtemplates/resource.generated.go new file mode 100644 index 0000000000..1b9c6d573a --- /dev/null +++ b/pkg/clients/kube/resourcev1alpha1/resourceclaimtemplates/resource.generated.go @@ -0,0 +1,374 @@ +package resource + +import ( + context "context" + "fmt" + "time" + + "github.com/go-logr/logr" + "github.com/kyverno/kyverno/pkg/metrics" + "github.com/kyverno/kyverno/pkg/tracing" + "go.opentelemetry.io/otel/trace" + "go.uber.org/multierr" + k8s_io_api_resource_v1alpha1 "k8s.io/api/resource/v1alpha1" + k8s_io_apimachinery_pkg_apis_meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + k8s_io_apimachinery_pkg_types "k8s.io/apimachinery/pkg/types" + k8s_io_apimachinery_pkg_watch "k8s.io/apimachinery/pkg/watch" + k8s_io_client_go_applyconfigurations_resource_v1alpha1 "k8s.io/client-go/applyconfigurations/resource/v1alpha1" + k8s_io_client_go_kubernetes_typed_resource_v1alpha1 "k8s.io/client-go/kubernetes/typed/resource/v1alpha1" +) + +func WithLogging(inner k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClaimTemplateInterface, logger logr.Logger) k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClaimTemplateInterface { + return &withLogging{inner, logger} +} + +func WithMetrics(inner k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClaimTemplateInterface, recorder metrics.Recorder) k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClaimTemplateInterface { + return &withMetrics{inner, recorder} +} + +func WithTracing(inner k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClaimTemplateInterface, client, kind string) k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClaimTemplateInterface { + return &withTracing{inner, client, kind} +} + +type withLogging struct { + inner k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClaimTemplateInterface + logger logr.Logger +} + +func (c *withLogging) Apply(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_resource_v1alpha1.ResourceClaimTemplateApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_resource_v1alpha1.ResourceClaimTemplate, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Apply") + ret0, ret1 := c.inner.Apply(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Apply failed", "duration", time.Since(start)) + } else { + logger.Info("Apply done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) Create(arg0 context.Context, arg1 *k8s_io_api_resource_v1alpha1.ResourceClaimTemplate, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*k8s_io_api_resource_v1alpha1.ResourceClaimTemplate, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Create") + ret0, ret1 := c.inner.Create(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Create failed", "duration", time.Since(start)) + } else { + logger.Info("Create done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error { + start := time.Now() + logger := c.logger.WithValues("operation", "Delete") + ret0 := c.inner.Delete(arg0, arg1, arg2) + if err := multierr.Combine(ret0); err != nil { + logger.Error(err, "Delete failed", "duration", time.Since(start)) + } else { + logger.Info("Delete done", "duration", time.Since(start)) + } + return ret0 +} +func (c *withLogging) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) error { + start := time.Now() + logger := c.logger.WithValues("operation", "DeleteCollection") + ret0 := c.inner.DeleteCollection(arg0, arg1, arg2) + if err := multierr.Combine(ret0); err != nil { + logger.Error(err, "DeleteCollection failed", "duration", time.Since(start)) + } else { + logger.Info("DeleteCollection done", "duration", time.Since(start)) + } + return ret0 +} +func (c *withLogging) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*k8s_io_api_resource_v1alpha1.ResourceClaimTemplate, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Get") + ret0, ret1 := c.inner.Get(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Get failed", "duration", time.Since(start)) + } else { + logger.Info("Get done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*k8s_io_api_resource_v1alpha1.ResourceClaimTemplateList, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "List") + ret0, ret1 := c.inner.List(arg0, arg1) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "List failed", "duration", time.Since(start)) + } else { + logger.Info("List done", "duration", time.Since(start)) + } + 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) (*k8s_io_api_resource_v1alpha1.ResourceClaimTemplate, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Patch") + ret0, ret1 := c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Patch failed", "duration", time.Since(start)) + } else { + logger.Info("Patch done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) Update(arg0 context.Context, arg1 *k8s_io_api_resource_v1alpha1.ResourceClaimTemplate, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_resource_v1alpha1.ResourceClaimTemplate, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Update") + ret0, ret1 := c.inner.Update(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Update failed", "duration", time.Since(start)) + } else { + logger.Info("Update done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Watch") + ret0, ret1 := c.inner.Watch(arg0, arg1) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Watch failed", "duration", time.Since(start)) + } else { + logger.Info("Watch done", "duration", time.Since(start)) + } + return ret0, ret1 +} + +type withMetrics struct { + inner k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClaimTemplateInterface + recorder metrics.Recorder +} + +func (c *withMetrics) Apply(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_resource_v1alpha1.ResourceClaimTemplateApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_resource_v1alpha1.ResourceClaimTemplate, error) { + defer c.recorder.RecordWithContext(arg0, "apply") + return c.inner.Apply(arg0, arg1, arg2) +} +func (c *withMetrics) Create(arg0 context.Context, arg1 *k8s_io_api_resource_v1alpha1.ResourceClaimTemplate, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*k8s_io_api_resource_v1alpha1.ResourceClaimTemplate, error) { + defer c.recorder.RecordWithContext(arg0, "create") + return c.inner.Create(arg0, arg1, arg2) +} +func (c *withMetrics) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error { + defer c.recorder.RecordWithContext(arg0, "delete") + return c.inner.Delete(arg0, arg1, arg2) +} +func (c *withMetrics) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) error { + defer c.recorder.RecordWithContext(arg0, "delete_collection") + 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) (*k8s_io_api_resource_v1alpha1.ResourceClaimTemplate, error) { + defer c.recorder.RecordWithContext(arg0, "get") + return c.inner.Get(arg0, arg1, arg2) +} +func (c *withMetrics) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*k8s_io_api_resource_v1alpha1.ResourceClaimTemplateList, error) { + defer c.recorder.RecordWithContext(arg0, "list") + 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) (*k8s_io_api_resource_v1alpha1.ResourceClaimTemplate, error) { + defer c.recorder.RecordWithContext(arg0, "patch") + return c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...) +} +func (c *withMetrics) Update(arg0 context.Context, arg1 *k8s_io_api_resource_v1alpha1.ResourceClaimTemplate, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_resource_v1alpha1.ResourceClaimTemplate, error) { + defer c.recorder.RecordWithContext(arg0, "update") + return c.inner.Update(arg0, arg1, arg2) +} +func (c *withMetrics) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) { + defer c.recorder.RecordWithContext(arg0, "watch") + return c.inner.Watch(arg0, arg1) +} + +type withTracing struct { + inner k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClaimTemplateInterface + client string + kind string +} + +func (c *withTracing) Apply(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_resource_v1alpha1.ResourceClaimTemplateApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_resource_v1alpha1.ResourceClaimTemplate, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Apply"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Apply"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Apply(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) Create(arg0 context.Context, arg1 *k8s_io_api_resource_v1alpha1.ResourceClaimTemplate, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*k8s_io_api_resource_v1alpha1.ResourceClaimTemplate, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Create"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Create"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Create(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Delete"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Delete"), + ), + ) + defer span.End() + } + ret0 := c.inner.Delete(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret0) + } + return ret0 +} +func (c *withTracing) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) error { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "DeleteCollection"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("DeleteCollection"), + ), + ) + defer span.End() + } + ret0 := c.inner.DeleteCollection(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret0) + } + return ret0 +} +func (c *withTracing) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*k8s_io_api_resource_v1alpha1.ResourceClaimTemplate, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Get"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Get"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Get(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*k8s_io_api_resource_v1alpha1.ResourceClaimTemplateList, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "List"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("List"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.List(arg0, arg1) + if span != nil { + tracing.SetSpanStatus(span, 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) (*k8s_io_api_resource_v1alpha1.ResourceClaimTemplate, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Patch"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Patch"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) Update(arg0 context.Context, arg1 *k8s_io_api_resource_v1alpha1.ResourceClaimTemplate, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_resource_v1alpha1.ResourceClaimTemplate, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Update"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Update"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Update(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Watch"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Watch"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Watch(arg0, arg1) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} diff --git a/pkg/clients/kube/resourcev1alpha1/resourceclasses/resource.generated.go b/pkg/clients/kube/resourcev1alpha1/resourceclasses/resource.generated.go new file mode 100644 index 0000000000..b7ee295d26 --- /dev/null +++ b/pkg/clients/kube/resourcev1alpha1/resourceclasses/resource.generated.go @@ -0,0 +1,374 @@ +package resource + +import ( + context "context" + "fmt" + "time" + + "github.com/go-logr/logr" + "github.com/kyverno/kyverno/pkg/metrics" + "github.com/kyverno/kyverno/pkg/tracing" + "go.opentelemetry.io/otel/trace" + "go.uber.org/multierr" + k8s_io_api_resource_v1alpha1 "k8s.io/api/resource/v1alpha1" + k8s_io_apimachinery_pkg_apis_meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + k8s_io_apimachinery_pkg_types "k8s.io/apimachinery/pkg/types" + k8s_io_apimachinery_pkg_watch "k8s.io/apimachinery/pkg/watch" + k8s_io_client_go_applyconfigurations_resource_v1alpha1 "k8s.io/client-go/applyconfigurations/resource/v1alpha1" + k8s_io_client_go_kubernetes_typed_resource_v1alpha1 "k8s.io/client-go/kubernetes/typed/resource/v1alpha1" +) + +func WithLogging(inner k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClassInterface, logger logr.Logger) k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClassInterface { + return &withLogging{inner, logger} +} + +func WithMetrics(inner k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClassInterface, recorder metrics.Recorder) k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClassInterface { + return &withMetrics{inner, recorder} +} + +func WithTracing(inner k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClassInterface, client, kind string) k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClassInterface { + return &withTracing{inner, client, kind} +} + +type withLogging struct { + inner k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClassInterface + logger logr.Logger +} + +func (c *withLogging) Apply(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_resource_v1alpha1.ResourceClassApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_resource_v1alpha1.ResourceClass, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Apply") + ret0, ret1 := c.inner.Apply(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Apply failed", "duration", time.Since(start)) + } else { + logger.Info("Apply done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) Create(arg0 context.Context, arg1 *k8s_io_api_resource_v1alpha1.ResourceClass, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*k8s_io_api_resource_v1alpha1.ResourceClass, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Create") + ret0, ret1 := c.inner.Create(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Create failed", "duration", time.Since(start)) + } else { + logger.Info("Create done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error { + start := time.Now() + logger := c.logger.WithValues("operation", "Delete") + ret0 := c.inner.Delete(arg0, arg1, arg2) + if err := multierr.Combine(ret0); err != nil { + logger.Error(err, "Delete failed", "duration", time.Since(start)) + } else { + logger.Info("Delete done", "duration", time.Since(start)) + } + return ret0 +} +func (c *withLogging) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) error { + start := time.Now() + logger := c.logger.WithValues("operation", "DeleteCollection") + ret0 := c.inner.DeleteCollection(arg0, arg1, arg2) + if err := multierr.Combine(ret0); err != nil { + logger.Error(err, "DeleteCollection failed", "duration", time.Since(start)) + } else { + logger.Info("DeleteCollection done", "duration", time.Since(start)) + } + return ret0 +} +func (c *withLogging) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*k8s_io_api_resource_v1alpha1.ResourceClass, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Get") + ret0, ret1 := c.inner.Get(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Get failed", "duration", time.Since(start)) + } else { + logger.Info("Get done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*k8s_io_api_resource_v1alpha1.ResourceClassList, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "List") + ret0, ret1 := c.inner.List(arg0, arg1) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "List failed", "duration", time.Since(start)) + } else { + logger.Info("List done", "duration", time.Since(start)) + } + 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) (*k8s_io_api_resource_v1alpha1.ResourceClass, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Patch") + ret0, ret1 := c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Patch failed", "duration", time.Since(start)) + } else { + logger.Info("Patch done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) Update(arg0 context.Context, arg1 *k8s_io_api_resource_v1alpha1.ResourceClass, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_resource_v1alpha1.ResourceClass, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Update") + ret0, ret1 := c.inner.Update(arg0, arg1, arg2) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Update failed", "duration", time.Since(start)) + } else { + logger.Info("Update done", "duration", time.Since(start)) + } + return ret0, ret1 +} +func (c *withLogging) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) { + start := time.Now() + logger := c.logger.WithValues("operation", "Watch") + ret0, ret1 := c.inner.Watch(arg0, arg1) + if err := multierr.Combine(ret1); err != nil { + logger.Error(err, "Watch failed", "duration", time.Since(start)) + } else { + logger.Info("Watch done", "duration", time.Since(start)) + } + return ret0, ret1 +} + +type withMetrics struct { + inner k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClassInterface + recorder metrics.Recorder +} + +func (c *withMetrics) Apply(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_resource_v1alpha1.ResourceClassApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_resource_v1alpha1.ResourceClass, error) { + defer c.recorder.RecordWithContext(arg0, "apply") + return c.inner.Apply(arg0, arg1, arg2) +} +func (c *withMetrics) Create(arg0 context.Context, arg1 *k8s_io_api_resource_v1alpha1.ResourceClass, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*k8s_io_api_resource_v1alpha1.ResourceClass, error) { + defer c.recorder.RecordWithContext(arg0, "create") + return c.inner.Create(arg0, arg1, arg2) +} +func (c *withMetrics) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error { + defer c.recorder.RecordWithContext(arg0, "delete") + return c.inner.Delete(arg0, arg1, arg2) +} +func (c *withMetrics) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) error { + defer c.recorder.RecordWithContext(arg0, "delete_collection") + 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) (*k8s_io_api_resource_v1alpha1.ResourceClass, error) { + defer c.recorder.RecordWithContext(arg0, "get") + return c.inner.Get(arg0, arg1, arg2) +} +func (c *withMetrics) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*k8s_io_api_resource_v1alpha1.ResourceClassList, error) { + defer c.recorder.RecordWithContext(arg0, "list") + 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) (*k8s_io_api_resource_v1alpha1.ResourceClass, error) { + defer c.recorder.RecordWithContext(arg0, "patch") + return c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...) +} +func (c *withMetrics) Update(arg0 context.Context, arg1 *k8s_io_api_resource_v1alpha1.ResourceClass, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_resource_v1alpha1.ResourceClass, error) { + defer c.recorder.RecordWithContext(arg0, "update") + return c.inner.Update(arg0, arg1, arg2) +} +func (c *withMetrics) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) { + defer c.recorder.RecordWithContext(arg0, "watch") + return c.inner.Watch(arg0, arg1) +} + +type withTracing struct { + inner k8s_io_client_go_kubernetes_typed_resource_v1alpha1.ResourceClassInterface + client string + kind string +} + +func (c *withTracing) Apply(arg0 context.Context, arg1 *k8s_io_client_go_applyconfigurations_resource_v1alpha1.ResourceClassApplyConfiguration, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ApplyOptions) (*k8s_io_api_resource_v1alpha1.ResourceClass, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Apply"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Apply"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Apply(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) Create(arg0 context.Context, arg1 *k8s_io_api_resource_v1alpha1.ResourceClass, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*k8s_io_api_resource_v1alpha1.ResourceClass, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Create"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Create"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Create(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Delete"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Delete"), + ), + ) + defer span.End() + } + ret0 := c.inner.Delete(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret0) + } + return ret0 +} +func (c *withTracing) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) error { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "DeleteCollection"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("DeleteCollection"), + ), + ) + defer span.End() + } + ret0 := c.inner.DeleteCollection(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret0) + } + return ret0 +} +func (c *withTracing) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*k8s_io_api_resource_v1alpha1.ResourceClass, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Get"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Get"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Get(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*k8s_io_api_resource_v1alpha1.ResourceClassList, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "List"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("List"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.List(arg0, arg1) + if span != nil { + tracing.SetSpanStatus(span, 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) (*k8s_io_api_resource_v1alpha1.ResourceClass, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Patch"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Patch"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) Update(arg0 context.Context, arg1 *k8s_io_api_resource_v1alpha1.ResourceClass, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*k8s_io_api_resource_v1alpha1.ResourceClass, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Update"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Update"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Update(arg0, arg1, arg2) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} +func (c *withTracing) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) { + var span trace.Span + if tracing.IsInSpan(arg0) { + arg0, span = tracing.StartChildSpan( + arg0, + "", + fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Watch"), + trace.WithAttributes( + tracing.KubeClientGroupKey.String(c.client), + tracing.KubeClientKindKey.String(c.kind), + tracing.KubeClientOperationKey.String("Watch"), + ), + ) + defer span.End() + } + ret0, ret1 := c.inner.Watch(arg0, arg1) + if span != nil { + tracing.SetSpanStatus(span, ret1) + } + return ret0, ret1 +} diff --git a/pkg/clients/kyverno/discovery/resource.generated.go b/pkg/clients/kyverno/discovery/resource.generated.go index 95f17a290e..fa3e8de23e 100644 --- a/pkg/clients/kyverno/discovery/resource.generated.go +++ b/pkg/clients/kyverno/discovery/resource.generated.go @@ -122,6 +122,13 @@ func (c *withLogging) ServerVersion() (*k8s_io_apimachinery_pkg_version.Info, er } return ret0, ret1 } +func (c *withLogging) WithLegacy() k8s_io_client_go_discovery.DiscoveryInterface { + start := time.Now() + logger := c.logger.WithValues("operation", "WithLegacy") + ret0 := c.inner.WithLegacy() + logger.Info("WithLegacy done", "duration", time.Since(start)) + return ret0 +} type withMetrics struct { inner k8s_io_client_go_discovery.DiscoveryInterface @@ -164,6 +171,10 @@ func (c *withMetrics) ServerVersion() (*k8s_io_apimachinery_pkg_version.Info, er defer c.recorder.Record("server_version") return c.inner.ServerVersion() } +func (c *withMetrics) WithLegacy() k8s_io_client_go_discovery.DiscoveryInterface { + defer c.recorder.Record("with_legacy") + return c.inner.WithLegacy() +} type withTracing struct { inner k8s_io_client_go_discovery.DiscoveryInterface @@ -198,3 +209,6 @@ func (c *withTracing) ServerResourcesForGroupVersion(arg0 string) (*k8s_io_apima func (c *withTracing) ServerVersion() (*k8s_io_apimachinery_pkg_version.Info, error) { return c.inner.ServerVersion() } +func (c *withTracing) WithLegacy() k8s_io_client_go_discovery.DiscoveryInterface { + return c.inner.WithLegacy() +} diff --git a/pkg/controllers/report/aggregate/controller.go b/pkg/controllers/report/aggregate/controller.go index 80ed0d54ab..4ac92ff951 100644 --- a/pkg/controllers/report/aggregate/controller.go +++ b/pkg/controllers/report/aggregate/controller.go @@ -61,7 +61,7 @@ type controller struct { type policyMapEntry struct { policy kyvernov1.PolicyInterface - rules sets.String + rules sets.Set[string] } func keyFunc(obj metav1.Object) cache.ExplicitKey { @@ -236,7 +236,7 @@ func (c *controller) reconcileReport(ctx context.Context, policyMap map[string]p } func (c *controller) cleanReports(ctx context.Context, actual map[string]kyvernov1alpha2.ReportInterface, expected []kyvernov1alpha2.ReportInterface) error { - keep := sets.NewString() + keep := sets.New[string]() for _, obj := range expected { keep.Insert(obj.GetName()) } @@ -291,7 +291,7 @@ func (c *controller) createPolicyMap() (map[string]policyMapEntry, error) { } results[key] = policyMapEntry{ policy: cpol, - rules: sets.NewString(), + rules: sets.New[string](), } for _, rule := range autogen.ComputeRules(cpol) { results[key].rules.Insert(rule.Name) @@ -308,7 +308,7 @@ func (c *controller) createPolicyMap() (map[string]policyMapEntry, error) { } results[key] = policyMapEntry{ policy: pol, - rules: sets.NewString(), + rules: sets.New[string](), } for _, rule := range autogen.ComputeRules(pol) { results[key].rules.Insert(rule.Name) diff --git a/pkg/controllers/report/resource/controller.go b/pkg/controllers/report/resource/controller.go index 47190b099a..642dfdd5e8 100644 --- a/pkg/controllers/report/resource/controller.go +++ b/pkg/controllers/report/resource/controller.go @@ -22,6 +22,7 @@ import ( "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/tools/cache" watchTools "k8s.io/client-go/tools/watch" @@ -204,7 +205,7 @@ func (c *controller) updateDynamicWatchers(ctx context.Context) error { } kinds := utils.BuildKindSet(logger, utils.RemoveNonValidationPolicies(logger, append(clusterPolicies, policies...)...)...) gvrs := map[schema.GroupVersionKind]schema.GroupVersionResource{} - for _, kind := range kinds.List() { + for _, kind := range sets.List(kinds) { apiVersion, kind := kubeutils.GetKindFromGVK(kind) apiResource, _, gvr, err := c.client.Discovery().FindResource(apiVersion, kind) if err != nil { diff --git a/pkg/controllers/report/utils/utils.go b/pkg/controllers/report/utils/utils.go index 3e25d17b8e..5507cafc01 100644 --- a/pkg/controllers/report/utils/utils.go +++ b/pkg/controllers/report/utils/utils.go @@ -22,8 +22,8 @@ func CanBackgroundProcess(logger logr.Logger, p kyvernov1.PolicyInterface) bool return true } -func BuildKindSet(logger logr.Logger, policies ...kyvernov1.PolicyInterface) sets.String { - kinds := sets.NewString() +func BuildKindSet(logger logr.Logger, policies ...kyvernov1.PolicyInterface) sets.Set[string] { + kinds := sets.New[string]() for _, policy := range policies { for _, rule := range autogen.ComputeRules(policy) { if rule.HasValidate() || rule.HasVerifyImages() { @@ -59,8 +59,8 @@ func ReportsAreIdentical(before, after kyvernov1alpha2.ReportInterface) bool { if !reflect.DeepEqual(before.GetAnnotations(), after.GetAnnotations()) { return false } - bLabels := sets.NewString() - aLabels := sets.NewString() + bLabels := sets.New[string]() + aLabels := sets.New[string]() for key := range before.GetLabels() { bLabels.Insert(key) } diff --git a/pkg/controllers/webhook/controller.go b/pkg/controllers/webhook/controller.go index df18c3a5b1..6a589bbd2e 100644 --- a/pkg/controllers/webhook/controller.go +++ b/pkg/controllers/webhook/controller.go @@ -97,7 +97,7 @@ type controller struct { // state lock sync.Mutex - policyState map[string]sets.String + policyState map[string]sets.Set[string] } func NewController( @@ -139,9 +139,9 @@ func NewController( autoUpdateWebhooks: autoUpdateWebhooks, admissionReports: admissionReports, runtime: runtime, - policyState: map[string]sets.String{ - config.MutatingWebhookConfigurationName: sets.NewString(), - config.ValidatingWebhookConfigurationName: sets.NewString(), + policyState: map[string]sets.Set[string]{ + config.MutatingWebhookConfigurationName: sets.New[string](), + config.ValidatingWebhookConfigurationName: sets.New[string](), }, } controllerutils.AddDefaultEventHandlers(logger, mwcInformer.Informer(), queue) @@ -299,7 +299,7 @@ func (c *controller) recordPolicyState(webhookConfigurationName string, policies if _, ok := c.policyState[webhookConfigurationName]; !ok { return } - c.policyState[webhookConfigurationName] = sets.NewString() + c.policyState[webhookConfigurationName] = sets.New[string]() for _, policy := range policies { policyKey, err := cache.MetaNamespaceKeyFunc(policy) if err != nil { diff --git a/pkg/controllers/webhook/utils.go b/pkg/controllers/webhook/utils.go index 788965ba9a..7faa69b32d 100644 --- a/pkg/controllers/webhook/utils.go +++ b/pkg/controllers/webhook/utils.go @@ -30,12 +30,12 @@ func newWebhook(timeout int32, failurePolicy admissionregistrationv1.FailurePoli func (wh *webhook) buildRulesWithOperations(ops ...admissionregistrationv1.OperationType) []admissionregistrationv1.RuleWithOperations { var rules []admissionregistrationv1.RuleWithOperations for gvr := range wh.rules { - resources := sets.NewString(gvr.Resource) + resources := sets.New(gvr.Resource) rules = append(rules, admissionregistrationv1.RuleWithOperations{ Rule: admissionregistrationv1.Rule{ APIGroups: []string{gvr.Group}, APIVersions: []string{gvr.Version}, - Resources: resources.List(), + Resources: sets.List(resources), }, Operations: ops, }) diff --git a/pkg/policy/policy_controller.go b/pkg/policy/policy_controller.go index 1c8eda036f..46c142245d 100644 --- a/pkg/policy/policy_controller.go +++ b/pkg/policy/policy_controller.go @@ -294,13 +294,13 @@ func (pc *PolicyController) Run(ctx context.Context, workers int) { return } - pc.pInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ + _, _ = pc.pInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ AddFunc: pc.addPolicy, UpdateFunc: pc.updatePolicy, DeleteFunc: pc.deletePolicy, }) - pc.npInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ + _, _ = pc.npInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ AddFunc: pc.addNsPolicy, UpdateFunc: pc.updateNsPolicy, DeleteFunc: pc.deleteNsPolicy, diff --git a/pkg/policy/validate.go b/pkg/policy/validate.go index 6bf96fec9f..4f53fb2d10 100644 --- a/pkg/policy/validate.go +++ b/pkg/policy/validate.go @@ -151,7 +151,7 @@ func Validate(policy kyvernov1.PolicyInterface, client dclient.Interface, mock b } var res []*metav1.APIResourceList - clusterResources := sets.NewString() + clusterResources := sets.New[string]() if !mock && namespaced { // Get all the cluster type kind supported by cluster res, err = discovery.ServerPreferredResources(client.Discovery().DiscoveryInterface()) @@ -1118,7 +1118,7 @@ func validateMatchedResourceDescription(rd kyvernov1.ResourceDescription) (strin // checkClusterResourceInMatchAndExclude returns false if namespaced ClusterPolicy contains cluster wide resources in // Match and Exclude block -func checkClusterResourceInMatchAndExclude(rule kyvernov1.Rule, clusterResources sets.String, policyNamespace string, mock bool, res []*metav1.APIResourceList) error { +func checkClusterResourceInMatchAndExclude(rule kyvernov1.Rule, clusterResources sets.Set[string], policyNamespace string, mock bool, res []*metav1.APIResourceList) error { if !mock { // Check for generate policy // - if resource to be generated is namespaced resource then the namespace field @@ -1290,11 +1290,11 @@ func validateWildcardsWithNamespaces(enforce, audit, enforceW, auditW []string) } func validateNamespaces(s *kyvernov1.Spec, path *field.Path) error { - action := map[string]sets.String{ - "enforce": sets.NewString(), - "audit": sets.NewString(), - "enforceW": sets.NewString(), - "auditW": sets.NewString(), + action := map[string]sets.Set[string]{ + "enforce": sets.New[string](), + "audit": sets.New[string](), + "enforceW": sets.New[string](), + "auditW": sets.New[string](), } for i, vfa := range s.ValidationFailureActionOverrides { @@ -1303,19 +1303,24 @@ func validateNamespaces(s *kyvernov1.Spec, path *field.Path) error { if vfa.Action.Audit() { if action["enforce"].HasAny(nsList...) { return fmt.Errorf("conflicting namespaces found in path: %s: %s", path.Index(i).Child("namespaces").String(), - strings.Join(action["enforce"].Intersection(sets.NewString(nsList...)).List(), ", ")) + strings.Join(sets.List(action["enforce"].Intersection(sets.New(nsList...))), ", ")) } action["auditW"].Insert(patternList...) } else if vfa.Action.Enforce() { if action["audit"].HasAny(nsList...) { return fmt.Errorf("conflicting namespaces found in path: %s: %s", path.Index(i).Child("namespaces").String(), - strings.Join(action["audit"].Intersection(sets.NewString(nsList...)).List(), ", ")) + strings.Join(sets.List(action["audit"].Intersection(sets.New(nsList...))), ", ")) } action["enforceW"].Insert(patternList...) } action[strings.ToLower(string(vfa.Action))].Insert(nsList...) - err := validateWildcardsWithNamespaces(action["enforce"].List(), action["audit"].List(), action["enforceW"].List(), action["auditW"].List()) + err := validateWildcardsWithNamespaces( + sets.List(action["enforce"]), + sets.List(action["audit"]), + sets.List(action["enforceW"]), + sets.List(action["auditW"]), + ) if err != nil { return fmt.Errorf("path: %s: %s", path.Index(i).Child("namespaces").String(), err.Error()) } diff --git a/pkg/policy/validate_test.go b/pkg/policy/validate_test.go index 003e46cba6..a5861fe464 100644 --- a/pkg/policy/validate_test.go +++ b/pkg/policy/validate_test.go @@ -1252,7 +1252,7 @@ func Test_Namespaced_Generate_Policy(t *testing.T) { t.Run(tc.description, func(t *testing.T) { var rule kyverno.Rule _ = json.Unmarshal(tc.rule, &rule) - err := checkClusterResourceInMatchAndExclude(rule, sets.NewString(), tc.policyNamespace, false, testResourceList()) + err := checkClusterResourceInMatchAndExclude(rule, sets.New[string](), tc.policyNamespace, false, testResourceList()) if tc.expectedError != nil { assert.Error(t, err, tc.expectedError.Error()) } else { diff --git a/pkg/policycache/store.go b/pkg/policycache/store.go index 5baa36c8c2..502be354af 100644 --- a/pkg/policycache/store.go +++ b/pkg/policycache/store.go @@ -57,13 +57,13 @@ type policyMap struct { // Since both the policy name use same type (i.e. string), Both policies can be differentiated based on // "namespace". namespace policy get stored with policy namespace with policy name" // kindDataMap {"kind": {{"policytype" : {"policyName","nsname/policyName}}},"kind2": {{"policytype" : {"nsname/policyName" }}}} - kindType map[string]map[PolicyType]sets.String + kindType map[string]map[PolicyType]sets.Set[string] } func newPolicyMap() *policyMap { return &policyMap{ policies: map[string]kyvernov1.PolicyInterface{}, - kindType: map[string]map[PolicyType]sets.String{}, + kindType: map[string]map[PolicyType]sets.Set[string]{}, } } @@ -85,7 +85,7 @@ func computeEnforcePolicy(spec *kyvernov1.Spec) bool { return false } -func set(set sets.String, item string, value bool) sets.String { +func set(set sets.Set[string], item string, value bool) sets.Set[string] { if value { return set.Insert(item) } else { @@ -117,14 +117,14 @@ func (m *policyMap) set(key string, policy kyvernov1.PolicyInterface, subresourc } for kind, state := range kindStates { if m.kindType[kind] == nil { - m.kindType[kind] = map[PolicyType]sets.String{ - Mutate: sets.NewString(), - ValidateEnforce: sets.NewString(), - ValidateAudit: sets.NewString(), - Generate: sets.NewString(), - VerifyImagesMutate: sets.NewString(), - VerifyImagesValidate: sets.NewString(), - VerifyYAML: sets.NewString(), + m.kindType[kind] = map[PolicyType]sets.Set[string]{ + Mutate: sets.New[string](), + ValidateEnforce: sets.New[string](), + ValidateAudit: sets.New[string](), + Generate: sets.New[string](), + VerifyImagesMutate: sets.New[string](), + VerifyImagesValidate: sets.New[string](), + VerifyYAML: sets.New[string](), } } m.kindType[kind][Mutate] = set(m.kindType[kind][Mutate], key, state.hasMutate) diff --git a/pkg/utils/controller/handlers.go b/pkg/utils/controller/handlers.go index 26c3c22905..db992fe329 100644 --- a/pkg/utils/controller/handlers.go +++ b/pkg/utils/controller/handlers.go @@ -25,7 +25,7 @@ type ( ) func AddEventHandlers(informer cache.SharedInformer, a addFunc, u updateFunc, d deleteFunc) { - informer.AddEventHandler(cache.ResourceEventHandlerFuncs{ + _, _ = informer.AddEventHandler(cache.ResourceEventHandlerFuncs{ AddFunc: a, UpdateFunc: u, DeleteFunc: func(obj interface{}) { diff --git a/pkg/utils/controller/utils.go b/pkg/utils/controller/utils.go index 1adf751c44..7b7646da27 100644 --- a/pkg/utils/controller/utils.go +++ b/pkg/utils/controller/utils.go @@ -167,7 +167,7 @@ func UpdateStatus[T interface { } func Cleanup[T any, R Object[T]](ctx context.Context, actual []R, expected []R, deleter Deleter) error { - keep := sets.NewString() + keep := sets.New[string]() for _, obj := range expected { keep.Insert(obj.GetName()) } diff --git a/pkg/validation/cleanuppolicy/validate.go b/pkg/validation/cleanuppolicy/validate.go index c7fd8ff161..6a16e67d34 100644 --- a/pkg/validation/cleanuppolicy/validate.go +++ b/pkg/validation/cleanuppolicy/validate.go @@ -13,7 +13,7 @@ import ( ) // FetchClusteredResources retieves the list of clustered resources -func FetchClusteredResources(logger logr.Logger, client dclient.Interface) (sets.String, error) { +func FetchClusteredResources(logger logr.Logger, client dclient.Interface) (sets.Set[string], error) { res, err := discovery.ServerPreferredResources(client.Discovery().DiscoveryInterface()) if err != nil { if discovery.IsGroupDiscoveryFailedError(err) { @@ -25,7 +25,7 @@ func FetchClusteredResources(logger logr.Logger, client dclient.Interface) (sets return nil, err } } - clusterResources := sets.NewString() + clusterResources := sets.New[string]() for _, resList := range res { for _, r := range resList.APIResources { if !r.Namespaced { @@ -52,7 +52,7 @@ func Validate(ctx context.Context, logger logr.Logger, client dclient.Interface, } // validatePolicy checks the policy and rules declarations for required configurations -func validatePolicy(clusterResources sets.String, policy kyvernov2alpha1.CleanupPolicyInterface) error { +func validatePolicy(clusterResources sets.Set[string], policy kyvernov2alpha1.CleanupPolicyInterface) error { errs := policy.Validate(clusterResources) return errs.ToAggregate() } @@ -61,7 +61,7 @@ func validatePolicy(clusterResources sets.String, policy kyvernov2alpha1.Cleanup func validateAuth(ctx context.Context, client dclient.Interface, policy kyvernov2alpha1.CleanupPolicyInterface) error { namespace := policy.GetNamespace() spec := policy.GetSpec() - kinds := sets.NewString(spec.MatchResources.GetKinds()...) + kinds := sets.New(spec.MatchResources.GetKinds()...) for kind := range kinds { checker := auth.NewCanI(client, kind, namespace, "delete", "") allowed, err := checker.RunAccessCheck(ctx) diff --git a/pkg/webhooks/handlers/filter.go b/pkg/webhooks/handlers/filter.go index 41f4fb9f65..5f5e26aada 100644 --- a/pkg/webhooks/handlers/filter.go +++ b/pkg/webhooks/handlers/filter.go @@ -36,7 +36,7 @@ func (inner AdmissionHandler) withFilter(c config.Configuration) AdmissionHandle } func (inner AdmissionHandler) withOperationFilter(operations ...admissionv1.Operation) AdmissionHandler { - allowed := sets.NewString() + allowed := sets.New[string]() for _, operation := range operations { allowed.Insert(string(operation)) } @@ -49,7 +49,7 @@ func (inner AdmissionHandler) withOperationFilter(operations ...admissionv1.Oper } func (inner AdmissionHandler) withSubResourceFilter(subresources ...string) AdmissionHandler { - allowed := sets.NewString(subresources...) + allowed := sets.New(subresources...) return func(ctx context.Context, logger logr.Logger, request *admissionv1.AdmissionRequest, startTime time.Time) *admissionv1.AdmissionResponse { if request.SubResource == "" || allowed.Has(request.SubResource) { return inner(ctx, logger, request, startTime)