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

fix: remove unused parameters (#10007)

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
This commit is contained in:
Mariam Fahmy 2024-04-18 18:30:35 +08:00 committed by GitHub
parent 693010563f
commit 815f4bb09d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 4 additions and 17 deletions

View file

@ -86,7 +86,7 @@ func createKyvernoDynamicClient(logger logr.Logger, ctx context.Context, dyn dyn
return client
}
func createEventsClient(logger logr.Logger, kube kubernetes.Interface, metricsManager metrics.MetricsConfigManager) eventsv1.EventsV1Interface {
func createEventsClient(logger logr.Logger, metricsManager metrics.MetricsConfigManager) eventsv1.EventsV1Interface {
logger = logger.WithName("events-client")
logger.Info("create the events client...", "kubeconfig", kubeconfig, "qps", clientRateLimitQPS, "burst", clientRateLimitBurst)
client := kubeclient.From(createKubernetesClient(logger, eventsRateLimitQPS, eventsRateLimitBurst), kubeclient.WithTracing())

View file

@ -1,13 +1,11 @@
package internal
import (
"context"
"github.com/go-logr/logr"
"github.com/kyverno/kyverno/pkg/imageverifycache"
)
func setupImageVerifyCache(ctx context.Context, logger logr.Logger) imageverifycache.Client {
func setupImageVerifyCache(logger logr.Logger) imageverifycache.Client {
logger = logger.WithName("image-verify-cache").WithValues("enabled", imageVerifyCacheEnabled, "maxsize", imageVerifyCacheMaxSize, "ttl", imageVerifyCacheTTLDuration)
logger.Info("setup image verify cache...")
opts := []imageverifycache.Option{

View file

@ -72,7 +72,7 @@ func Setup(config Configuration, name string, skipResourceFilters bool) (context
}
var imageVerifyCache imageverifycache.Client
if config.UsesImageVerifyCache() {
imageVerifyCache = setupImageVerifyCache(ctx, logger)
imageVerifyCache = setupImageVerifyCache(logger)
}
if config.UsesCosign() {
setupSigstoreTUF(ctx, logger)
@ -99,7 +99,7 @@ func Setup(config Configuration, name string, skipResourceFilters bool) (context
}
var eventsClient eventsv1.EventsV1Interface
if config.UsesEventsClient() {
eventsClient = createEventsClient(logger, client, metricsManager)
eventsClient = createEventsClient(logger, metricsManager)
}
var metadataClient metadataclient.UpstreamInterface
if config.UsesMetadataClient() {

View file

@ -25,7 +25,6 @@ import (
policycachecontroller "github.com/kyverno/kyverno/pkg/controllers/policycache"
vapcontroller "github.com/kyverno/kyverno/pkg/controllers/validatingadmissionpolicy-generate"
webhookcontroller "github.com/kyverno/kyverno/pkg/controllers/webhook"
engineapi "github.com/kyverno/kyverno/pkg/engine/api"
"github.com/kyverno/kyverno/pkg/engine/apicall"
"github.com/kyverno/kyverno/pkg/event"
"github.com/kyverno/kyverno/pkg/globalcontext/store"
@ -79,13 +78,8 @@ func sanityChecks(apiserverClient apiserver.Interface) error {
}
func createNonLeaderControllers(
eng engineapi.Engine,
kubeInformer kubeinformers.SharedInformerFactory,
kyvernoInformer kyvernoinformer.SharedInformerFactory,
kubeClient kubernetes.Interface,
kyvernoClient versioned.Interface,
dynamicClient dclient.Interface,
configuration config.Configuration,
policyCache policycache.Cache,
) ([]internal.Controller, func(context.Context) error) {
policyCacheController := policycachecontroller.NewController(
@ -426,13 +420,8 @@ func main() {
)
// create non leader controllers
nonLeaderControllers, nonLeaderBootstrap := createNonLeaderControllers(
engine,
kubeInformer,
kyvernoInformer,
setup.KubeClient,
setup.KyvernoClient,
setup.KyvernoDynamicClient,
setup.Configuration,
policyCache,
)
// start informers and wait for cache sync