From 7ff9e788a4bac8ae3c14119fcd3726d8c8754334 Mon Sep 17 00:00:00 2001 From: Sam Batschelet Date: Tue, 30 Jan 2024 01:05:07 -0500 Subject: [PATCH] *: fix lint Signed-off-by: Sam Batschelet --- .../pinned-image-set/pinned_image_set_controller.go | 6 +++--- pkg/daemon/prefetch_manager.go | 5 ++--- pkg/daemon/update.go | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/pkg/controller/pinned-image-set/pinned_image_set_controller.go b/pkg/controller/pinned-image-set/pinned_image_set_controller.go index 56bf76045e..f0c6d91b7d 100644 --- a/pkg/controller/pinned-image-set/pinned_image_set_controller.go +++ b/pkg/controller/pinned-image-set/pinned_image_set_controller.go @@ -426,16 +426,16 @@ func (ctrl *Controller) deletePinnedImageSet(obj interface{}) { } } -func (c *Controller) cascadeDelete(imageSet *mcfgv1.PinnedImageSet) error { +func (ctrl *Controller) cascadeDelete(imageSet *mcfgv1.PinnedImageSet) error { if len(imageSet.GetFinalizers()) == 0 { return nil } mcName := imageSet.GetFinalizers()[0] - err := c.mcfgClient.MachineconfigurationV1().MachineConfigs().Delete(context.TODO(), mcName, metav1.DeleteOptions{}) + err := ctrl.mcfgClient.MachineconfigurationV1().MachineConfigs().Delete(context.TODO(), mcName, metav1.DeleteOptions{}) if err != nil && !apierrors.IsNotFound(err) { return err } - return c.popFinalizer(imageSet) + return ctrl.popFinalizer(imageSet) } func (ctrl *Controller) enqueue(cfg *mcfgv1.PinnedImageSet) { diff --git a/pkg/daemon/prefetch_manager.go b/pkg/daemon/prefetch_manager.go index d91a2f4143..7d74846987 100644 --- a/pkg/daemon/prefetch_manager.go +++ b/pkg/daemon/prefetch_manager.go @@ -286,7 +286,6 @@ func (p *PrefetchManager) prefetchWorker( ctx context.Context, wg *sync.WaitGroup, client runtimeapi.ImageServiceClient, - registryAuth *registryAuth, throttleInterval time.Duration, prefetchCh chan prefetch, errCh chan error, @@ -338,7 +337,7 @@ func (p *PrefetchManager) scheduleWorkers(ctx context.Context, prefetchImages [] errCh := make(chan error, len(prefetchImages)) for i := 0; i < workerCount; i++ { wg.Add(1) - go p.prefetchWorker(ctx, &wg, client, registryAuth, defaultPrefetchThrottleDuration, prefetchCh, errCh) + go p.prefetchWorker(ctx, &wg, client, defaultPrefetchThrottleDuration, prefetchCh, errCh) } // schedule work @@ -610,7 +609,7 @@ func (p *PrefetchManager) updatePrefetchUnreconcilable() error { return nil } -func getImageSize(ctx context.Context, image mcfgv1.PinnedImageRef, authFilePath string) (int64, error) { +func getImageSize(_ context.Context, image mcfgv1.PinnedImageRef, authFilePath string) (int64, error) { klog.Infof("Getting size for image %q", image) args := []string{ diff --git a/pkg/daemon/update.go b/pkg/daemon/update.go index 9de29f86da..c9fb5421f6 100644 --- a/pkg/daemon/update.go +++ b/pkg/daemon/update.go @@ -65,7 +65,7 @@ const ( // ImageRegistryDrainOverrideConfigmap is the name of the Configmap a user can apply to force all // image registry changes to not drain ImageRegistryDrainOverrideConfigmap = "image-registry-override-drain" - + // pinnedImagePathRegex is the regex MCO expects will contain pinned image updates. pinnedImagePathRegex = `crio\.conf\.d\/[0-9]{2}-pinned-images$` )