kubescape / storage

Apache License 2.0
1 stars 6 forks source link

Summary api objects #37

Closed rcohencyberarmor closed 12 months ago

rcohencyberarmor commented 1 year ago

PR Type:

Enhancement


PR Description:

This PR introduces the support for Vulnerability Summary API objects. The new type, VulnerabilitySummary, is added along with the relevant files. This type is not stored in the storage, it is always regenerated for every K8S GET API. All other K8S API to this object will return an error claiming that the current API used is not supported. The PR also includes tests for the new functionality.


PR Main Files Walkthrough:

pkg/registry/file/vulnsummarystorage_test.go: This file contains the tests for the VulnerabilitySummaryStorage. It tests the Create, Delete, Watch, GetList, GuaranteedUpdate, Count, and Get methods, all of which are expected to return an error as they are not supported for this object. pkg/generated/openapi/zz_generated.openapi.go: This file contains the OpenAPI definitions for the new VulnerabilitySummary type. pkg/generated/clientset/versioned/typed/softwarecomposition/v1beta1/fake/fake_softwarecomposition_client.go: This file contains the fake client for the VulnerabilitySummary type, used for testing. pkg/registry/file/vulnsummarystorage.go: This file contains the implementation of the VulnerabilitySummaryStorage. It includes the methods for Create, Delete, Watch, GetList, GuaranteedUpdate, Count, and Get. All of these methods return an error as they are not supported for this object. pkg/apis/softwarecomposition/v1beta1/zz_generated.conversion.go: This file contains the auto-generated conversion functions for the VulnerabilitySummary type. pkg/apis/softwarecomposition/types_test.go: This file contains the tests for the types in the softwarecomposition API. pkg/generated/clientset/versioned/typed/softwarecomposition/v1beta1/vulnerabilitysummary.go: This file contains the client for the VulnerabilitySummary type. pkg/generated/clientset/versioned/typed/softwarecomposition/v1beta1/fake/fake_vulnerabilitysummary.go: This file contains the fake client for the VulnerabilitySummary type, used for testing. pkg/generated/listers/softwarecomposition/v1beta1/vulnerabilitysummary.go: This file contains the lister for the VulnerabilitySummary type. pkg/generated/informers/externalversions/softwarecomposition/v1beta1/vulnerabilitysummary.go: This file contains the informer for the VulnerabilitySummary type.


User Description:

support vuln summary object:

  1. add new type VulnerabilitySummary and generate relevant files (new type doc: https://cyberarmor-io.atlassian.net/wiki/spaces/RD/pages/216727553/Summary+vuln+object+CRD+modification)
  2. this type is not actually store in the storage, it is always regenerate for every K8S GET API
  3. all of other K8S API to this object will return error that claims that the current API used is not supported
codiumai-pr-agent[bot] commented 1 year ago

PR Analysis

How to use

To invoke the PR-Agent, add a comment using one of the following commands: /review [-i]: Request a review of your Pull Request. For an incremental review, which only considers changes since the last review, include the '-i' option. /describe: Modify the PR title and description based on the contents of the PR. /improve: Suggest improvements to the code in the PR. /ask \<QUESTION>: Pose a question about the PR.

To edit any configuration parameter from 'configuration.toml', add --config_path=new_value For example: /review --pr_reviewer.extra_instructions="focus on the file: ..." To list the possible configuration parameters, use the /config command.

rcohencyberarmor commented 1 year ago

@vladklokun for now we are not going to support cluster scope, just namespace scope.

github-actions[bot] commented 1 year ago

Summary:

github-actions[bot] commented 1 year ago

Summary:

codiumai-pr-agent[bot] commented 1 year ago

PR Analysis

How to use

To invoke the PR-Agent, add a comment using one of the following commands: /review [-i]: Request a review of your Pull Request. For an incremental review, which only considers changes since the last review, include the '-i' option. /describe: Modify the PR title and description based on the contents of the PR. /improve [--extended]: Suggest improvements to the code in the PR. Extended mode employs several calls, and provides a more thorough feedback. /ask \<QUESTION>: Pose a question about the PR. /update_changelog: Update the changelog based on the PR's contents.

To edit any configuration parameter from configuration.toml, add --config_path=new_value For example: /review --pr_reviewer.extra_instructions="focus on the file: ..." To list the possible configuration parameters, use the /config command.

github-actions[bot] commented 1 year ago

Summary: