kitops
kitops copied to clipboard
fix: generate Kitfile for ModelPack if missing from manifest
Use fallback generation for missing Kitfile in ModelPacks.
Description
This PR introduces a fallback mechanism to generate a Kitfile in-memory when a ModelPack manifest does not contain one in its annotations.
Previously, if the org.cncf.model.kitfile annotation was missing, GetKitfileForManifest would return ErrNoKitfile. This change adds GenerateKitfileForModelPack to reconstruct the Kitfile from layer metadata (filepaths and media types), allowing tools to inspect and unpack these artifacts seamlessy.
Validation:
- Added new unit tests in
pkg/lib/repo/util/modelpack_test.go - Verified existing logic in
pkg/lib/filesystem/unpack/core.gonow uses the shared utility.
Linked issues
Fixes missing Kitfile handling for ModelPacks.
Can you add the sign-off messages to your commits. Click on the failing DCO check above for how to instructions.