From 4d208b6cccdefdce2e79d3bea2e54d08d65dee8f Mon Sep 17 00:00:00 2001 From: Angel Misevski Date: Thu, 22 Aug 2024 15:12:16 -0600 Subject: [PATCH] Fix unpacking modelkits with references Unpacking parent modelkits relied on the deprecated unpack configuration (to unpack only models), which was getting ignored. --- pkg/cmd/unpack/unpack.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkg/cmd/unpack/unpack.go b/pkg/cmd/unpack/unpack.go index 1a9984f4..0c50a785 100644 --- a/pkg/cmd/unpack/unpack.go +++ b/pkg/cmd/unpack/unpack.go @@ -170,9 +170,12 @@ func unpackParent(ctx context.Context, ref string, optsIn *unpackOptions, visite opts := *optsIn opts.modelRef = parentRef // Unpack only model, ignore code/datasets - opts.unpackConf.unpackKitfile = false - opts.unpackConf.unpackCode = false - opts.unpackConf.unpackDatasets = false + modelFilter, err := parseFilter("model") + if err != nil { + // Shouldn't happen, ever + return fmt.Errorf("failed to parse filter for parent modelkit: %w", err) + } + opts.filterConfs = []filterConf{*modelFilter} return runUnpackRecursive(ctx, &opts, append(visitedRefs, ref)) }