Skip to content

Commit

Permalink
*: fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Batschelet <[email protected]>
  • Loading branch information
hexfusion committed Jan 30, 2024
1 parent e8301a2 commit 7ff9e78
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 2 additions & 3 deletions pkg/daemon/prefetch_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion pkg/daemon/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -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$`
)
Expand Down

0 comments on commit 7ff9e78

Please sign in to comment.