-
Notifications
You must be signed in to change notification settings - Fork 152
Fix/ignore list resources in crds #766
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
base: master
Are you sure you want to change the base?
Fix/ignore list resources in crds #766
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @Malka123456, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request refines Meshery's component generation process by introducing specific filters to exclude Kubernetes 'List' resources. These resources, such as PodList
or DeploymentList
, are primarily used for listing and do not represent actual deployable components. By preventing their inclusion, the PR ensures that Meshery's component model remains accurate and aligned with its intended functionality, resolving an issue where these unnecessary types were being generated.
Highlights
- Component Generation Filtering: Implemented logic to prevent Kubernetes 'List' resources (e.g.,
PodList
,DeploymentList
) from being generated as Meshery components, as these do not represent actual deployable resources. - OpenAPI-based Component Generation Enhancement: Modified
utils/component/openapi_generator.go
to include a check that skipskind
s ending with 'List' during the OpenAPI schema processing, ensuring only relevant resources are considered. - CRD-based Component Generation Enhancement: Updated
utils/manifests/generateComponent.go
to inspect thespec.names.kind
of Custom Resource Definitions (CRDs) and ignore any that end with 'List', preventing their parsing into Meshery components.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces logic to exclude Kubernetes resources ending with 'List' from component generation, addressing issue #15337. The changes are implemented in openapi_generator.go
and generateComponent.go
. A suggestion has been made to enhance maintainability in generateComponent.go
by using the configured NameExtractor
.
…neration Signed-off-by: Malka Ali [email protected] Signed-off-by: Malka123456 <[email protected]>
Signed-off-by: Malka Ali [email protected] Signed-off-by: Malka123456 <[email protected]>
320d260
to
fd555cc
Compare
Instead of directly accessing the kind via parsedCrd.LookupPath(cue.ParsePath("spec.names.kind")), consider utilizing the NameExtractor from the cfg.CrdFilter configuration. Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Malka Ali <[email protected]>
Thank you for your contribution!! |
🔧 Summary
This PR addresses Meshery issue #15337 by excluding Kubernetes resources that end with the "List" suffix (such as PodList, DeploymentList, etc.) from component generation.
✅ Changes Made
openapi_generator.go:
Added logic to skip resources whose kind ends with "List" during the OpenAPI-based component generation.
generateComponent.go:
Implemented a similar check to ignore "List" kinds from CRDs, ensuring they are not parsed into Meshery components.
🧠 Rationale
Kubernetes generates List types for listing resources, which do not represent actual resources.
Including them in Meshery’s component model is unnecessary and misaligns with Meshery’s intended functionality.
🔗 Linked Issue
meshery/meshery#15337