Skip to main content

Module generic_native

Module generic_native 

Source
Expand description

The no-package handler: any tree as opaque blobs, no metadata, no promise. The no-package handler: an arbitrary directory tree, archived as opaque blobs, with no package semantics claimed at all.

§Why a handler for “no handler”

--format selects exactly one handler and defaults to rust, so before this module the only way to archive a tree that is not a package registry was to tell znippy it was a Rust one. That worked — CargoPlugin::matches_path is path.ends_with(".crate"), so nothing matched and no metadata was extracted — but it worked by accident, and it lied twice over: the archive recorded pkg_type = 1, so znippy decompress --type rust and every RustView consumer would claim a container-registry mirror as crates.io content.

A pkg_type is a promise about what the rows mean. The honest promise for a tree of image layers, a build output, or a home directory is none, and GenericPlugin is the handler that makes it: its own type_id, no extensions claimed, no columns contributed, [matches_path] permanently false so [extract_metadata] is never even called.

§The use case it was added for

A container-registry mirror tree — what talosctl image cache-create writes, and the same shape a Nexus/registry mirror has:

<root>/blob/<sha256-hex>                             1 KB … 500 MB, ALREADY gzip/zstd
<root>/manifests/<host>/<repo>/reference/<tag>       small JSON
<root>/manifests/<host>/<repo>/digest/<sha256>       small JSON

Every property of that tree argues for a no-op handler. The blob filenames are bare hex with no extension, so no extension-keyed handler could match one anyway; the blobs are content-addressed, so a metadata extractor has nothing to add that the name does not already say; and the payload is already compressed, which is a question for precompressed’s magic-byte probe, not for a package parser.

Tier A by rule P-5 (.nornir/plugins-design.md §f3): it needs std and arrow and nothing else — in fact it needs less than any other handler here.

Structs§

GenericPlugin
Archive any tree as opaque blobs. Extracts no metadata, claims no extension, contributes no Arrow column.

Statics§

GENERIC_SPEC
The generic handler. type_id 26 is the first free discriminant above the skeletons (4-24) and media (25), below the out-of-crate handlers (40-42).