🌱 consolidate image layer handling; move fs utils by joelanford · Pull Request #1690 · operator-framework/operator-controller

Description

Now that we have a monorepo, we can begin consolidating various bits of code that had identical or substantially similar implementations in catalogd and operator-controller.

This PR adds an image utility package, for now with common code that handles applying an image to an unpack directory. Of note is that catalogd and operator-controller had separate sets of filters used when applying the image layers. This PR, extracts the separate filter functions into the image utility library, and then updates the (still mostly duplicate) unpacker implementations to use the new shared code.

In follow-up PRs, we can further de-dup the containers/image unpacker implementations (and any other duplicate code we find).

NOTE: To avoid an import cycle, I needed to also make a new fs utility package for internal/rukpak/source/helpers.go (which are all fs-related helpers). I also took the opportunity to move internal/fsutil/* into the new fs` utility package.

Fixes #1711

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)