Skip to content

feat: add --filter flag to kit list (#1091)#1096

Open
maishivamhoo123 wants to merge 2 commits intokitops-ml:mainfrom
maishivamhoo123:feat/1091-list-filtering
Open

feat: add --filter flag to kit list (#1091)#1096
maishivamhoo123 wants to merge 2 commits intokitops-ml:mainfrom
maishivamhoo123:feat/1091-list-filtering

Conversation

@maishivamhoo123
Copy link
Copy Markdown

@maishivamhoo123 maishivamhoo123 commented Feb 26, 2026

Description

Added a new directory in package/lib named as filter and it have two files filter.go and filter_test.go and removed the file from pkg/lib/filesystem/unpack/filter.go. have same logic and added a new function Added a new KitfileMatches function and test for it. and updated related functions also like listLocalKits ,listRemoteKits and listOptions .
All test have passed locally and test the functionality also.

Linked issues

#1091
issues to this PR -->

AI-Assisted Code

  • [x ] This PR contains AI-generated code that I have reviewed and tested except test generated from AI.
  • [ yes] I take full responsibility for all code in this PR, regardless of how it was created

Signed-off-by: Shivam Kumar maishivamhoo@gmail.com

Signed-off-by: maishivamhoo123 <maishivamhoo@gmail.com>
Signed-off-by: maishivamhoo123 <maishivamhoo@gmail.com>
@maishivamhoo123 maishivamhoo123 force-pushed the feat/1091-list-filtering branch from 38a450d to 266aa3a Compare February 26, 2026 10:17
Copy link
Copy Markdown
Contributor

@amisevsk amisevsk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good to me, thanks for the contribution @maishivamhoo123!

Could you just update the doc line for LayerMatches to keep it up to date?

Comment on lines +79 to 81
// LayerMatches determines if we should unpack a layer in a Kitfile by matching
// fields against the filters. Matching is done against path and name (if present).
// If filters is empty, we assume everything should be unpacked
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doc is slightly out of date now:

Suggested change
// LayerMatches determines if we should unpack a layer in a Kitfile by matching
// fields against the filters. Matching is done against path and name (if present).
// If filters is empty, we assume everything should be unpacked
// LayerMatches determines if a Kitfile layer is matched by any filter by matching
// fields against the filters. Matching is done against path and name (if present).
// If filters is empty, we assume everything should be unpacked

@amisevsk
Copy link
Copy Markdown
Contributor

amisevsk commented Mar 2, 2026

I just saw that there's already an open PR for this: #1094. Since that one is first I would prefer to merge that one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants