Skip to content

Conversation

Malka123456
Copy link
Contributor

🔧 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

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 skips kinds 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 the spec.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

  1. 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.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

@Malka123456 Malka123456 force-pushed the fix/ignore-list-resources-in-crds branch from 320d260 to fd555cc Compare July 25, 2025 04:11
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]>
@vr-varad
Copy link
Member

vr-varad commented Aug 5, 2025

Thank you for your contribution!!
If this work is complete, this is a good item to add to the weekly Meshery Development meeting agenda. You can add this item in the doc, attend, and present it. Meeting details at https://meet.layer5.io/meshery.

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