Skip to content

kit remove exits 0 when extra tags fail to remove #1246

Description

@AdeshDeshmukh

Describe the bug

kit remove exits with code 0 even when extra comma-separated tags fail to remove. The function removeModel() logs the errors via output.Errorf but always returns nil, so the caller never knows a failure happened. This means kit remove myrepo:tag1,tag2,bogus silently reports success despite bogus failing.

To Reproduce

kit pull alice/my-model:latest
kit tag alice/my-model:latest alice/my-model:extra1 alice/my-model:extra2
kit remove alice/my-model:latest,extra1,extra2,nonexistent
echo $?

extra2 and nonexistent both fail (they don't exist), but exit code is 0.

Version

latest

Additional context

The loop at pkg/cmd/remove/remove.go:115-126 iterates opts.extraTags, logs failures, but returns nil. Compare with lines 108-110 where the primary reference correctly returns an error.

Workaround: remove each tag individually instead of comma-separated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions