Skip to content

Conversation

@JZacharie
Copy link

This PR introduces support for the .report root field in the CRD plugin for Steampipe.

Changes:
Implemented parsing and handling of the .report root field in custom resource definitions.

Added logic to expose this data in the table schema.

Performed manual testing to validate expected behavior on sample CRDs.

image image

This addition helps expose more structured insights from CRDs with .report fields, improving visibility for policy and compliance checks.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for parsing and exposing .report root fields from Kubernetes Custom Resource Definitions (CRDs) in the Steampipe plugin, enabling better visibility for policy and compliance checks.

  • Extends the CRD plugin to parse and handle .report fields from custom resources
  • Adds dynamic column generation for report properties with proper naming conventions
  • Updates the data extraction logic to include report data from both manifest files and deployed resources

@ParthaI
Copy link
Contributor

ParthaI commented Aug 7, 2025

Hello @JZacharie, Great to see the PR! Could you please address the review comments provided by Copilot?

@ParthaI
Copy link
Contributor

ParthaI commented Aug 7, 2025

Hi @JZacharie,

I’ve been reviewing the recent code changes — they look great overall, thank you for the work!

However, while testing, I encountered the following issue:

Warning: failed to start plugin instance 'hub.steampipe.io/plugins/turbot/kubernetes@latest': failed to plugin initialise plugin 'steampipe-plugin-kubernetes': TableMapFunc 'pluginTableDefinitions' had unhandled error: interface conversion: interface {} is nil, not v1.JSONSchemaProps.

This seems to occur when the report property is not defined in the CRD. Additionally, during plugin load time, we're not setting a default value or handling the absence of report, which appears to be the root cause of the interface conversion error.

Would you mind taking a look when you get a chance?

Attaching the sample CRD files below.
crd.yaml:

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: widgets.example.com  # Fully qualified name of the CRD
spec:
  group: example.com         # API group
  names:
    plural: widgets          # Plural name for the resource
    singular: widget         # Singular name
    kind: Widget             # PascalCase name used in YAML
    shortNames:
    - wdg                    # Optional shorthand
  scope: Namespaced          # Namespaced or Cluster-wide
  versions:
  - name: v1                 # API version
    served: true             # Can be served by the API server
    storage: true            # Stored in etcd
    schema:
      openAPIV3Schema:
        type: object
        properties:
          spec:
            type: object
            properties:
              size:
                type: string
                enum:
                - small
                - medium
                - large

widget.yaml:

apiVersion: example.com/v1
kind: Widget
metadata:
  name: my-widget
spec:
  size: medium

Thanks Again!

Copy link
Author

@JZacharie JZacharie left a comment

Choose a reason for hiding this comment

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

looks ok for me;

Copy link
Author

@JZacharie JZacharie left a comment

Choose a reason for hiding this comment

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

I reused your previous code for status, since it has the same constraint as report. This means the AI's purpose could be improved, but I didn’t fully focus on that part.

@ParthaI
Copy link
Contributor

ParthaI commented Aug 13, 2025

Hello @JZacharie, when you have a moment, could you please apply the workaround and update this PR according to the issue I mentioned above?

@rajlearner17 rajlearner17 added the steampipe Steampipe plugin issues label Aug 13, 2025
@ParthaI
Copy link
Contributor

ParthaI commented Sep 2, 2025

Hi @JZacharie, have you had a chance to review the code changes again?

@misraved misraved added the community-contribution Pull requests for plugins contributed by the community label Sep 2, 2025
@misraved misraved requested a review from ParthaI September 4, 2025 14:45
@github-actions
Copy link

github-actions bot commented Nov 3, 2025

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the stale No recent activity has been detected on this issue/PR and it will be closed label Nov 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Pull requests for plugins contributed by the community stale No recent activity has been detected on this issue/PR and it will be closed steampipe Steampipe plugin issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Support for non-standard top-level fields in CRDs (e.g. .report) in kubernetes_crd table

4 participants