kubescape / operator

Operator is an in-cluster component of the Kubescape security platform. It allows clients to connect to itself, listens for commands from the connected clients and controls other in-cluster components according to received commands.
Apache License 2.0
13 stars 20 forks source link

don't check for accountID without service discovery #171

Closed matthyx closed 1 year ago

matthyx commented 1 year ago

PR Type:

Refactoring


PR Description:

This PR modifies the configuration validation logic to only check for the presence of an AccountID when the Service Discovery feature is enabled. This change is reflected in both the main application logic and the associated tests.


PR Main Files Walkthrough:

config/config.go: Removed the check for AccountID from the LoadClusterConfig function. Introduced a new function ValidateConfig that checks for AccountID only if Service Discovery is enabled. config/config_test.go: Added a new test function TestValidateConfig to test the new ValidateConfig function under various scenarios. main.go: Added a call to the new ValidateConfig function to validate the configuration during the application startup.

codiumai-pr-agent-free[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: