1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-10 18:06:55 +00:00
kyverno/pkg/clients/kube/coordinationv1/client.generated.go
Charles-Edouard Brétéché 447360c1f3
refactor: improve instrumented clients code and support dynamic/metadata client (#5428)
* refactor: improve instrumented clients creation

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>

* refactor: instrumented clients code part 3

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>

* 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>

* metadata

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

* metadata

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

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2022-11-22 17:10:07 +08:00

42 lines
1.7 KiB
Go

package client
import (
leases "github.com/kyverno/kyverno/pkg/clients/kube/coordinationv1/leases"
"github.com/kyverno/kyverno/pkg/metrics"
k8s_io_client_go_kubernetes_typed_coordination_v1 "k8s.io/client-go/kubernetes/typed/coordination/v1"
"k8s.io/client-go/rest"
)
func WithMetrics(inner k8s_io_client_go_kubernetes_typed_coordination_v1.CoordinationV1Interface, metrics metrics.MetricsConfigManager, clientType metrics.ClientType) k8s_io_client_go_kubernetes_typed_coordination_v1.CoordinationV1Interface {
return &withMetrics{inner, metrics, clientType}
}
func WithTracing(inner k8s_io_client_go_kubernetes_typed_coordination_v1.CoordinationV1Interface, client string) k8s_io_client_go_kubernetes_typed_coordination_v1.CoordinationV1Interface {
return &withTracing{inner, client}
}
type withMetrics struct {
inner k8s_io_client_go_kubernetes_typed_coordination_v1.CoordinationV1Interface
metrics metrics.MetricsConfigManager
clientType metrics.ClientType
}
func (c *withMetrics) RESTClient() rest.Interface {
return c.inner.RESTClient()
}
func (c *withMetrics) Leases(namespace string) k8s_io_client_go_kubernetes_typed_coordination_v1.LeaseInterface {
recorder := metrics.NamespacedClientQueryRecorder(c.metrics, namespace, "Lease", c.clientType)
return leases.WithMetrics(c.inner.Leases(namespace), recorder)
}
type withTracing struct {
inner k8s_io_client_go_kubernetes_typed_coordination_v1.CoordinationV1Interface
client string
}
func (c *withTracing) RESTClient() rest.Interface {
return c.inner.RESTClient()
}
func (c *withTracing) Leases(namespace string) k8s_io_client_go_kubernetes_typed_coordination_v1.LeaseInterface {
return leases.WithTracing(c.inner.Leases(namespace), c.client, "Lease")
}