1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00

refactor: generate instrumented client code (#5362)

* refactor: generated instrumented client code

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* linter

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* kyverno client

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* client type

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* factory

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* linter

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* makefile

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* main

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* remove manually instrumented clients

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
This commit is contained in:
Charles-Edouard Brétéché 2022-11-17 17:01:30 +01:00 committed by GitHub
parent fdf5b840b6
commit 1f48610cd2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 7852 additions and 388 deletions

View file

@ -45,6 +45,7 @@ linters:
run:
timeout: 10m
skip-files:
- ".+\\.generated.go"
- ".+_test.go"
- ".+_test_.+.go"

View file

@ -339,8 +339,15 @@ codegen-client-informers: $(PACKAGE_SHIM) $(INFORMER_GEN) ## Generate informers
@echo Generate informers... >&2
@GOPATH=$(GOPATH_SHIM) $(INFORMER_GEN) --go-header-file ./scripts/boilerplate.go.txt --output-package $(INFORMERS_PACKAGE) --input-dirs $(INPUT_DIRS) --versioned-clientset-package $(CLIENTSET_PACKAGE)/versioned --listers-package $(LISTERS_PACKAGE)
.PHONY: codegen-client-wrappers
codegen-client-wrappers: $(GOIMPORTS) ## Generate client wrappers
@echo Generate client wrappers... >&2
@go run ./hack/main.go
@go fmt ./pkg/clients/wrappers/...
@$(GOIMPORTS) -w ./pkg/clients/wrappers
.PHONY: codegen-client-all
codegen-client-all: codegen-client-clientset codegen-client-listers codegen-client-informers ## Generate clientset, listers and informers
codegen-client-all: codegen-client-clientset codegen-client-listers codegen-client-informers codegen-client-wrappers ## Generate clientset, listers and informers
.PHONY: codegen-crds-kyverno
codegen-crds-kyverno: $(CONTROLLER_GEN) ## Generate kyverno CRDs

View file

@ -12,9 +12,8 @@ import (
"time"
"github.com/go-logr/logr"
"github.com/kyverno/kyverno/pkg/client/clientset/versioned"
"github.com/kyverno/kyverno/pkg/clients/dclient"
kyvernoclient "github.com/kyverno/kyverno/pkg/clients/wrappers"
kubeclient "github.com/kyverno/kyverno/pkg/clients/wrappers/kube"
"github.com/kyverno/kyverno/pkg/config"
"github.com/kyverno/kyverno/pkg/logging"
"github.com/kyverno/kyverno/pkg/metrics"
@ -59,7 +58,7 @@ func parseFlags() error {
return nil
}
func createKubeClients(logger logr.Logger) (*rest.Config, *kubernetes.Clientset, error) {
func createKubeClients(logger logr.Logger) (*rest.Config, kubernetes.Interface, error) {
logger = logger.WithName("kube-clients")
logger.Info("create kube clients...", "kubeconfig", kubeconfig, "qps", clientRateLimitQPS, "burst", clientRateLimitBurst)
clientConfig, err := config.CreateClientConfig(kubeconfig, clientRateLimitQPS, clientRateLimitBurst)
@ -73,10 +72,10 @@ func createKubeClients(logger logr.Logger) (*rest.Config, *kubernetes.Clientset,
return clientConfig, kubeClient, nil
}
func createInstrumentedClients(ctx context.Context, logger logr.Logger, clientConfig *rest.Config, kubeClient *kubernetes.Clientset, metricsConfig *metrics.MetricsConfig) (versioned.Interface, dclient.Interface, error) {
func createInstrumentedClients(ctx context.Context, logger logr.Logger, clientConfig *rest.Config, metricsConfig *metrics.MetricsConfig) (kubernetes.Interface, dclient.Interface, error) {
logger = logger.WithName("instrumented-clients")
logger.Info("create instrumented clients...", "kubeconfig", kubeconfig, "qps", clientRateLimitQPS, "burst", clientRateLimitBurst)
kyvernoClient, err := kyvernoclient.NewForConfig(clientConfig, metricsConfig)
kubeClient, err := kubeclient.NewForConfig(clientConfig, metricsConfig, metrics.KubeClient)
if err != nil {
return nil, nil, err
}
@ -84,7 +83,7 @@ func createInstrumentedClients(ctx context.Context, logger logr.Logger, clientCo
if err != nil {
return nil, nil, err
}
return kyvernoClient, dynamicClient, nil
return kubeClient, dynamicClient, nil
}
func setupMetrics(logger logr.Logger, kubeClient kubernetes.Interface) (*metrics.MetricsConfig, context.CancelFunc, error) {
@ -148,15 +147,15 @@ func main() {
}
logger := logging.WithName("setup")
// create client config and kube clients
clientConfig, kubeClient, err := createKubeClients(logger)
clientConfig, rawClient, err := createKubeClients(logger)
if err != nil {
os.Exit(1)
}
kubeKyvernoInformer := kubeinformers.NewSharedInformerFactoryWithOptions(kubeClient, resyncPeriod, kubeinformers.WithNamespace(config.KyvernoNamespace()))
// setup signals
signalCtx, signalCancel := setupSignals()
defer signalCancel()
metricsConfig, metricsShutdown, err := setupMetrics(logger, kubeClient)
// setup metrics
metricsConfig, metricsShutdown, err := setupMetrics(logger, rawClient)
if err != nil {
logger.Error(err, "failed to setup metrics")
os.Exit(1)
@ -164,11 +163,13 @@ func main() {
if metricsShutdown != nil {
defer metricsShutdown()
}
_, dynamicClient, err := createInstrumentedClients(signalCtx, logger, clientConfig, kubeClient, metricsConfig)
// create instrumented clients
kubeClient, dynamicClient, err := createInstrumentedClients(signalCtx, logger, clientConfig, metricsConfig)
if err != nil {
logger.Error(err, "failed to create instrument clients")
os.Exit(1)
}
kubeKyvernoInformer := kubeinformers.NewSharedInformerFactoryWithOptions(kubeClient, resyncPeriod, kubeinformers.WithNamespace(config.KyvernoNamespace()))
policyHandlers := NewHandlers(
dynamicClient,
)

View file

@ -21,7 +21,8 @@ import (
"github.com/kyverno/kyverno/pkg/client/clientset/versioned"
kyvernoinformer "github.com/kyverno/kyverno/pkg/client/informers/externalversions"
"github.com/kyverno/kyverno/pkg/clients/dclient"
kyvernoclient "github.com/kyverno/kyverno/pkg/clients/wrappers"
kubeclient "github.com/kyverno/kyverno/pkg/clients/wrappers/kube"
kyvernoclient "github.com/kyverno/kyverno/pkg/clients/wrappers/kyverno"
"github.com/kyverno/kyverno/pkg/config"
"github.com/kyverno/kyverno/pkg/controllers/certmanager"
configcontroller "github.com/kyverno/kyverno/pkg/controllers/config"
@ -53,8 +54,6 @@ import (
webhooksresource "github.com/kyverno/kyverno/pkg/webhooks/resource"
webhookgenerate "github.com/kyverno/kyverno/pkg/webhooks/updaterequest"
"go.uber.org/automaxprocs/maxprocs" // #nosec
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
coordinationv1 "k8s.io/api/coordination/v1"
corev1 "k8s.io/api/core/v1"
kubeinformers "k8s.io/client-go/informers"
"k8s.io/client-go/kubernetes"
@ -174,41 +173,45 @@ func startProfiling(logger logr.Logger) {
}
}
func createKubeClients(logger logr.Logger) (*rest.Config, *kubernetes.Clientset, metadataclient.Interface, kubernetes.Interface, error) {
func createKubeClients(logger logr.Logger) (*rest.Config, kubernetes.Interface, metadataclient.Interface, error) {
logger = logger.WithName("kube-clients")
logger.Info("create kube clients...", "kubeconfig", kubeconfig, "qps", clientRateLimitQPS, "burst", clientRateLimitBurst)
clientConfig, err := config.CreateClientConfig(kubeconfig, clientRateLimitQPS, clientRateLimitBurst)
if err != nil {
return nil, nil, nil, nil, err
return nil, nil, nil, err
}
kubeClient, err := kubernetes.NewForConfig(clientConfig)
if err != nil {
return nil, nil, nil, nil, err
return nil, nil, nil, err
}
metadataClient, err := metadataclient.NewForConfig(clientConfig)
if err != nil {
return nil, nil, nil, err
}
return clientConfig, kubeClient, metadataClient, nil
}
func createInstrumentedClients(ctx context.Context, logger logr.Logger, clientConfig *rest.Config, metricsConfig *metrics.MetricsConfig) (kubernetes.Interface, kubernetes.Interface, versioned.Interface, dclient.Interface, error) {
logger = logger.WithName("instrumented-clients")
logger.Info("create instrumented clients...", "kubeconfig", kubeconfig, "qps", clientRateLimitQPS, "burst", clientRateLimitBurst)
kubeClient, err := kubeclient.NewForConfig(clientConfig, metricsConfig, metrics.KubeClient)
if err != nil {
return nil, nil, nil, nil, err
}
// The leader queries/updates the lease object quite frequently. So we use a separate kube-client to eliminate the throttle issue
kubeClientLeaderElection, err := kubernetes.NewForConfig(clientConfig)
kubeClientLeaderElection, err := kubeclient.NewForConfig(clientConfig, metricsConfig, metrics.KubeClient)
if err != nil {
return nil, nil, nil, nil, err
}
return clientConfig, kubeClient, metadataClient, kubeClientLeaderElection, nil
}
func createInstrumentedClients(ctx context.Context, logger logr.Logger, clientConfig *rest.Config, kubeClient *kubernetes.Clientset, metricsConfig *metrics.MetricsConfig) (versioned.Interface, dclient.Interface, error) {
logger = logger.WithName("instrumented-clients")
logger.Info("create instrumented clients...", "kubeconfig", kubeconfig, "qps", clientRateLimitQPS, "burst", clientRateLimitBurst)
kyvernoClient, err := kyvernoclient.NewForConfig(clientConfig, metricsConfig)
kyvernoClient, err := kyvernoclient.NewForConfig(clientConfig, metricsConfig, metrics.KyvernoClient)
if err != nil {
return nil, nil, err
return nil, nil, nil, nil, err
}
dynamicClient, err := dclient.NewClient(ctx, clientConfig, kubeClient, metricsConfig, metadataResyncPeriod)
if err != nil {
return nil, nil, err
return nil, nil, nil, nil, err
}
return kyvernoClient, dynamicClient, nil
return kubeClient, kubeClientLeaderElection, kyvernoClient, dynamicClient, nil
}
func setupMetrics(logger logr.Logger, kubeClient kubernetes.Interface) (*metrics.MetricsConfig, context.CancelFunc, error) {
@ -476,22 +479,10 @@ func createrLeaderControllers(
)
webhookController := webhookcontroller.NewController(
dynamicClient.Discovery(),
metrics.ObjectClient[*corev1.Secret](
metrics.NamespacedClientQueryRecorder(metricsConfig, config.KyvernoNamespace(), "Secret", metrics.KubeClient),
kubeClient.CoreV1().Secrets(config.KyvernoNamespace()),
),
metrics.ObjectClient[*admissionregistrationv1.MutatingWebhookConfiguration](
metrics.ClusteredClientQueryRecorder(metricsConfig, "MutatingWebhookConfiguration", metrics.KubeClient),
kubeClient.AdmissionregistrationV1().MutatingWebhookConfigurations(),
),
metrics.ObjectClient[*admissionregistrationv1.ValidatingWebhookConfiguration](
metrics.ClusteredClientQueryRecorder(metricsConfig, "ValidatingWebhookConfiguration", metrics.KubeClient),
kubeClient.AdmissionregistrationV1().ValidatingWebhookConfigurations(),
),
metrics.ObjectClient[*coordinationv1.Lease](
metrics.ClusteredClientQueryRecorder(metricsConfig, "Lease", metrics.KubeClient),
kubeClient.CoordinationV1().Leases(config.KyvernoNamespace()),
),
kubeClient.CoreV1().Secrets(config.KyvernoNamespace()),
kubeClient.AdmissionregistrationV1().MutatingWebhookConfigurations(),
kubeClient.AdmissionregistrationV1().ValidatingWebhookConfigurations(),
kubeClient.CoordinationV1().Leases(config.KyvernoNamespace()),
kyvernoClient,
kubeInformer.Admissionregistration().V1().MutatingWebhookConfigurations(),
kubeInformer.Admissionregistration().V1().ValidatingWebhookConfigurations(),
@ -556,13 +547,13 @@ func main() {
// start profiling
startProfiling(logger)
// create client config and kube clients
clientConfig, kubeClient, metadataClient, kubeClientLeaderElection, err := createKubeClients(logger)
clientConfig, rawClient, metadataClient, err := createKubeClients(logger)
if err != nil {
logger.Error(err, "failed to create kubernetes clients")
os.Exit(1)
}
// setup metrics
metricsConfig, metricsShutdown, err := setupMetrics(logger, kubeClient)
metricsConfig, metricsShutdown, err := setupMetrics(logger, rawClient)
if err != nil {
logger.Error(err, "failed to setup metrics")
os.Exit(1)
@ -570,6 +561,15 @@ func main() {
if metricsShutdown != nil {
defer metricsShutdown()
}
// setup signals
signalCtx, signalCancel := setupSignals()
defer signalCancel()
// create instrumented clients
kubeClient, kubeClientLeaderElection, kyvernoClient, dynamicClient, err := createInstrumentedClients(signalCtx, logger, clientConfig, metricsConfig)
if err != nil {
logger.Error(err, "failed to create instrument clients")
os.Exit(1)
}
// setup tracing
if tracingShutdown, err := setupTracing(logger, kubeClient); err != nil {
logger.Error(err, "failed to setup tracing")
@ -584,15 +584,6 @@ func main() {
}
// setup cosign
setupCosign(logger)
// setup signals
signalCtx, signalCancel := setupSignals()
defer signalCancel()
// create instrumented clients
kyvernoClient, dynamicClient, err := createInstrumentedClients(signalCtx, logger, clientConfig, kubeClient, metricsConfig)
if err != nil {
logger.Error(err, "failed to create instrument clients")
os.Exit(1)
}
// check we can run
if err := sanityChecks(dynamicClient); err != nil {
logger.Error(err, "sanity checks failed")
@ -615,10 +606,7 @@ func main() {
os.Exit(1)
}
certRenewer := tls.NewCertRenewer(
metrics.ObjectClient[*corev1.Secret](
metrics.NamespacedClientQueryRecorder(metricsConfig, config.KyvernoNamespace(), "Secret", metrics.KubeClient),
kubeClient.CoreV1().Secrets(config.KyvernoNamespace()),
),
kubeClient.CoreV1().Secrets(config.KyvernoNamespace()),
tls.CertRenewalInterval,
tls.CAValidityDuration,
tls.TLSValidityDuration,
@ -788,18 +776,9 @@ func main() {
}
return secret.Data[corev1.TLSCertKey], secret.Data[corev1.TLSPrivateKeyKey], nil
},
metrics.ObjectClient[*admissionregistrationv1.MutatingWebhookConfiguration](
metrics.ClusteredClientQueryRecorder(metricsConfig, "MutatingWebhookConfiguration", metrics.KubeClient),
kubeClient.AdmissionregistrationV1().MutatingWebhookConfigurations(),
),
metrics.ObjectClient[*admissionregistrationv1.ValidatingWebhookConfiguration](
metrics.ClusteredClientQueryRecorder(metricsConfig, "ValidatingWebhookConfiguration", metrics.KubeClient),
kubeClient.AdmissionregistrationV1().ValidatingWebhookConfigurations(),
),
metrics.ObjectClient[*coordinationv1.Lease](
metrics.ClusteredClientQueryRecorder(metricsConfig, "Lease", metrics.KubeClient),
kubeClient.CoordinationV1().Leases(config.KyvernoNamespace()),
),
kubeClient.AdmissionregistrationV1().MutatingWebhookConfigurations(),
kubeClient.AdmissionregistrationV1().ValidatingWebhookConfigurations(),
kubeClient.CoordinationV1().Leases(config.KyvernoNamespace()),
runtime,
)
// start informers and wait for cache sync

322
hack/main.go Normal file
View file

@ -0,0 +1,322 @@
package main
import (
"fmt"
"os"
"path"
"reflect"
"regexp"
"strconv"
"strings"
"text/template"
"github.com/kyverno/kyverno/pkg/client/clientset/versioned"
"k8s.io/client-go/kubernetes"
)
var (
matchFirstCap = regexp.MustCompile("(.)([A-Z][a-z]+)")
matchAllCap = regexp.MustCompile("([a-z0-9])([A-Z])")
)
func lookupImports(in reflect.Type) map[string]string {
imports := map[string]string{}
for i := 0; i < in.NumMethod(); i++ {
clientType := in.Method(i).Type.Out(0)
imports["client_"+strings.ToLower(clientType.Name())] = clientType.PkgPath()
for j := 0; j < clientType.NumMethod(); j++ {
resourceType := clientType.Method(j).Type.Out(0)
imports["client_"+strings.ToLower(clientType.Name())+"_"+strings.ToLower(resourceType.Name())] = resourceType.PkgPath()
for k := 0; k < resourceType.NumMethod(); k++ {
method := resourceType.Method(k)
prefix := "api_" + strings.ToLower(clientType.Name()) + "_" + strings.ToLower(resourceType.Name()) + "_" + strings.ToLower(method.Name)
for a := 0; a < method.Type.NumIn(); a++ {
arg := method.Type.In(a)
if arg.Kind() == reflect.Pointer {
arg = arg.Elem()
}
p := arg.PkgPath()
if p != "" {
imports[prefix+"_in_"+strconv.Itoa(a)] = p
}
}
for a := 0; a < method.Type.NumOut(); a++ {
arg := method.Type.Out(a)
if arg.Kind() == reflect.Pointer {
arg = arg.Elem()
}
p := arg.PkgPath()
if p != "" {
imports[prefix+"_out_"+strconv.Itoa(a)] = p
}
}
}
}
}
imports2 := map[string]string{}
imports2["context"] = "context"
imports2["metav1"] = "k8s.io/apimachinery/pkg/apis/meta/v1"
imports2["types"] = "k8s.io/apimachinery/pkg/types"
imports2["restclient"] = "k8s.io/client-go/rest"
imports2["watch"] = "k8s.io/apimachinery/pkg/watch"
imports2["metrics"] = "github.com/kyverno/kyverno/pkg/metrics"
imports2["discovery"] = "k8s.io/client-go/discovery"
for _, v := range imports {
if v != "" {
k := strings.ReplaceAll(v, ".", "_")
k = strings.ReplaceAll(k, "-", "_")
k = strings.ReplaceAll(k, "/", "_")
imports2[k] = v
}
}
return imports2
}
func lookupImport(in string, imports map[string]string) string {
for k, v := range imports {
if v == in {
return k
}
}
return ""
}
func resolveType(in reflect.Type, imports map[string]string) string {
switch in.Kind() {
case reflect.Pointer:
return "*" + resolveType(in.Elem(), imports)
case reflect.Array:
return "[]" + resolveType(in.Elem(), imports)
case reflect.Slice:
return "[]" + resolveType(in.Elem(), imports)
case reflect.Map:
return "map[" + resolveType(in.Key(), imports) + "]" + resolveType(in.Elem(), imports)
}
pack := lookupImport(in.PkgPath(), imports)
if pack == "" {
return in.Name()
}
return pack + "." + in.Name()
}
func toSnakeCase(str string) string {
snake := matchFirstCap.ReplaceAllString(str, "${1}_${2}")
snake = matchAllCap.ReplaceAllString(snake, "${1}_${2}")
return strings.ToLower(snake)
}
func generateClient(in reflect.Type, folder string) {
imports := lookupImports(in)
tpl := `
package client
import (
versioned {{ Quote .PkgPath }}
{{- range $alias, $package := Imports }}
{{ $alias }} {{ Quote $package }}
{{- end }}
)
type clientset struct {
inner versioned.Interface
{{- range $cmethod := Methods . }}
{{- $clientType := index (Out $cmethod) 0 }}
{{ ToLower $cmethod.Name }} {{ Type $clientType }}
{{- end }}
}
func (c *clientset) Discovery() discovery.DiscoveryInterface {
return c.inner.Discovery()
}
func Wrap(inner versioned.Interface, m metrics.MetricsConfigManager, t metrics.ClientType) versioned.Interface {
return &clientset{
inner: inner,
{{- range $cmethod := Methods . }}
{{- $clientType := index (Out $cmethod) 0 }}
{{ ToLower $cmethod.Name }}: wrap{{ $clientType.Name }}(inner.{{ $cmethod.Name }}(), m, t),
{{- end }}
}
}
func NewForConfig(c *restclient.Config, m metrics.MetricsConfigManager, t metrics.ClientType) (versioned.Interface, error) {
inner, err := versioned.NewForConfig(c)
if err != nil {
return nil, err
}
return Wrap(inner, m, t), nil
}
{{- range $cmethod := Methods . }}
{{- $clientType := index (Out $cmethod) 0 }}
func (c *clientset) {{ $cmethod.Name }}() {{ Type $clientType }} {
return c.{{ ToLower $cmethod.Name }}
}
{{- end }}
{{- range $cmethod := Methods . }}
{{- $clientType := index (Out $cmethod) 0 }}
type wrapped{{ $clientType.Name }} struct {
inner {{ Type $clientType }}
metrics metrics.MetricsConfigManager
clientType metrics.ClientType
}
func wrap{{ $clientType.Name }}(inner {{ Type $clientType }}, metrics metrics.MetricsConfigManager, t metrics.ClientType) {{ Type $clientType }} {
return &wrapped{{ $clientType.Name }}{inner, metrics, t}
}
{{- range $rmethod := Methods $clientType }}
{{- if ne $rmethod.Name "RESTClient" }}
{{- $resourceType := index (Out $rmethod) 0 }}
type wrapped{{ $clientType.Name }}{{ $resourceType.Name }} struct {
inner {{ Type $resourceType }}
recorder metrics.Recorder
}
func wrap{{ $clientType.Name }}{{ $resourceType.Name }}(inner {{ Type $resourceType }}, recorder metrics.Recorder) {{ Type $resourceType }} {
return &wrapped{{ $clientType.Name }}{{ $resourceType.Name }}{inner, recorder}
}
{{- range $emethod := Methods $resourceType }}
func (c *wrapped{{ $clientType.Name }}{{ $resourceType.Name }}) {{ $emethod.Name }}(
{{- range $i, $argType := In $emethod -}}
{{- if IsVariadic $emethod $i -}}
arg{{ $i }} ...{{ Type $argType.Elem }},
{{- else -}}
arg{{ $i }} {{ Type $argType }},
{{- end -}}
{{- end -}}
) (
{{- range $returnType := Out $emethod -}}
{{ Type $returnType }},
{{- end -}}
) {
defer c.recorder.Record({{ Quote (Snake $emethod.Name) }})
return c.inner.{{ $emethod.Name }}(
{{- range $i, $_ := In $emethod -}}
{{- if IsVariadic $emethod $i -}}
arg{{ $i }}...,
{{- else -}}
arg{{ $i }},
{{- end -}}
{{- end -}}
)
}
{{- end }}
func (c *wrapped{{ $clientType.Name }}) {{ $rmethod.Name }}(
{{- range $i, $argType := In $rmethod -}}
arg{{ $i }} {{ Type $argType }},
{{- end -}}
) (
{{- range $returnType := Out $rmethod -}}
{{ Type $returnType }},
{{- end -}}
) {
{{- $returnType := index (Out $rmethod) 0 }}
{{- if IsNamespaced $rmethod }}
recorder := metrics.NamespacedClientQueryRecorder(c.metrics, arg0, {{ Quote (Kind $returnType.Name) }}, c.clientType)
{{- else }}
recorder := metrics.ClusteredClientQueryRecorder(c.metrics, {{ Quote (Kind $returnType.Name) }}, c.clientType)
{{- end }}
return wrap{{ $clientType.Name }}{{ $resourceType.Name }}(c.inner.{{ $rmethod.Name }}(
{{- range $i, $_ := In $rmethod -}}
arg{{ $i }},
{{- end -}}
), recorder)
}
{{- end }}
{{- end }}
func (c *wrapped{{ $clientType.Name }}) RESTClient() restclient.Interface {
return c.inner.RESTClient()
}
{{- end }}
`
tmpl := template.New("xxx")
tmpl.Funcs(
template.FuncMap{
"Imports": func() map[string]string {
return imports
},
"Import": func(t reflect.Type) string {
pkg := t.PkgPath()
for k, v := range imports {
if v == pkg {
return k
}
}
return ""
},
"Methods": func(t reflect.Type) []reflect.Method {
var methods []reflect.Method
for i := 0; i < t.NumMethod(); i++ {
if t.Method(i).Name != "Discovery" {
methods = append(methods, t.Method(i))
}
}
return methods
},
"PkgPath": func(t reflect.Type) string {
return t.String()
},
"Out": func(in reflect.Method) []reflect.Type {
var out []reflect.Type
for i := 0; i < in.Type.NumOut(); i++ {
out = append(out, in.Type.Out(i))
}
return out
},
"In": func(in reflect.Method) []reflect.Type {
var out []reflect.Type
for i := 0; i < in.Type.NumIn(); i++ {
out = append(out, in.Type.In(i))
}
return out
},
"ToLower": func(in string) string {
return strings.ToLower(in)
},
"Quote": func(in string) string {
return `"` + in + `"`
},
"Type": func(in reflect.Type) string {
return resolveType(in, imports)
},
"IsVariadic": func(in reflect.Method, idx int) bool {
return idx == in.Type.NumIn()-1 && in.Type.IsVariadic()
},
"Kind": func(in string) string {
return strings.ReplaceAll(in, "Interface", "")
},
"IsNamespaced": func(in reflect.Method) bool {
return in.Type.NumIn() != 0
},
"Snake": func(in string) string {
return toSnakeCase(in)
},
},
)
if tmpl, err := tmpl.Parse(tpl); err != nil {
panic(err)
} else {
if err := os.MkdirAll(folder, 0o755); err != nil {
panic(fmt.Sprintf("Failed to create directories for %s", folder))
}
file := "clientset.generated.go"
f, err := os.Create(path.Join(folder, file))
if err != nil {
panic(fmt.Sprintf("Failed to create file %s", path.Join(folder, file)))
}
if err := tmpl.Execute(f, in); err != nil {
panic(err)
}
}
}
func main() {
kube := reflect.TypeOf((*kubernetes.Interface)(nil)).Elem()
kyverno := reflect.TypeOf((*versioned.Interface)(nil)).Elem()
generateClient(kube, "pkg/clients/wrappers/kube")
generateClient(kyverno, "pkg/clients/wrappers/kyverno")
}

View file

@ -63,7 +63,7 @@ type client struct {
}
// NewClient creates new instance of client
func NewClient(ctx context.Context, config *rest.Config, kclient *kubernetes.Clientset, metricsConfig metrics.MetricsConfigManager, resync time.Duration) (Interface, error) {
func NewClient(ctx context.Context, config *rest.Config, kclient kubernetes.Interface, metricsConfig metrics.MetricsConfigManager, resync time.Duration) (Interface, error) {
dclient, err := dynamic.NewForConfig(config)
if err != nil {
return nil, err
@ -72,7 +72,7 @@ func NewClient(ctx context.Context, config *rest.Config, kclient *kubernetes.Cli
client: dclient,
clientConfig: config,
kclient: kclient,
restClient: kclient.RESTClient(),
restClient: kclient.Discovery().RESTClient(),
}
if metricsConfig != nil {

View file

@ -1,61 +0,0 @@
package kyvernoclient
import (
"github.com/kyverno/kyverno/pkg/client/clientset/versioned"
versionedkyvernov1 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/kyverno/v1"
versionedkyvernov1alpha1 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/kyverno/v1alpha1"
versionedkyvernov1alpha2 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/kyverno/v1alpha2"
versionedkyvernov1beta1 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/kyverno/v1beta1"
versionedpolicyreportv1alpha2 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/policyreport/v1alpha2"
wrappedkyvernov1 "github.com/kyverno/kyverno/pkg/clients/wrappers/kyverno/v1"
wrappedkyvernov1alpha1 "github.com/kyverno/kyverno/pkg/clients/wrappers/kyverno/v1alpha1"
wrappedkyvernov1alpha2 "github.com/kyverno/kyverno/pkg/clients/wrappers/kyverno/v1alpha2"
wrappedkyvernov1beta1 "github.com/kyverno/kyverno/pkg/clients/wrappers/kyverno/v1beta1"
wrappedwgpolicyk8sv1alpha2 "github.com/kyverno/kyverno/pkg/clients/wrappers/policyreport/v1alpha2"
"github.com/kyverno/kyverno/pkg/metrics"
"k8s.io/client-go/rest"
)
type clientset struct {
versioned.Interface
kyvernoV1 versionedkyvernov1.KyvernoV1Interface
kyvernoV1beta1 versionedkyvernov1beta1.KyvernoV1beta1Interface
kyvernoV1alpha2 versionedkyvernov1alpha2.KyvernoV1alpha2Interface
kyvernoV1alpha1 versionedkyvernov1alpha1.KyvernoV1alpha1Interface
wgpolicyk8sV1alpha2 versionedpolicyreportv1alpha2.Wgpolicyk8sV1alpha2Interface
}
func (c *clientset) KyvernoV1() versionedkyvernov1.KyvernoV1Interface {
return c.kyvernoV1
}
func (c *clientset) KyvernoV1beta1() versionedkyvernov1beta1.KyvernoV1beta1Interface {
return c.kyvernoV1beta1
}
func (c *clientset) KyvernoV1alpha2() versionedkyvernov1alpha2.KyvernoV1alpha2Interface {
return c.kyvernoV1alpha2
}
func (c *clientset) KyvernoV1alpha1() versionedkyvernov1alpha1.KyvernoV1alpha1Interface {
return c.kyvernoV1alpha1
}
func (c *clientset) Wgpolicyk8sV1alpha2() versionedpolicyreportv1alpha2.Wgpolicyk8sV1alpha2Interface {
return c.wgpolicyk8sV1alpha2
}
func NewForConfig(c *rest.Config, m metrics.MetricsConfigManager) (versioned.Interface, error) {
kClientset, err := versioned.NewForConfig(c)
if err != nil {
return nil, err
}
return &clientset{
Interface: kClientset,
kyvernoV1: wrappedkyvernov1.Wrap(kClientset.KyvernoV1(), m),
kyvernoV1beta1: wrappedkyvernov1beta1.Wrap(kClientset.KyvernoV1beta1(), m),
kyvernoV1alpha2: wrappedkyvernov1alpha2.Wrap(kClientset.KyvernoV1alpha2(), m),
kyvernoV1alpha1: wrappedkyvernov1alpha1.Wrap(kClientset.KyvernoV1alpha1(), m),
wgpolicyk8sV1alpha2: wrappedwgpolicyk8sv1alpha2.Wrap(kClientset.Wgpolicyk8sV1alpha2(), m),
}, nil
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,714 @@
package client
import (
context "context"
github_com_kyverno_kyverno_api_kyverno_v1 "github.com/kyverno/kyverno/api/kyverno/v1"
github_com_kyverno_kyverno_api_kyverno_v1alpha1 "github.com/kyverno/kyverno/api/kyverno/v1alpha1"
github_com_kyverno_kyverno_api_kyverno_v1alpha2 "github.com/kyverno/kyverno/api/kyverno/v1alpha2"
github_com_kyverno_kyverno_api_kyverno_v1beta1 "github.com/kyverno/kyverno/api/kyverno/v1beta1"
github_com_kyverno_kyverno_api_policyreport_v1alpha2 "github.com/kyverno/kyverno/api/policyreport/v1alpha2"
versioned "github.com/kyverno/kyverno/pkg/client/clientset/versioned"
github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/kyverno/v1"
github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha1 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/kyverno/v1alpha1"
github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha2 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/kyverno/v1alpha2"
github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1beta1 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/kyverno/v1beta1"
github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_policyreport_v1alpha2 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/policyreport/v1alpha2"
metrics "github.com/kyverno/kyverno/pkg/metrics"
k8s_io_apimachinery_pkg_apis_meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
k8s_io_apimachinery_pkg_types "k8s.io/apimachinery/pkg/types"
types "k8s.io/apimachinery/pkg/types"
k8s_io_apimachinery_pkg_watch "k8s.io/apimachinery/pkg/watch"
watch "k8s.io/apimachinery/pkg/watch"
discovery "k8s.io/client-go/discovery"
restclient "k8s.io/client-go/rest"
)
type clientset struct {
inner versioned.Interface
kyvernov1 github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1.KyvernoV1Interface
kyvernov1alpha1 github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha1.KyvernoV1alpha1Interface
kyvernov1alpha2 github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha2.KyvernoV1alpha2Interface
kyvernov1beta1 github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1beta1.KyvernoV1beta1Interface
wgpolicyk8sv1alpha2 github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_policyreport_v1alpha2.Wgpolicyk8sV1alpha2Interface
}
func (c *clientset) Discovery() discovery.DiscoveryInterface {
return c.inner.Discovery()
}
func Wrap(inner versioned.Interface, m metrics.MetricsConfigManager, t metrics.ClientType) versioned.Interface {
return &clientset{
inner: inner,
kyvernov1: wrapKyvernoV1Interface(inner.KyvernoV1(), m, t),
kyvernov1alpha1: wrapKyvernoV1alpha1Interface(inner.KyvernoV1alpha1(), m, t),
kyvernov1alpha2: wrapKyvernoV1alpha2Interface(inner.KyvernoV1alpha2(), m, t),
kyvernov1beta1: wrapKyvernoV1beta1Interface(inner.KyvernoV1beta1(), m, t),
wgpolicyk8sv1alpha2: wrapWgpolicyk8sV1alpha2Interface(inner.Wgpolicyk8sV1alpha2(), m, t),
}
}
func NewForConfig(c *restclient.Config, m metrics.MetricsConfigManager, t metrics.ClientType) (versioned.Interface, error) {
inner, err := versioned.NewForConfig(c)
if err != nil {
return nil, err
}
return Wrap(inner, m, t), nil
}
func (c *clientset) KyvernoV1() github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1.KyvernoV1Interface {
return c.kyvernov1
}
func (c *clientset) KyvernoV1alpha1() github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha1.KyvernoV1alpha1Interface {
return c.kyvernov1alpha1
}
func (c *clientset) KyvernoV1alpha2() github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha2.KyvernoV1alpha2Interface {
return c.kyvernov1alpha2
}
func (c *clientset) KyvernoV1beta1() github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1beta1.KyvernoV1beta1Interface {
return c.kyvernov1beta1
}
func (c *clientset) Wgpolicyk8sV1alpha2() github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_policyreport_v1alpha2.Wgpolicyk8sV1alpha2Interface {
return c.wgpolicyk8sv1alpha2
}
type wrappedKyvernoV1Interface struct {
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1.KyvernoV1Interface
metrics metrics.MetricsConfigManager
clientType metrics.ClientType
}
func wrapKyvernoV1Interface(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1.KyvernoV1Interface, metrics metrics.MetricsConfigManager, t metrics.ClientType) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1.KyvernoV1Interface {
return &wrappedKyvernoV1Interface{inner, metrics, t}
}
type wrappedKyvernoV1InterfaceClusterPolicyInterface struct {
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1.ClusterPolicyInterface
recorder metrics.Recorder
}
func wrapKyvernoV1InterfaceClusterPolicyInterface(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1.ClusterPolicyInterface, recorder metrics.Recorder) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1.ClusterPolicyInterface {
return &wrappedKyvernoV1InterfaceClusterPolicyInterface{inner, recorder}
}
func (c *wrappedKyvernoV1InterfaceClusterPolicyInterface) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v1.ClusterPolicy, arg2 metav1.CreateOptions) (*github_com_kyverno_kyverno_api_kyverno_v1.ClusterPolicy, error) {
defer c.recorder.Record("create")
return c.inner.Create(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1InterfaceClusterPolicyInterface) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error {
defer c.recorder.Record("delete")
return c.inner.Delete(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1InterfaceClusterPolicyInterface) 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.Record("delete_collection")
return c.inner.DeleteCollection(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1InterfaceClusterPolicyInterface) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_kyverno_v1.ClusterPolicy, error) {
defer c.recorder.Record("get")
return c.inner.Get(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1InterfaceClusterPolicyInterface) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_kyverno_v1.ClusterPolicyList, error) {
defer c.recorder.Record("list")
return c.inner.List(arg0, arg1)
}
func (c *wrappedKyvernoV1InterfaceClusterPolicyInterface) Patch(arg0 context.Context, arg1 string, arg2 types.PatchType, arg3 []uint8, arg4 metav1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_kyverno_v1.ClusterPolicy, error) {
defer c.recorder.Record("patch")
return c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...)
}
func (c *wrappedKyvernoV1InterfaceClusterPolicyInterface) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v1.ClusterPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v1.ClusterPolicy, error) {
defer c.recorder.Record("update")
return c.inner.Update(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1InterfaceClusterPolicyInterface) UpdateStatus(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v1.ClusterPolicy, arg2 metav1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v1.ClusterPolicy, error) {
defer c.recorder.Record("update_status")
return c.inner.UpdateStatus(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1InterfaceClusterPolicyInterface) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) {
defer c.recorder.Record("watch")
return c.inner.Watch(arg0, arg1)
}
func (c *wrappedKyvernoV1Interface) ClusterPolicies() github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1.ClusterPolicyInterface {
recorder := metrics.ClusteredClientQueryRecorder(c.metrics, "ClusterPolicy", c.clientType)
return wrapKyvernoV1InterfaceClusterPolicyInterface(c.inner.ClusterPolicies(), recorder)
}
type wrappedKyvernoV1InterfaceGenerateRequestInterface struct {
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1.GenerateRequestInterface
recorder metrics.Recorder
}
func wrapKyvernoV1InterfaceGenerateRequestInterface(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1.GenerateRequestInterface, recorder metrics.Recorder) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1.GenerateRequestInterface {
return &wrappedKyvernoV1InterfaceGenerateRequestInterface{inner, recorder}
}
func (c *wrappedKyvernoV1InterfaceGenerateRequestInterface) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v1.GenerateRequest, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_kyverno_v1.GenerateRequest, error) {
defer c.recorder.Record("create")
return c.inner.Create(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1InterfaceGenerateRequestInterface) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error {
defer c.recorder.Record("delete")
return c.inner.Delete(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1InterfaceGenerateRequestInterface) 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.Record("delete_collection")
return c.inner.DeleteCollection(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1InterfaceGenerateRequestInterface) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_kyverno_v1.GenerateRequest, error) {
defer c.recorder.Record("get")
return c.inner.Get(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1InterfaceGenerateRequestInterface) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_kyverno_v1.GenerateRequestList, error) {
defer c.recorder.Record("list")
return c.inner.List(arg0, arg1)
}
func (c *wrappedKyvernoV1InterfaceGenerateRequestInterface) Patch(arg0 context.Context, arg1 string, arg2 types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_kyverno_v1.GenerateRequest, error) {
defer c.recorder.Record("patch")
return c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...)
}
func (c *wrappedKyvernoV1InterfaceGenerateRequestInterface) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v1.GenerateRequest, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v1.GenerateRequest, error) {
defer c.recorder.Record("update")
return c.inner.Update(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1InterfaceGenerateRequestInterface) UpdateStatus(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v1.GenerateRequest, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v1.GenerateRequest, error) {
defer c.recorder.Record("update_status")
return c.inner.UpdateStatus(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1InterfaceGenerateRequestInterface) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) {
defer c.recorder.Record("watch")
return c.inner.Watch(arg0, arg1)
}
func (c *wrappedKyvernoV1Interface) GenerateRequests(arg0 string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1.GenerateRequestInterface {
recorder := metrics.NamespacedClientQueryRecorder(c.metrics, arg0, "GenerateRequest", c.clientType)
return wrapKyvernoV1InterfaceGenerateRequestInterface(c.inner.GenerateRequests(arg0), recorder)
}
type wrappedKyvernoV1InterfacePolicyInterface struct {
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1.PolicyInterface
recorder metrics.Recorder
}
func wrapKyvernoV1InterfacePolicyInterface(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1.PolicyInterface, recorder metrics.Recorder) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1.PolicyInterface {
return &wrappedKyvernoV1InterfacePolicyInterface{inner, recorder}
}
func (c *wrappedKyvernoV1InterfacePolicyInterface) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v1.Policy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_kyverno_v1.Policy, error) {
defer c.recorder.Record("create")
return c.inner.Create(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1InterfacePolicyInterface) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error {
defer c.recorder.Record("delete")
return c.inner.Delete(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1InterfacePolicyInterface) 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.Record("delete_collection")
return c.inner.DeleteCollection(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1InterfacePolicyInterface) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_kyverno_v1.Policy, error) {
defer c.recorder.Record("get")
return c.inner.Get(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1InterfacePolicyInterface) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_kyverno_v1.PolicyList, error) {
defer c.recorder.Record("list")
return c.inner.List(arg0, arg1)
}
func (c *wrappedKyvernoV1InterfacePolicyInterface) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_kyverno_v1.Policy, error) {
defer c.recorder.Record("patch")
return c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...)
}
func (c *wrappedKyvernoV1InterfacePolicyInterface) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v1.Policy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v1.Policy, error) {
defer c.recorder.Record("update")
return c.inner.Update(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1InterfacePolicyInterface) UpdateStatus(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v1.Policy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v1.Policy, error) {
defer c.recorder.Record("update_status")
return c.inner.UpdateStatus(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1InterfacePolicyInterface) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (watch.Interface, error) {
defer c.recorder.Record("watch")
return c.inner.Watch(arg0, arg1)
}
func (c *wrappedKyvernoV1Interface) Policies(arg0 string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1.PolicyInterface {
recorder := metrics.NamespacedClientQueryRecorder(c.metrics, arg0, "Policy", c.clientType)
return wrapKyvernoV1InterfacePolicyInterface(c.inner.Policies(arg0), recorder)
}
func (c *wrappedKyvernoV1Interface) RESTClient() restclient.Interface {
return c.inner.RESTClient()
}
type wrappedKyvernoV1alpha1Interface struct {
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha1.KyvernoV1alpha1Interface
metrics metrics.MetricsConfigManager
clientType metrics.ClientType
}
func wrapKyvernoV1alpha1Interface(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha1.KyvernoV1alpha1Interface, metrics metrics.MetricsConfigManager, t metrics.ClientType) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha1.KyvernoV1alpha1Interface {
return &wrappedKyvernoV1alpha1Interface{inner, metrics, t}
}
type wrappedKyvernoV1alpha1InterfaceCleanupPolicyInterface struct {
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha1.CleanupPolicyInterface
recorder metrics.Recorder
}
func wrapKyvernoV1alpha1InterfaceCleanupPolicyInterface(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha1.CleanupPolicyInterface, recorder metrics.Recorder) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha1.CleanupPolicyInterface {
return &wrappedKyvernoV1alpha1InterfaceCleanupPolicyInterface{inner, recorder}
}
func (c *wrappedKyvernoV1alpha1InterfaceCleanupPolicyInterface) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v1alpha1.CleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_kyverno_v1alpha1.CleanupPolicy, error) {
defer c.recorder.Record("create")
return c.inner.Create(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1alpha1InterfaceCleanupPolicyInterface) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error {
defer c.recorder.Record("delete")
return c.inner.Delete(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1alpha1InterfaceCleanupPolicyInterface) 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.Record("delete_collection")
return c.inner.DeleteCollection(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1alpha1InterfaceCleanupPolicyInterface) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_kyverno_v1alpha1.CleanupPolicy, error) {
defer c.recorder.Record("get")
return c.inner.Get(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1alpha1InterfaceCleanupPolicyInterface) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_kyverno_v1alpha1.CleanupPolicyList, error) {
defer c.recorder.Record("list")
return c.inner.List(arg0, arg1)
}
func (c *wrappedKyvernoV1alpha1InterfaceCleanupPolicyInterface) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_types.PatchType, arg3 []uint8, arg4 metav1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_kyverno_v1alpha1.CleanupPolicy, error) {
defer c.recorder.Record("patch")
return c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...)
}
func (c *wrappedKyvernoV1alpha1InterfaceCleanupPolicyInterface) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v1alpha1.CleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v1alpha1.CleanupPolicy, error) {
defer c.recorder.Record("update")
return c.inner.Update(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1alpha1InterfaceCleanupPolicyInterface) UpdateStatus(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v1alpha1.CleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v1alpha1.CleanupPolicy, error) {
defer c.recorder.Record("update_status")
return c.inner.UpdateStatus(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1alpha1InterfaceCleanupPolicyInterface) Watch(arg0 context.Context, arg1 metav1.ListOptions) (watch.Interface, error) {
defer c.recorder.Record("watch")
return c.inner.Watch(arg0, arg1)
}
func (c *wrappedKyvernoV1alpha1Interface) CleanupPolicies(arg0 string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha1.CleanupPolicyInterface {
recorder := metrics.NamespacedClientQueryRecorder(c.metrics, arg0, "CleanupPolicy", c.clientType)
return wrapKyvernoV1alpha1InterfaceCleanupPolicyInterface(c.inner.CleanupPolicies(arg0), recorder)
}
type wrappedKyvernoV1alpha1InterfaceClusterCleanupPolicyInterface struct {
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha1.ClusterCleanupPolicyInterface
recorder metrics.Recorder
}
func wrapKyvernoV1alpha1InterfaceClusterCleanupPolicyInterface(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha1.ClusterCleanupPolicyInterface, recorder metrics.Recorder) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha1.ClusterCleanupPolicyInterface {
return &wrappedKyvernoV1alpha1InterfaceClusterCleanupPolicyInterface{inner, recorder}
}
func (c *wrappedKyvernoV1alpha1InterfaceClusterCleanupPolicyInterface) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v1alpha1.ClusterCleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_kyverno_v1alpha1.ClusterCleanupPolicy, error) {
defer c.recorder.Record("create")
return c.inner.Create(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1alpha1InterfaceClusterCleanupPolicyInterface) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error {
defer c.recorder.Record("delete")
return c.inner.Delete(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1alpha1InterfaceClusterCleanupPolicyInterface) 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.Record("delete_collection")
return c.inner.DeleteCollection(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1alpha1InterfaceClusterCleanupPolicyInterface) Get(arg0 context.Context, arg1 string, arg2 metav1.GetOptions) (*github_com_kyverno_kyverno_api_kyverno_v1alpha1.ClusterCleanupPolicy, error) {
defer c.recorder.Record("get")
return c.inner.Get(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1alpha1InterfaceClusterCleanupPolicyInterface) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_kyverno_v1alpha1.ClusterCleanupPolicyList, error) {
defer c.recorder.Record("list")
return c.inner.List(arg0, arg1)
}
func (c *wrappedKyvernoV1alpha1InterfaceClusterCleanupPolicyInterface) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_kyverno_v1alpha1.ClusterCleanupPolicy, error) {
defer c.recorder.Record("patch")
return c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...)
}
func (c *wrappedKyvernoV1alpha1InterfaceClusterCleanupPolicyInterface) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v1alpha1.ClusterCleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v1alpha1.ClusterCleanupPolicy, error) {
defer c.recorder.Record("update")
return c.inner.Update(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1alpha1InterfaceClusterCleanupPolicyInterface) UpdateStatus(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v1alpha1.ClusterCleanupPolicy, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v1alpha1.ClusterCleanupPolicy, error) {
defer c.recorder.Record("update_status")
return c.inner.UpdateStatus(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1alpha1InterfaceClusterCleanupPolicyInterface) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (watch.Interface, error) {
defer c.recorder.Record("watch")
return c.inner.Watch(arg0, arg1)
}
func (c *wrappedKyvernoV1alpha1Interface) ClusterCleanupPolicies() github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha1.ClusterCleanupPolicyInterface {
recorder := metrics.ClusteredClientQueryRecorder(c.metrics, "ClusterCleanupPolicy", c.clientType)
return wrapKyvernoV1alpha1InterfaceClusterCleanupPolicyInterface(c.inner.ClusterCleanupPolicies(), recorder)
}
func (c *wrappedKyvernoV1alpha1Interface) RESTClient() restclient.Interface {
return c.inner.RESTClient()
}
type wrappedKyvernoV1alpha2Interface struct {
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha2.KyvernoV1alpha2Interface
metrics metrics.MetricsConfigManager
clientType metrics.ClientType
}
func wrapKyvernoV1alpha2Interface(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha2.KyvernoV1alpha2Interface, metrics metrics.MetricsConfigManager, t metrics.ClientType) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha2.KyvernoV1alpha2Interface {
return &wrappedKyvernoV1alpha2Interface{inner, metrics, t}
}
type wrappedKyvernoV1alpha2InterfaceAdmissionReportInterface struct {
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha2.AdmissionReportInterface
recorder metrics.Recorder
}
func wrapKyvernoV1alpha2InterfaceAdmissionReportInterface(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha2.AdmissionReportInterface, recorder metrics.Recorder) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha2.AdmissionReportInterface {
return &wrappedKyvernoV1alpha2InterfaceAdmissionReportInterface{inner, recorder}
}
func (c *wrappedKyvernoV1alpha2InterfaceAdmissionReportInterface) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v1alpha2.AdmissionReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_kyverno_v1alpha2.AdmissionReport, error) {
defer c.recorder.Record("create")
return c.inner.Create(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1alpha2InterfaceAdmissionReportInterface) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error {
defer c.recorder.Record("delete")
return c.inner.Delete(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1alpha2InterfaceAdmissionReportInterface) 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.Record("delete_collection")
return c.inner.DeleteCollection(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1alpha2InterfaceAdmissionReportInterface) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_kyverno_v1alpha2.AdmissionReport, error) {
defer c.recorder.Record("get")
return c.inner.Get(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1alpha2InterfaceAdmissionReportInterface) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_kyverno_v1alpha2.AdmissionReportList, error) {
defer c.recorder.Record("list")
return c.inner.List(arg0, arg1)
}
func (c *wrappedKyvernoV1alpha2InterfaceAdmissionReportInterface) Patch(arg0 context.Context, arg1 string, arg2 types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_kyverno_v1alpha2.AdmissionReport, error) {
defer c.recorder.Record("patch")
return c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...)
}
func (c *wrappedKyvernoV1alpha2InterfaceAdmissionReportInterface) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v1alpha2.AdmissionReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v1alpha2.AdmissionReport, error) {
defer c.recorder.Record("update")
return c.inner.Update(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1alpha2InterfaceAdmissionReportInterface) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (watch.Interface, error) {
defer c.recorder.Record("watch")
return c.inner.Watch(arg0, arg1)
}
func (c *wrappedKyvernoV1alpha2Interface) AdmissionReports(arg0 string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha2.AdmissionReportInterface {
recorder := metrics.NamespacedClientQueryRecorder(c.metrics, arg0, "AdmissionReport", c.clientType)
return wrapKyvernoV1alpha2InterfaceAdmissionReportInterface(c.inner.AdmissionReports(arg0), recorder)
}
type wrappedKyvernoV1alpha2InterfaceBackgroundScanReportInterface struct {
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha2.BackgroundScanReportInterface
recorder metrics.Recorder
}
func wrapKyvernoV1alpha2InterfaceBackgroundScanReportInterface(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha2.BackgroundScanReportInterface, recorder metrics.Recorder) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha2.BackgroundScanReportInterface {
return &wrappedKyvernoV1alpha2InterfaceBackgroundScanReportInterface{inner, recorder}
}
func (c *wrappedKyvernoV1alpha2InterfaceBackgroundScanReportInterface) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v1alpha2.BackgroundScanReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_kyverno_v1alpha2.BackgroundScanReport, error) {
defer c.recorder.Record("create")
return c.inner.Create(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1alpha2InterfaceBackgroundScanReportInterface) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error {
defer c.recorder.Record("delete")
return c.inner.Delete(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1alpha2InterfaceBackgroundScanReportInterface) 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.Record("delete_collection")
return c.inner.DeleteCollection(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1alpha2InterfaceBackgroundScanReportInterface) Get(arg0 context.Context, arg1 string, arg2 metav1.GetOptions) (*github_com_kyverno_kyverno_api_kyverno_v1alpha2.BackgroundScanReport, error) {
defer c.recorder.Record("get")
return c.inner.Get(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1alpha2InterfaceBackgroundScanReportInterface) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_kyverno_v1alpha2.BackgroundScanReportList, error) {
defer c.recorder.Record("list")
return c.inner.List(arg0, arg1)
}
func (c *wrappedKyvernoV1alpha2InterfaceBackgroundScanReportInterface) Patch(arg0 context.Context, arg1 string, arg2 types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_kyverno_v1alpha2.BackgroundScanReport, error) {
defer c.recorder.Record("patch")
return c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...)
}
func (c *wrappedKyvernoV1alpha2InterfaceBackgroundScanReportInterface) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v1alpha2.BackgroundScanReport, arg2 metav1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v1alpha2.BackgroundScanReport, error) {
defer c.recorder.Record("update")
return c.inner.Update(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1alpha2InterfaceBackgroundScanReportInterface) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (watch.Interface, error) {
defer c.recorder.Record("watch")
return c.inner.Watch(arg0, arg1)
}
func (c *wrappedKyvernoV1alpha2Interface) BackgroundScanReports(arg0 string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha2.BackgroundScanReportInterface {
recorder := metrics.NamespacedClientQueryRecorder(c.metrics, arg0, "BackgroundScanReport", c.clientType)
return wrapKyvernoV1alpha2InterfaceBackgroundScanReportInterface(c.inner.BackgroundScanReports(arg0), recorder)
}
type wrappedKyvernoV1alpha2InterfaceClusterAdmissionReportInterface struct {
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha2.ClusterAdmissionReportInterface
recorder metrics.Recorder
}
func wrapKyvernoV1alpha2InterfaceClusterAdmissionReportInterface(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha2.ClusterAdmissionReportInterface, recorder metrics.Recorder) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha2.ClusterAdmissionReportInterface {
return &wrappedKyvernoV1alpha2InterfaceClusterAdmissionReportInterface{inner, recorder}
}
func (c *wrappedKyvernoV1alpha2InterfaceClusterAdmissionReportInterface) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v1alpha2.ClusterAdmissionReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_kyverno_v1alpha2.ClusterAdmissionReport, error) {
defer c.recorder.Record("create")
return c.inner.Create(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1alpha2InterfaceClusterAdmissionReportInterface) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error {
defer c.recorder.Record("delete")
return c.inner.Delete(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1alpha2InterfaceClusterAdmissionReportInterface) 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.Record("delete_collection")
return c.inner.DeleteCollection(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1alpha2InterfaceClusterAdmissionReportInterface) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_kyverno_v1alpha2.ClusterAdmissionReport, error) {
defer c.recorder.Record("get")
return c.inner.Get(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1alpha2InterfaceClusterAdmissionReportInterface) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_kyverno_v1alpha2.ClusterAdmissionReportList, error) {
defer c.recorder.Record("list")
return c.inner.List(arg0, arg1)
}
func (c *wrappedKyvernoV1alpha2InterfaceClusterAdmissionReportInterface) Patch(arg0 context.Context, arg1 string, arg2 types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_kyverno_v1alpha2.ClusterAdmissionReport, error) {
defer c.recorder.Record("patch")
return c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...)
}
func (c *wrappedKyvernoV1alpha2InterfaceClusterAdmissionReportInterface) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v1alpha2.ClusterAdmissionReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v1alpha2.ClusterAdmissionReport, error) {
defer c.recorder.Record("update")
return c.inner.Update(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1alpha2InterfaceClusterAdmissionReportInterface) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) {
defer c.recorder.Record("watch")
return c.inner.Watch(arg0, arg1)
}
func (c *wrappedKyvernoV1alpha2Interface) ClusterAdmissionReports() github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha2.ClusterAdmissionReportInterface {
recorder := metrics.ClusteredClientQueryRecorder(c.metrics, "ClusterAdmissionReport", c.clientType)
return wrapKyvernoV1alpha2InterfaceClusterAdmissionReportInterface(c.inner.ClusterAdmissionReports(), recorder)
}
type wrappedKyvernoV1alpha2InterfaceClusterBackgroundScanReportInterface struct {
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha2.ClusterBackgroundScanReportInterface
recorder metrics.Recorder
}
func wrapKyvernoV1alpha2InterfaceClusterBackgroundScanReportInterface(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha2.ClusterBackgroundScanReportInterface, recorder metrics.Recorder) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha2.ClusterBackgroundScanReportInterface {
return &wrappedKyvernoV1alpha2InterfaceClusterBackgroundScanReportInterface{inner, recorder}
}
func (c *wrappedKyvernoV1alpha2InterfaceClusterBackgroundScanReportInterface) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v1alpha2.ClusterBackgroundScanReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_kyverno_v1alpha2.ClusterBackgroundScanReport, error) {
defer c.recorder.Record("create")
return c.inner.Create(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1alpha2InterfaceClusterBackgroundScanReportInterface) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error {
defer c.recorder.Record("delete")
return c.inner.Delete(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1alpha2InterfaceClusterBackgroundScanReportInterface) 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.Record("delete_collection")
return c.inner.DeleteCollection(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1alpha2InterfaceClusterBackgroundScanReportInterface) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_kyverno_v1alpha2.ClusterBackgroundScanReport, error) {
defer c.recorder.Record("get")
return c.inner.Get(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1alpha2InterfaceClusterBackgroundScanReportInterface) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_kyverno_v1alpha2.ClusterBackgroundScanReportList, error) {
defer c.recorder.Record("list")
return c.inner.List(arg0, arg1)
}
func (c *wrappedKyvernoV1alpha2InterfaceClusterBackgroundScanReportInterface) Patch(arg0 context.Context, arg1 string, arg2 types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_kyverno_v1alpha2.ClusterBackgroundScanReport, error) {
defer c.recorder.Record("patch")
return c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...)
}
func (c *wrappedKyvernoV1alpha2InterfaceClusterBackgroundScanReportInterface) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v1alpha2.ClusterBackgroundScanReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v1alpha2.ClusterBackgroundScanReport, error) {
defer c.recorder.Record("update")
return c.inner.Update(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1alpha2InterfaceClusterBackgroundScanReportInterface) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) {
defer c.recorder.Record("watch")
return c.inner.Watch(arg0, arg1)
}
func (c *wrappedKyvernoV1alpha2Interface) ClusterBackgroundScanReports() github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1alpha2.ClusterBackgroundScanReportInterface {
recorder := metrics.ClusteredClientQueryRecorder(c.metrics, "ClusterBackgroundScanReport", c.clientType)
return wrapKyvernoV1alpha2InterfaceClusterBackgroundScanReportInterface(c.inner.ClusterBackgroundScanReports(), recorder)
}
func (c *wrappedKyvernoV1alpha2Interface) RESTClient() restclient.Interface {
return c.inner.RESTClient()
}
type wrappedKyvernoV1beta1Interface struct {
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1beta1.KyvernoV1beta1Interface
metrics metrics.MetricsConfigManager
clientType metrics.ClientType
}
func wrapKyvernoV1beta1Interface(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1beta1.KyvernoV1beta1Interface, metrics metrics.MetricsConfigManager, t metrics.ClientType) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1beta1.KyvernoV1beta1Interface {
return &wrappedKyvernoV1beta1Interface{inner, metrics, t}
}
type wrappedKyvernoV1beta1InterfaceUpdateRequestInterface struct {
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1beta1.UpdateRequestInterface
recorder metrics.Recorder
}
func wrapKyvernoV1beta1InterfaceUpdateRequestInterface(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1beta1.UpdateRequestInterface, recorder metrics.Recorder) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1beta1.UpdateRequestInterface {
return &wrappedKyvernoV1beta1InterfaceUpdateRequestInterface{inner, recorder}
}
func (c *wrappedKyvernoV1beta1InterfaceUpdateRequestInterface) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v1beta1.UpdateRequest, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_kyverno_v1beta1.UpdateRequest, error) {
defer c.recorder.Record("create")
return c.inner.Create(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1beta1InterfaceUpdateRequestInterface) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error {
defer c.recorder.Record("delete")
return c.inner.Delete(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1beta1InterfaceUpdateRequestInterface) 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.Record("delete_collection")
return c.inner.DeleteCollection(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1beta1InterfaceUpdateRequestInterface) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_kyverno_v1beta1.UpdateRequest, error) {
defer c.recorder.Record("get")
return c.inner.Get(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1beta1InterfaceUpdateRequestInterface) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_kyverno_v1beta1.UpdateRequestList, error) {
defer c.recorder.Record("list")
return c.inner.List(arg0, arg1)
}
func (c *wrappedKyvernoV1beta1InterfaceUpdateRequestInterface) Patch(arg0 context.Context, arg1 string, arg2 types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_kyverno_v1beta1.UpdateRequest, error) {
defer c.recorder.Record("patch")
return c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...)
}
func (c *wrappedKyvernoV1beta1InterfaceUpdateRequestInterface) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v1beta1.UpdateRequest, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v1beta1.UpdateRequest, error) {
defer c.recorder.Record("update")
return c.inner.Update(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1beta1InterfaceUpdateRequestInterface) UpdateStatus(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_kyverno_v1beta1.UpdateRequest, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_kyverno_v1beta1.UpdateRequest, error) {
defer c.recorder.Record("update_status")
return c.inner.UpdateStatus(arg0, arg1, arg2)
}
func (c *wrappedKyvernoV1beta1InterfaceUpdateRequestInterface) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (watch.Interface, error) {
defer c.recorder.Record("watch")
return c.inner.Watch(arg0, arg1)
}
func (c *wrappedKyvernoV1beta1Interface) UpdateRequests(arg0 string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_kyverno_v1beta1.UpdateRequestInterface {
recorder := metrics.NamespacedClientQueryRecorder(c.metrics, arg0, "UpdateRequest", c.clientType)
return wrapKyvernoV1beta1InterfaceUpdateRequestInterface(c.inner.UpdateRequests(arg0), recorder)
}
func (c *wrappedKyvernoV1beta1Interface) RESTClient() restclient.Interface {
return c.inner.RESTClient()
}
type wrappedWgpolicyk8sV1alpha2Interface struct {
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_policyreport_v1alpha2.Wgpolicyk8sV1alpha2Interface
metrics metrics.MetricsConfigManager
clientType metrics.ClientType
}
func wrapWgpolicyk8sV1alpha2Interface(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_policyreport_v1alpha2.Wgpolicyk8sV1alpha2Interface, metrics metrics.MetricsConfigManager, t metrics.ClientType) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_policyreport_v1alpha2.Wgpolicyk8sV1alpha2Interface {
return &wrappedWgpolicyk8sV1alpha2Interface{inner, metrics, t}
}
type wrappedWgpolicyk8sV1alpha2InterfaceClusterPolicyReportInterface struct {
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_policyreport_v1alpha2.ClusterPolicyReportInterface
recorder metrics.Recorder
}
func wrapWgpolicyk8sV1alpha2InterfaceClusterPolicyReportInterface(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_policyreport_v1alpha2.ClusterPolicyReportInterface, recorder metrics.Recorder) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_policyreport_v1alpha2.ClusterPolicyReportInterface {
return &wrappedWgpolicyk8sV1alpha2InterfaceClusterPolicyReportInterface{inner, recorder}
}
func (c *wrappedWgpolicyk8sV1alpha2InterfaceClusterPolicyReportInterface) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_policyreport_v1alpha2.ClusterPolicyReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_policyreport_v1alpha2.ClusterPolicyReport, error) {
defer c.recorder.Record("create")
return c.inner.Create(arg0, arg1, arg2)
}
func (c *wrappedWgpolicyk8sV1alpha2InterfaceClusterPolicyReportInterface) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error {
defer c.recorder.Record("delete")
return c.inner.Delete(arg0, arg1, arg2)
}
func (c *wrappedWgpolicyk8sV1alpha2InterfaceClusterPolicyReportInterface) 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.Record("delete_collection")
return c.inner.DeleteCollection(arg0, arg1, arg2)
}
func (c *wrappedWgpolicyk8sV1alpha2InterfaceClusterPolicyReportInterface) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_policyreport_v1alpha2.ClusterPolicyReport, error) {
defer c.recorder.Record("get")
return c.inner.Get(arg0, arg1, arg2)
}
func (c *wrappedWgpolicyk8sV1alpha2InterfaceClusterPolicyReportInterface) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_policyreport_v1alpha2.ClusterPolicyReportList, error) {
defer c.recorder.Record("list")
return c.inner.List(arg0, arg1)
}
func (c *wrappedWgpolicyk8sV1alpha2InterfaceClusterPolicyReportInterface) Patch(arg0 context.Context, arg1 string, arg2 types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_policyreport_v1alpha2.ClusterPolicyReport, error) {
defer c.recorder.Record("patch")
return c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...)
}
func (c *wrappedWgpolicyk8sV1alpha2InterfaceClusterPolicyReportInterface) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_policyreport_v1alpha2.ClusterPolicyReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_policyreport_v1alpha2.ClusterPolicyReport, error) {
defer c.recorder.Record("update")
return c.inner.Update(arg0, arg1, arg2)
}
func (c *wrappedWgpolicyk8sV1alpha2InterfaceClusterPolicyReportInterface) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) {
defer c.recorder.Record("watch")
return c.inner.Watch(arg0, arg1)
}
func (c *wrappedWgpolicyk8sV1alpha2Interface) ClusterPolicyReports() github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_policyreport_v1alpha2.ClusterPolicyReportInterface {
recorder := metrics.ClusteredClientQueryRecorder(c.metrics, "ClusterPolicyReport", c.clientType)
return wrapWgpolicyk8sV1alpha2InterfaceClusterPolicyReportInterface(c.inner.ClusterPolicyReports(), recorder)
}
type wrappedWgpolicyk8sV1alpha2InterfacePolicyReportInterface struct {
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_policyreport_v1alpha2.PolicyReportInterface
recorder metrics.Recorder
}
func wrapWgpolicyk8sV1alpha2InterfacePolicyReportInterface(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_policyreport_v1alpha2.PolicyReportInterface, recorder metrics.Recorder) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_policyreport_v1alpha2.PolicyReportInterface {
return &wrappedWgpolicyk8sV1alpha2InterfacePolicyReportInterface{inner, recorder}
}
func (c *wrappedWgpolicyk8sV1alpha2InterfacePolicyReportInterface) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_policyreport_v1alpha2.PolicyReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_policyreport_v1alpha2.PolicyReport, error) {
defer c.recorder.Record("create")
return c.inner.Create(arg0, arg1, arg2)
}
func (c *wrappedWgpolicyk8sV1alpha2InterfacePolicyReportInterface) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error {
defer c.recorder.Record("delete")
return c.inner.Delete(arg0, arg1, arg2)
}
func (c *wrappedWgpolicyk8sV1alpha2InterfacePolicyReportInterface) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions, arg2 metav1.ListOptions) error {
defer c.recorder.Record("delete_collection")
return c.inner.DeleteCollection(arg0, arg1, arg2)
}
func (c *wrappedWgpolicyk8sV1alpha2InterfacePolicyReportInterface) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_policyreport_v1alpha2.PolicyReport, error) {
defer c.recorder.Record("get")
return c.inner.Get(arg0, arg1, arg2)
}
func (c *wrappedWgpolicyk8sV1alpha2InterfacePolicyReportInterface) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_policyreport_v1alpha2.PolicyReportList, error) {
defer c.recorder.Record("list")
return c.inner.List(arg0, arg1)
}
func (c *wrappedWgpolicyk8sV1alpha2InterfacePolicyReportInterface) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_policyreport_v1alpha2.PolicyReport, error) {
defer c.recorder.Record("patch")
return c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...)
}
func (c *wrappedWgpolicyk8sV1alpha2InterfacePolicyReportInterface) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_policyreport_v1alpha2.PolicyReport, arg2 metav1.UpdateOptions) (*github_com_kyverno_kyverno_api_policyreport_v1alpha2.PolicyReport, error) {
defer c.recorder.Record("update")
return c.inner.Update(arg0, arg1, arg2)
}
func (c *wrappedWgpolicyk8sV1alpha2InterfacePolicyReportInterface) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) {
defer c.recorder.Record("watch")
return c.inner.Watch(arg0, arg1)
}
func (c *wrappedWgpolicyk8sV1alpha2Interface) PolicyReports(arg0 string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_policyreport_v1alpha2.PolicyReportInterface {
recorder := metrics.NamespacedClientQueryRecorder(c.metrics, arg0, "PolicyReport", c.clientType)
return wrapWgpolicyk8sV1alpha2InterfacePolicyReportInterface(c.inner.PolicyReports(arg0), recorder)
}
func (c *wrappedWgpolicyk8sV1alpha2Interface) RESTClient() restclient.Interface {
return c.inner.RESTClient()
}

View file

@ -1,61 +0,0 @@
package v1
import (
kyvernov1 "github.com/kyverno/kyverno/api/kyverno/v1"
v1 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/kyverno/v1"
"github.com/kyverno/kyverno/pkg/metrics"
controllerutils "github.com/kyverno/kyverno/pkg/utils/controller"
"k8s.io/client-go/rest"
)
type client struct {
inner v1.KyvernoV1Interface
metrics metrics.MetricsConfigManager
}
func (c *client) ClusterPolicies() v1.ClusterPolicyInterface {
recorder := metrics.ClusteredClientQueryRecorder(c.metrics, "ClusterPolicy", metrics.KyvernoClient)
return struct {
controllerutils.ObjectClient[*kyvernov1.ClusterPolicy]
controllerutils.ListClient[*kyvernov1.ClusterPolicyList]
controllerutils.StatusClient[*kyvernov1.ClusterPolicy]
}{
metrics.ObjectClient[*kyvernov1.ClusterPolicy](recorder, c.inner.ClusterPolicies()),
metrics.ListClient[*kyvernov1.ClusterPolicyList](recorder, c.inner.ClusterPolicies()),
metrics.StatusClient[*kyvernov1.ClusterPolicy](recorder, c.inner.ClusterPolicies()),
}
}
func (c *client) Policies(namespace string) v1.PolicyInterface {
recorder := metrics.NamespacedClientQueryRecorder(c.metrics, namespace, "Policy", metrics.KyvernoClient)
return struct {
controllerutils.ObjectClient[*kyvernov1.Policy]
controllerutils.ListClient[*kyvernov1.PolicyList]
controllerutils.StatusClient[*kyvernov1.Policy]
}{
metrics.ObjectClient[*kyvernov1.Policy](recorder, c.inner.Policies(namespace)),
metrics.ListClient[*kyvernov1.PolicyList](recorder, c.inner.Policies(namespace)),
metrics.StatusClient[*kyvernov1.Policy](recorder, c.inner.Policies(namespace)),
}
}
func (c *client) GenerateRequests(namespace string) v1.GenerateRequestInterface {
recorder := metrics.NamespacedClientQueryRecorder(c.metrics, namespace, "GenerateRequest", metrics.KyvernoClient)
return struct {
controllerutils.ObjectClient[*kyvernov1.GenerateRequest]
controllerutils.ListClient[*kyvernov1.GenerateRequestList]
controllerutils.StatusClient[*kyvernov1.GenerateRequest]
}{
metrics.ObjectClient[*kyvernov1.GenerateRequest](recorder, c.inner.GenerateRequests(namespace)),
metrics.ListClient[*kyvernov1.GenerateRequestList](recorder, c.inner.GenerateRequests(namespace)),
metrics.StatusClient[*kyvernov1.GenerateRequest](recorder, c.inner.GenerateRequests(namespace)),
}
}
func (c *client) RESTClient() rest.Interface {
return c.inner.RESTClient()
}
func Wrap(inner v1.KyvernoV1Interface, metrics metrics.MetricsConfigManager) v1.KyvernoV1Interface {
return &client{inner, metrics}
}

View file

@ -1,48 +0,0 @@
package v1alpha1
import (
kyvernov1alpha1 "github.com/kyverno/kyverno/api/kyverno/v1alpha1"
"github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/kyverno/v1alpha1"
"github.com/kyverno/kyverno/pkg/metrics"
controllerutils "github.com/kyverno/kyverno/pkg/utils/controller"
"k8s.io/client-go/rest"
)
type client struct {
inner v1alpha1.KyvernoV1alpha1Interface
metrics metrics.MetricsConfigManager
}
func (c *client) CleanupPolicies(namespace string) v1alpha1.CleanupPolicyInterface {
recorder := metrics.NamespacedClientQueryRecorder(c.metrics, namespace, "CleanupPolicy", metrics.KyvernoClient)
return struct {
controllerutils.ObjectClient[*kyvernov1alpha1.CleanupPolicy]
controllerutils.ListClient[*kyvernov1alpha1.CleanupPolicyList]
controllerutils.StatusClient[*kyvernov1alpha1.CleanupPolicy]
}{
metrics.ObjectClient[*kyvernov1alpha1.CleanupPolicy](recorder, c.inner.CleanupPolicies(namespace)),
metrics.ListClient[*kyvernov1alpha1.CleanupPolicyList](recorder, c.inner.CleanupPolicies(namespace)),
metrics.StatusClient[*kyvernov1alpha1.CleanupPolicy](recorder, c.inner.CleanupPolicies(namespace)),
}
}
func (c *client) ClusterCleanupPolicies() v1alpha1.ClusterCleanupPolicyInterface {
recorder := metrics.NamespacedClientQueryRecorder(c.metrics, "", "ClusterCleanupPolicy", metrics.KyvernoClient)
return struct {
controllerutils.ObjectClient[*kyvernov1alpha1.ClusterCleanupPolicy]
controllerutils.ListClient[*kyvernov1alpha1.ClusterCleanupPolicyList]
controllerutils.StatusClient[*kyvernov1alpha1.ClusterCleanupPolicy]
}{
metrics.ObjectClient[*kyvernov1alpha1.ClusterCleanupPolicy](recorder, c.inner.ClusterCleanupPolicies()),
metrics.ListClient[*kyvernov1alpha1.ClusterCleanupPolicyList](recorder, c.inner.ClusterCleanupPolicies()),
metrics.StatusClient[*kyvernov1alpha1.ClusterCleanupPolicy](recorder, c.inner.ClusterCleanupPolicies()),
}
}
func (c *client) RESTClient() rest.Interface {
return c.inner.RESTClient()
}
func Wrap(inner v1alpha1.KyvernoV1alpha1Interface, metrics metrics.MetricsConfigManager) v1alpha1.KyvernoV1alpha1Interface {
return &client{inner, metrics}
}

View file

@ -1,66 +0,0 @@
package v1alpha2
import (
kyvernov1alpha2 "github.com/kyverno/kyverno/api/kyverno/v1alpha2"
"github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/kyverno/v1alpha2"
"github.com/kyverno/kyverno/pkg/metrics"
controllerutils "github.com/kyverno/kyverno/pkg/utils/controller"
"k8s.io/client-go/rest"
)
type client struct {
inner v1alpha2.KyvernoV1alpha2Interface
metrics metrics.MetricsConfigManager
}
func (c *client) ClusterAdmissionReports() v1alpha2.ClusterAdmissionReportInterface {
recorder := metrics.ClusteredClientQueryRecorder(c.metrics, "ClusterAdmissionReport", metrics.KyvernoClient)
return struct {
controllerutils.ObjectClient[*kyvernov1alpha2.ClusterAdmissionReport]
controllerutils.ListClient[*kyvernov1alpha2.ClusterAdmissionReportList]
}{
metrics.ObjectClient[*kyvernov1alpha2.ClusterAdmissionReport](recorder, c.inner.ClusterAdmissionReports()),
metrics.ListClient[*kyvernov1alpha2.ClusterAdmissionReportList](recorder, c.inner.ClusterAdmissionReports()),
}
}
func (c *client) ClusterBackgroundScanReports() v1alpha2.ClusterBackgroundScanReportInterface {
recorder := metrics.ClusteredClientQueryRecorder(c.metrics, "ClusterBackgroundScanReport", metrics.KyvernoClient)
return struct {
controllerutils.ObjectClient[*kyvernov1alpha2.ClusterBackgroundScanReport]
controllerutils.ListClient[*kyvernov1alpha2.ClusterBackgroundScanReportList]
}{
metrics.ObjectClient[*kyvernov1alpha2.ClusterBackgroundScanReport](recorder, c.inner.ClusterBackgroundScanReports()),
metrics.ListClient[*kyvernov1alpha2.ClusterBackgroundScanReportList](recorder, c.inner.ClusterBackgroundScanReports()),
}
}
func (c *client) AdmissionReports(namespace string) v1alpha2.AdmissionReportInterface {
recorder := metrics.NamespacedClientQueryRecorder(c.metrics, namespace, "AdmissionReport", metrics.KyvernoClient)
return struct {
controllerutils.ObjectClient[*kyvernov1alpha2.AdmissionReport]
controllerutils.ListClient[*kyvernov1alpha2.AdmissionReportList]
}{
metrics.ObjectClient[*kyvernov1alpha2.AdmissionReport](recorder, c.inner.AdmissionReports(namespace)),
metrics.ListClient[*kyvernov1alpha2.AdmissionReportList](recorder, c.inner.AdmissionReports(namespace)),
}
}
func (c *client) BackgroundScanReports(namespace string) v1alpha2.BackgroundScanReportInterface {
recorder := metrics.NamespacedClientQueryRecorder(c.metrics, namespace, "BackgroundScanReport", metrics.KyvernoClient)
return struct {
controllerutils.ObjectClient[*kyvernov1alpha2.BackgroundScanReport]
controllerutils.ListClient[*kyvernov1alpha2.BackgroundScanReportList]
}{
metrics.ObjectClient[*kyvernov1alpha2.BackgroundScanReport](recorder, c.inner.BackgroundScanReports(namespace)),
metrics.ListClient[*kyvernov1alpha2.BackgroundScanReportList](recorder, c.inner.BackgroundScanReports(namespace)),
}
}
func (c *client) RESTClient() rest.Interface {
return c.inner.RESTClient()
}
func Wrap(inner v1alpha2.KyvernoV1alpha2Interface, metrics metrics.MetricsConfigManager) v1alpha2.KyvernoV1alpha2Interface {
return &client{inner, metrics}
}

View file

@ -1,35 +0,0 @@
package v1beta1
import (
kyvernov1beta1 "github.com/kyverno/kyverno/api/kyverno/v1beta1"
"github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/kyverno/v1beta1"
"github.com/kyverno/kyverno/pkg/metrics"
controllerutils "github.com/kyverno/kyverno/pkg/utils/controller"
"k8s.io/client-go/rest"
)
type client struct {
inner v1beta1.KyvernoV1beta1Interface
metrics metrics.MetricsConfigManager
}
func (c *client) UpdateRequests(namespace string) v1beta1.UpdateRequestInterface {
recorder := metrics.NamespacedClientQueryRecorder(c.metrics, namespace, "UpdateRequest", metrics.KyvernoClient)
return struct {
controllerutils.ObjectClient[*kyvernov1beta1.UpdateRequest]
controllerutils.ListClient[*kyvernov1beta1.UpdateRequestList]
controllerutils.StatusClient[*kyvernov1beta1.UpdateRequest]
}{
metrics.ObjectClient[*kyvernov1beta1.UpdateRequest](recorder, c.inner.UpdateRequests(namespace)),
metrics.ListClient[*kyvernov1beta1.UpdateRequestList](recorder, c.inner.UpdateRequests(namespace)),
metrics.StatusClient[*kyvernov1beta1.UpdateRequest](recorder, c.inner.UpdateRequests(namespace)),
}
}
func (c *client) RESTClient() rest.Interface {
return c.inner.RESTClient()
}
func Wrap(inner v1beta1.KyvernoV1beta1Interface, metrics metrics.MetricsConfigManager) v1beta1.KyvernoV1beta1Interface {
return &client{inner, metrics}
}

View file

@ -1,44 +0,0 @@
package v1alpha2
import (
policyreportv1alpha2 "github.com/kyverno/kyverno/api/policyreport/v1alpha2"
"github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/policyreport/v1alpha2"
"github.com/kyverno/kyverno/pkg/metrics"
controllerutils "github.com/kyverno/kyverno/pkg/utils/controller"
"k8s.io/client-go/rest"
)
type client struct {
inner v1alpha2.Wgpolicyk8sV1alpha2Interface
metrics metrics.MetricsConfigManager
}
func (c *client) ClusterPolicyReports() v1alpha2.ClusterPolicyReportInterface {
recorder := metrics.ClusteredClientQueryRecorder(c.metrics, "ClusterPolicyReport", metrics.KyvernoClient)
return struct {
controllerutils.ObjectClient[*policyreportv1alpha2.ClusterPolicyReport]
controllerutils.ListClient[*policyreportv1alpha2.ClusterPolicyReportList]
}{
metrics.ObjectClient[*policyreportv1alpha2.ClusterPolicyReport](recorder, c.inner.ClusterPolicyReports()),
metrics.ListClient[*policyreportv1alpha2.ClusterPolicyReportList](recorder, c.inner.ClusterPolicyReports()),
}
}
func (c *client) PolicyReports(namespace string) v1alpha2.PolicyReportInterface {
recorder := metrics.NamespacedClientQueryRecorder(c.metrics, namespace, "PolicyReport", metrics.KyvernoClient)
return struct {
controllerutils.ObjectClient[*policyreportv1alpha2.PolicyReport]
controllerutils.ListClient[*policyreportv1alpha2.PolicyReportList]
}{
metrics.ObjectClient[*policyreportv1alpha2.PolicyReport](recorder, c.inner.PolicyReports(namespace)),
metrics.ListClient[*policyreportv1alpha2.PolicyReportList](recorder, c.inner.PolicyReports(namespace)),
}
}
func (c *client) RESTClient() rest.Interface {
return c.inner.RESTClient()
}
func Wrap(inner v1alpha2.Wgpolicyk8sV1alpha2Interface, metrics metrics.MetricsConfigManager) v1alpha2.Wgpolicyk8sV1alpha2Interface {
return &client{inner, metrics}
}