Skip to content

RFE: enhance error handling leading to catalog cache rebuilding #1050

@grokspawn

Description

@grokspawn

When a catalog cache's digest is not readable (file does not exist, or permissions prevent reading) or when the digest does not match the locally-calculated digest, opm will try to regenerate the cache. In typical published catalog images with a pre-generated cache, the cache directory is deliberately lacking delete permissions.

This produces messaging like:

2023-01-03T08:42:27.514784820Z Error: compute digest: compute hash: write tar: open /tmp/cache/cache: permission denied
2023-01-03T08:42:27.515439730Z Usage:
2023-01-03T08:42:27.515439730Z   opm serve <source_path> [flags]

The message could be improved by distinguishing between:

  1. failure to create cache directory
  2. failure to read digest, and here
  3. other failure modes in the load method related to digest mismatch, recompute errors

In addition, it would be extremely useful to provide a new flag to opm serve which would enforce process exit on cache load error, instead of attempts to regenerate the cache. This would allow us to align flags explicitly with the specific "no updates allowed" use-case.

Metadata

Metadata

Assignees

Labels

good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions