kubescape / storage

Apache License 2.0
1 stars 6 forks source link

support known servers #65

Closed Daniel-GrunbergerCA closed 8 months ago

Daniel-GrunbergerCA commented 9 months ago

PR Type:

Refactoring, Enhancement


PR Description:

This PR enhances the KnownServers Custom Resource Definition (CRD) to support a list of KnownServerEntry objects. The changes include:


PR Main Files Walkthrough:

files: `pkg/generated/openapi/zz_generated.openapi.go`: Updated the OpenAPI definitions to reflect the changes in the `KnownServer` CRD. This includes adding definitions for `KnownServer`, `KnownServerEntry`, and `KnownServerList`. `pkg/registry/file/generatednetworkpolicy.go`: Updated the `generateNetworkPolicy` function and related functions to work with the updated `KnownServer` CRD. This includes changes in the function parameters and the logic to handle the new structure of `KnownServer`. `pkg/registry/file/generatednetworkpolicy_test.go`: Updated the unit tests to validate the new functionality of `KnownServer`. This includes changes in the test data to reflect the new structure of `KnownServer`. `pkg/generated/informers/externalversions/softwarecomposition/v1beta1/interface.go`: Added a `KnownServerInformer` to the versioned informer for the `softwarecomposition` API group. `pkg/apis/softwarecomposition/v1beta1/network_types.go`: Updated the `KnownServer` type definition to include a list of `KnownServerEntry` objects.

User Description:

Support KnownServer CRD. This PR fixes the tests and generation of network policies according to changes made on this CRD. The main change is that the old struct held a single object on the internal list, and the new one hold a list of objects (a list of KnownServerEntry), as defined on the design doc.

There is also a new test which verifies that this new list works as expected.

codiumai-pr-agent[bot] commented 9 months 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 9 months ago

Summary:

github-actions[bot] commented 9 months ago

Summary:

github-actions[bot] commented 9 months ago

Summary:

github-actions[bot] commented 8 months ago

Summary: