Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter carvel available applications using the filter options. #4629

Merged
merged 2 commits into from
Apr 29, 2022

Conversation

absoludity
Copy link
Contributor

@absoludity absoludity commented Apr 28, 2022

Signed-off-by: Michael Nelson minelson@vmware.com

Description of the change

Turns out the filtering just wasn't implemented yet.

This PR adds filtering of available packages for the carvel plugin, currently filtering by query and categories.

Benefits

See linked issue.

Possible drawbacks

Applicable issues

Additional information

Built locally and verified it works as expected. Also noticed that the categories filter is still being done client-side, which will not work correctly with pagination etc. I'll check if we have an existing issue for that.

Signed-off-by: Michael Nelson <minelson@vmware.com>
Copy link
Contributor

@antgamdia antgamdia left a comment

Choose a reason for hiding this comment

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

Great! Thanks for implementing it! We missed it during the initial implementation of the carvel plugin 😬

intersection := true
for _, category := range categories {
if _, ok := metadataCategoriesHash[category]; !ok {
intersection = false
Copy link
Contributor

Choose a reason for hiding this comment

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

If false, can't we just break the loop and eagerly return it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, good point.

@@ -58,6 +58,7 @@ reset-dev-kubeapps:
deploy-kapp-controller:
kubectl --kubeconfig=${CLUSTER_CONFIG} apply -f https://github.com/vmware-tanzu/carvel-kapp-controller/releases/download/v0.35.0/release.yml
kubectl --kubeconfig=${CLUSTER_CONFIG} apply -f https://raw.githubusercontent.com/vmware-tanzu/carvel-kapp-controller/develop/examples/packaging-with-repo/package-repository.yml
kubectl --kubeconfig=${CLUSTER_CONFIG} apply -f ./docs/howto/manifests/tce-package-repository.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!

Signed-off-by: Michael Nelson <minelson@vmware.com>
@absoludity absoludity merged commit f0dc991 into vmware-tanzu:main Apr 29, 2022
@absoludity absoludity deleted the 4499-carvel-filter branch April 29, 2022 01:39
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.

[carvel] Filtering app catalog does not filter
2 participants