kitops icon indicating copy to clipboard operation
kitops copied to clipboard

fix: generate Kitfile for ModelPack if missing from manifest

Open AdeshDeshmukh opened this issue 8 months ago • 1 comments

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.go now uses the shared utility.

Linked issues

Fixes missing Kitfile handling for ModelPacks.

AdeshDeshmukh avatar Mar 25 '26 16:03 AdeshDeshmukh

Can you add the sign-off messages to your commits. Click on the failing DCO check above for how to instructions.

gorkem avatar Mar 26 '26 14:03 gorkem