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

Refactor error handling in backend package #172

Closed dwertent closed 1 year ago

dwertent commented 1 year ago

PR Type:

Refactoring


PR Description:

This pull request includes changes to the error handling mechanism in the backend package. The changes mainly involve the removal of the error channel (errChan) used in various functions, and replacing it with direct error handling. This simplifies the error handling process and makes the code more readable and maintainable.


PR Main Files Walkthrough:

mainhandler/kubescapehandler.go: Removed the use of error channel (errChan) in various functions and replaced it with direct error handling. mainhandler/vulnscan.go: Removed the use of error channel (errChan) in various functions and replaced it with direct error handling. mainhandler/handlerequests.go: Removed the use of error channel (errChan) in various functions and replaced it with direct error handling. mainhandler/imageregistryhandler.go: Removed the use of error channel (errChan) in various functions and replaced it with direct error handling. utils/typesutils.go: Removed the use of error channel (errChan) in various functions and replaced it with direct error handling. restapihandler/triggeraction.go: Removed the use of error channel (errChan) in various functions and replaced it with direct error handling. watcher/watcher.go: Changed error logging level from Error to Debug for the getParentIDForPod function. mainhandler/handlerequestsutils.go: Updated log message for the readiness of vulnerability scanning.

dwertent commented 1 year ago

/describe

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: